AppleMusicKit SDK / Sample Project - UserToken issue

↘锁芯ラ 提交于 2019-12-11 08:03:26

问题


I'm currently experimenting with the Adding-Content-to-Apple-Music code found here: https://developer.apple.com/musickit/

I'm using: XCode 9 beta 2, iOS 11 (iPhone 5s)

I have a developer token (which works when I query the Apple Music API searching songs etc...) but I now want to use this to exchange for a User Token so I can perform write actions against my Apple Music account.

The test app fires up and allows me to request authentication. From this I can see:

  • MPMedia Library - Authorized
  • SKCloudServicesController - Authorized
  • Capabilities:
    • Add to Cloud Music Library
    • Music Catalog Playback

My next obvious step is to use the developer token to gain the user token. However, as soon as I call the following:

cloudServiceController.requestUserToken(forDeveloperToken: developerToken, completionHandler: completionHandler)

i see the following error in the completionHandler - can anyone help?

2017-07-14 10:05:39.179300+0100 Adding-Content-to-Apple-Music[1326:172100] [MC] Reading from public effective user settings.

2017-07-14 10:05:40.635503+0100 Adding-Content-to-Apple-Music[1326:172299] [core] "Error returned from daemon: Error Domain=com.apple.accounts Code=9 "(null)""

2017-07-14 10:05:40.636449+0100 Adding-Content-to-Apple-Music[1326:172100] SSAccountStore: Failed to fetch the backing accounts. error = Error Domain=com.apple.accounts Code=9 "(null)"

2017-07-14 10:05:40.800933+0100 Adding-Content-to-Apple-Music[1326:172297] [core] "Error returned from daemon: Error Domain=com.apple.accounts Code=9 "(null)""

2017-07-14 10:05:40.801259+0100 Adding-Content-to-Apple-Music[1326:172299] SSAccountStore: Failed to fetch the backing accounts. error = Error Domain=com.apple.accounts Code=9 "(null)" An error occurred when requesting user token: The operation couldn’t be completed. (SKErrorDomain error 1.)

In Settings > iTunes & App Store on my device I am logged in with my Apple ID. Same goes for Apple Music too.


回答1:


Update on this:

I also posted about this over on the Apple dev forums. It was an error on their side and now appears to be fixed. I can get a UserToken in both iOS 10 and 11 now.



来源:https://stackoverflow.com/questions/45099905/applemusickit-sdk-sample-project-usertoken-issue

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!