我正在我的 IOS 应用程序中第一次使用 Apple Music api。我已经在 python 命令的帮助下生成了开发者令牌。
每次请求用户令牌时,我都会收到错误“请求用户令牌时发生错误:操作无法完成。(SKErrorDomain 错误 7。)”
我的开发者令牌看起来像“esfd....................................... ......................................Mpo”
if #available(iOS 11.0, *)
{
SKCloudServiceController().requestUserToken(forDeveloperToken:
developerToken, completionHandler: { (userToken, error) in
print("An error occurred when requesting user token: \(error!.localizedDescription)")
})
}
else
{
SKCloudServiceController().requestPersonalizationToken(forClientToken: developerToken, withCompletionHandler: { (userToken, error) in
print("An error occurred when requesting user token: \(error!.localizedDescription)")
})
}
请任何人帮助我......
就是develop token的问题。我通过使用修复了它https://github.com/pelauimagineering/apple-music-token-generator https://github.com/pelauimagineering/apple-music-token-generator。一开始,我使用另一个 ruby 生成器来获取开发令牌。我使用curl -v -H 'Authorization: Bearer [developer token]' 测试正常https://api.music.apple.com/v1/catalog/us/songs/203709340 https://api.music.apple.com/v1/catalog/us/songs/203709340”,而且还在示例代码中获取 (SKErrorDomain error 7.)。现在可以了。ruby 生成器不适用于请求用户令牌:https://github.com/pelauimagineering/apple-music-token-generator/issues/4 https://github.com/pelauimagineering/apple-music-token-generator/issues/4
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)