SKCloudServiceController macOS 11 not requesting permission

Completion closure for authorization status is not getting called on macOS 11. The same code works without any issues on iOS:

Code Block swift
static func requestAccess(_ completion: @escaping(Bool) -> Void) {
SKCloudServiceController.requestAuthorization { (status) in
switch status {
case .authorized:
completion(true)
case .denied, .notDetermined, .restricted:
completion(false)
@unknown default:
completion(false)
}
}
}


So for iOS I see the permission prompt to access AppleMusic/Music like "[App] would like to access Apple Music, your music and video activity, and your media library"

But for macOS closure never got executed. I wonder if thats the issue with documentation and it not will be supported for macOS apps or with implementation? But there is a separate section for apple music permission on macOS 11. What am I missing?

Xcode 12 beta 3
macOS 11 (20A5323l)

Link to docs: https://developer.apple.com/documentation/storekit/skcloudservicecontroller/1620609-requestauthorization?changes=latest_minor
Answered by jkmazur in 625366022
This message was about misread release notes in Xcode. Sorry for confusion - unfortunatelly cannot undo accepting answer
Same. I just reported this in FB8223550.
Accepted Answer
This message was about misread release notes in Xcode. Sorry for confusion - unfortunatelly cannot undo accepting answer
It's working on Big Sur Beta 4 and Xcode Beta 4 🤗
I am encountering two issues on beta 4:
  • In my test app, I get the compiler error Cannot find 'SKCloudServiceController' in scope even though I imported StoreKit. The exact same code compiled in beta 3.

  • In my real app, I don’t get the above error. But SKCloudServiceController.requestUserToken(forDeveloperToken:completionHandler:) returns Error Domain=SKErrorDomain Code=0 "UNKNOWN_ERROR".

Are you getting either of these?
No, full working code for me is:

Code Block swift
import Foundation
import StoreKit
class MusicLibraryAccess {
static func requestAccess(_ completion: @escaping(Bool) -> Void) {
SKCloudServiceController.requestAuthorization { (status) in
switch status {
case .authorized:
completion(true)
case .denied, .notDetermined, .restricted:
completion(false)
@unknown default:
completion(false)
}
}
}
}


I have a SwiftUI app with shared classes between iOS (14) and macOS (11.0) and this give me this indicator (see on SO since I cannot paste the picture here: https://stackoverflow.com/a/63261158/1317394)

maybe you need to reset your permission on system lvl by: tccutil reset All your.bundle.identifier
SKCloudServiceController macOS 11 not requesting permission
 
 
Q