【问题标题】:Spotify SPTAuthViewController issuesSpotify SPTAuthViewController 问题
【发布时间】:2015-11-08 08:18:07
【问题描述】:

我在授权 Spotify 时遇到问题。我相信我第一次登录但它在身份验证过程的最后一页冻结了。现在当我尝试登录时,弹出框是一个空白屏幕。此外,当我清除我的 cookie 时,会出现登录屏幕,但不会继续输入我的用户名和密码。感谢这里的帮助

我已经尝试在目标 c 中按照 sdk 中的“Simple Track Playback”演示以及使用本教程 http://pachulski.me/2015/spotifyframework-with-swift/ 快速执行此操作

【问题讨论】:

    标签: ios objective-c swift login spotify


    【解决方案1】:

    我遇到了同样的问题(空白弹出框)。当我将“App Transport Security Settings”(类型:Dictionary)添加到 info.plist,然后实现“Allow Arbitrary Loads”(类型:BOOL)并将其设置为“YES”时,此问题已得到解决。

    请参考截图:

    编辑:添加代码以在 cmets 中回答 Brian 的问题:

    - (IBAction)loginButtonPressed:(id)sender {
    
    _authVC = [SPTAuthViewController authenticationViewController];
    
    _authVC.delegate = self;
    _authVC.modalPresentationStyle = UIModalPresentationOverCurrentContext;
    _authVC.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
    
    self.modalPresentationStyle = UIModalPresentationCurrentContext;
    self.definesPresentationContext = YES;
    [self presentViewController:_authVC animated:NO completion:nil];
    }
    

    【讨论】:

    • 您介意告诉我您实现 API 的过程吗?
    • 我关注了您链接的来源(这对我有很大帮助,直到我遇到这篇文章,我才知道 SPTAuthViewController 弹出窗口)。它不应该与您编码的内容有很大不同。将我的 IBAction 代码添加到答案中(当用户点击我的“登录”按钮时)。它在 Obj-C 中,但我希望没问题。
    猜你喜欢
    • 2011-11-14
    • 1970-01-01
    • 1970-01-01
    • 2021-07-04
    • 2019-05-27
    • 1970-01-01
    • 2015-01-10
    • 2014-01-11
    • 2019-01-18
    相关资源
    最近更新 更多