I'm trying to build a small toy MusicKit app on macOS Ventura (beta 4), and am running into something I think is probably an easy issue. I've started with the single-view application template, and have added a button, the target of which calls MusicKit methods:
@IBAction func buttonPushed(_ sender: Any) {
Task {
let status = await MusicAuthorization.request()
switch status {
case .authorized:
print("auth")
case .restricted:
print("restricted")
case .notDetermined:
print("not determined")
case .denied:
print("denied")
@unknown default:
print("default")
}
print(MusicAuthorization.currentStatus)
}
}
I have added the NSAppleMusicUsageDescription
key to the application's Info.plist
However, I am always seeing that MusicAuthorization.request() returns denied with no prompt to the user for access. Thank you in advance.