检查苹果音乐许可
func appleMusicRequestPermission() -> Bool{
var isAllowAccess: Bool = false
switch SKCloudServiceController.authorizationStatus(){
case .notDetermined:
print("The user hasn't decided yet - so we'll break out of the switch and ask them.")
let allow = self.askAppleMusicPermissio()
isAllowAccess = allow
break
case .denied:
print("The user has selected 'Don't Allow' in the past - so we're going to show them a different dialog to push them through to their Settings page and change their mind, and exit the function early.")
isAllowAccess = false
break
case .restricted:
print("User may be restricted; for example, if the device is in Education mode, it limits external Apple Music usage. This is similar behavior to Denied.")
isAllowAccess = false
break
case .authorized:
print("The user's already authorized - we don't need to do anything more here, so we'll exit early.")
isAllowAccess = true
break
default:
isAllowAccess = false
break
}
return isAllowAccess
}