swift3 - 苹果 musickit 用户 token

标签 swift3 ios10.3 apple-musickit

如何为 Apple musikkit API 创建音乐用户 token 。每次执行

SKCloudServiceController().requestPersonalizationToken(forClientToken: developerTokenString) { (userToken, error) in
if let token = userToken {
       //
   } else {
       debugPrint("user token error \(error!.localizedDescription)")
   }
}

开发者 token 获取错误

"The operation couldn’t be completed. (SKErrorDomain error 7.)"

有什么方法可以检查我的开发人员 token 是否有效。

最佳答案

根据 Apple documentation您可以使用以下命令在终端中测试您的 token :

curl -v -H 'Authorization: Bearer [developer token]' "https://api.music.apple.com/v1/catalog/us/songs/203709340"

关于swift3 - 苹果 musickit 用户 token ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47672398/

相关文章:

swift - 协议(protocol)扩展中的 .sort 不起作用

swift - 在字符串中查找引号内的字符

swift - 当快速点击远程推送通知时调用特定的 View Controller

ios - 使用playbackStoreID播放Apple Music歌曲时出现问题

swift - 基于 BOOL 状态交友,比较数组值比较困难,Firebase,Swift

swift - 在 swift SceneKit 中绘制带有顶点的自定义节点的示例是什么?

iOS : Homekit - How to detect Bluetooth & WiFi service enable in device or not?

swift - AppleMusicKit SDK/示例项目 - UserToken 问题

javascript - 通过 node.js 访问 MusicKit API 时出现 401 错误