SKCloudServiceController uses wrong Apple Id on Mac Catalyst!

This is becoming a big issue for us. We have a MusicKit app developed using Catalyst and since we released the Mac version we’ve had a constant trickle of users who seem to be completely unable to use the app because SKCloudServiceController().requestCapabilities reports that they do not have .addToCloudMusicLibrary capability, although this is clearly incorrect and they have all the right permissions (the iOS app version works fine).

After a LOT of investigation we’ve discovered that on a Mac where the logged-in user has:

  • iCloud logged-in using Apple ID “user1”
  • App Store & Book Store logged-in using Apple ID “user2”
  • Apple Music/iTunes/Media logged-in under Apple ID “user3”

SKCloudServiceController().requestCapabilities will sometimes report the Apple Music capabilities of “user2” or even “user1” rather than “user3”.

This is very bad: it should only ever use the “user3” account. In one situation, user2 actually had an Apple Music account with the requisite permissions and our app ended-up creating playlists in user2’s account rather than user3’s account.

We’ve reported this as a bug (FB9100381) but heard nothing back. Can someone please acknowledge that this is being looked-at?

The issue does appear to be intermittent and some Mac’s work fine. However we find that a brand-new Mac set up with a single user account where that account uses different apple id’s, as above, the issue is quite easy to reproduce.

iOS handles this 100% correctly. It’s only a MacOS (Big Sur) issue and we’re getting a constant trickle of unwarranted of 1* reviews because of it.

Thanks!

Hello @dutton,

Thank you very much for this detailed bug report.

I looked into it, and it looks like a fix for this specific issue was recently added, and included in macOS Monterey beta 1.

Would you mind trying this again on macOS Monterey?

I hope this helps.

Best regards,

Thanks, we’ll give it a try

We've now tried this on Monterey. There's still an issue but I think we learned a bit more:

  1. We created a fresh user account on the machine and logged-in to iCloud/Books/App Store/TV with an Apple ID which did not have Apple Music access. We logged-in to Music with an ID which had Apple Music access and enabled "Sync Library" from within the Music app
  2. At this stage, as before (on Big Sur), SKCloudServiceController().requestCapabilities denied that the user had ".addToCloudMusicLibrary" capability (even though they clearly had)
  3. Because the Apple ID we used for Music had not previously been used we opened the Music app and tried a variety of operations to make sure that they could play tracks / playlists / albums Ok and that we had the right authorisations. This was the same Apple ID we had used for our Big Sur testing
  4. As part of this we created a playlist in the user's library and then deleted it. Immediately after we did this, SKCloudServiceController().requestCapabilities started returning ".addToCloudMusicLibrary" capability

So it seems as though creating an initial playlist in the account "kicked" it into life. Given that most of our users are new to Apple Music it's entirely possible that they have not created playlists before running our app, which might explain why we get this error so frequently.

Unfortunately we only had the one spare Apple ID with unused Apple Music capability so we haven't been able to repeat the above steps to confirm. Now the account has started returning .addToCloudMusicLibrary it always seems to work on any machine.

Also FYI we have not been able to reproduce the issue where we managed to create playlists in the wrong account on Monterey, which is definitely progress.

Hello @dutton,

Thank you very much for this detailed feedback.

This seems like a totally different issue than the one you had on Big Sur. It might manifest in the same way to you, with .addToCloudMusicLibrary not being returned to you reliably by SKCloudServiceController.requestCapabilities(), but it's clearly happening during a shorter window of time, making it a smaller edge case than the issue you encountered in Big Sur.

For this reason, we need to investigate this separately.

It would be very helpful if you could capture a sysdiagnose from that Mac running macOS Monterey beta 1 as soon as possible. Then, could you please file a ticket on Feedback Assistant including this sysdiagnose?

Thank you very much in advance for your help.

Best regards,

Sysdiagnose is attached to FB9191110 (currently uploading). Note that, as described above, we're not able to reproduce the issue now that the account in question has some actual content in it's library. As a result I'm not sure the sysdiagnose will be very useful.

deleted

SKCloudServiceController uses wrong Apple Id on Mac Catalyst!
 
 
Q