【问题标题】:Can I use the token from iOS SDK in Web API requests?我可以在 Web API 请求中使用来自 iOS SDK 的令牌吗?
【发布时间】:2020-01-08 10:00:34
【问题描述】:

我想在 iOS 应用程序中使用 Spotify SDK 进行登录,然后使用 SDK 中的令牌来执行 Web API 请求。这对我的用例来说是正确的令牌吗?

Spotify iOS SDK: iOS SDK | Spotify for Developers

Spotify 网络 API: Web API | Spotify for Developers

【问题讨论】:

    标签: ios http sdk token spotify


    【解决方案1】:

    这是要使用的正确令牌,但请确保请求 Web API 所需的所有范围。这是在 iOS 中使用范围的 iOS SDK 文档:https://spotify.github.io/ios-sdk/html/Constants/SPTScope.html

    一个使用SPTScope的例子:

    let requestedScopes: SPTScope = [
        .appRemoteControl, 
        .userReadEmail, 
        .userReadPrivate, 
        .streaming
    ] 
    sessionManager.initiateSession(with: requestedScopes, options: .default)
    

    【讨论】:

      猜你喜欢
      • 2014-08-15
      • 2020-04-06
      • 2020-07-19
      • 2015-09-28
      • 2016-06-26
      • 1970-01-01
      • 1970-01-01
      • 2012-05-19
      • 1970-01-01
      相关资源
      最近更新 更多