我在我的应用程序中有一个spotify登录并尝试进行自动登录:
登录功能
func getSpotifyToken(fromController controller: UIViewController, success: (spotifyToken: String?) -> Void, failure: (error: NSError?) -> Void) {
loginSuccessBlock = success
loginFailureBlock = failure
SPTAuth.defaultInstance().clientID = SpotifyClientID
SPTAuth.defaultInstance().redirectURL = NSURL(string: SpotifyRedirectURI)
SPTAuth.defaultInstance().requestedScopes = [SPTAuthStreamingScope, SPTAuthPlaylistReadPrivateScope]
let spotifyLoginController = SPTAuthViewController.authenticationViewController()
spotifyLoginController.delegate = self
spotifyLoginController.clearCookies { () -> Void in
controller.presentViewController(spotifyLoginController, animated: true, completion: nil)
}
}
Run Code Online (Sandbox Code Playgroud)
检查会话是否存在
private func spotifyConnected() -> Bool {
if SPTAuth.defaultInstance().session == nil {
self.loadSpotifySession()
}
return SPTAuth.defaultInstance().session != nil
}
Run Code Online (Sandbox Code Playgroud)
保存会议
private func saveSpotifySession() {
let sessionData …Run Code Online (Sandbox Code Playgroud) 我有2个目标 - 具有不同功能的Dev&Prod配置(为Prod禁用Apple Pay)
我已经将Info.plist文件与所需目标分开但是我无法对Proj.entitlements文件执行相同操作 - "实用工具"菜单中的"目标成员身份"部分已禁用
我在每个目标的构建设置中设置了相应的"代码签名权利",但仍然在"常规"选项卡中接收"提供配置文件'X'不支持'X'功能"
有没有办法说XCode,对于这个目标,他应该看看连接的.entitlements文件?