当前位置:   article > 正文

python苹果手机的api,我试图获取苹果音乐API的用户令牌,我已经从python终端命令生成了有效的开发人员令牌...

apple music api python

I am using first time apple music api in my IOS app. I have already generate developer token with the help of python commands.

i am getting error every time when request for the user token "An error occurred when requesting user token: The operation couldn’t be completed. (SKErrorDomain error 7.)"

my developer token look like as "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)")

})

}

Please anyone help me ....

解决方案

It is the problem of develop token. I fixed it by using https://github.com/pelauimagineering/apple-music-token-generator. At the beginning, i use another ruby generator to get develop token. I test ok by using curl -v -H 'Authorization: Bearer [developer token]' "https://api.music.apple.com/v1/catalog/us/songs/203709340", but also get (SKErrorDomain error 7.) in sample code. Now it is ok. The ruby generator doesn’t work with requesting user tokens:https://github.com/pelauimagineering/apple-music-token-generator/issues/4

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家小花儿/article/detail/505938
推荐阅读
相关标签
  

闽ICP备14008679号