SKCloudServiceController.requestAuthorization not working on iOS 13

After updating to iOS 13, the following code doesn't work anymore. The completion handler doesn't get called:


func requestAccess() {
    SKCloudServiceController.requestAuthorization { status in
        switch status {
        case .authorized:
            self.doAfterAuthorized()
        case .denied, .restricted:
            self.completion?([])
        case .notDetermined:
            self.completion?([])
        @unknown default:
            fatalError()
        }
    }
}


I'm on iOS 13 beta 4. I don't know if this is something exclusive to beta 4 or if already happened to older betas.


This issue may be related to https://forums.developer.apple.com/thread/119399

Replies

Having same issue

It was fixed on iOS 13 beta 5!

I hadn't tested this for a while, but I still have the same problem in iOS 13.1 beta 2 & iOS 12.4.1 so I suspect it's on the Apple Music server side. Here's what I observe:
Upon app launch, [SKCloudServiceController requestAuthorization:^(SKCloudServiceAuthorizationStatus status) {}

returns as expected and an invoked track will play as expected.

But any subsequent calls never return, so no further action is possible.

If I kill the app and re-launch, the call will again return exactly one time.


I'm certain that multiple calls returned as expected previously, as that's the way my released app has handled playing sequential Apple Music tracks for many moons.


Is it possible that it's now only intended to be called one time per app launch and persist the status for future use? That's not the way I recall the sample implementation, but perhaps it's a workaround.


Anyone else find any clues or keys to this issue?

Just came across this. In case it helps, I've found that you should always check SKCloudServiceController.authorizationStatus() before calling requestAuthorization. You only need to call requestAuthorization if SKCloudServiceController.authorizationStatus returns .notDetermined.