ios - SCSDKLoginKit (snapchat) 中的重定向功能不起作用

标签 ios snapchat

我正在尝试在我的项目中实现 Snapchat 登录按钮。我已经下载了 SDK,创建了 Snapchat 开发者帐户,并在 info.plist 中编写了一些代码。

现在我可以登录 Snapchat 帐户,但当我单击返回应用程序时,我收到 404 未找到错误页面。我认为问题出在这个函数上,因为当我点击后退按钮时它不起作用:

  func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {

    FBSDKApplicationDelegate.sharedInstance()?.application(application, didFinishLaunchingWithOptions: launchOptions)

    TWTRTwitter.sharedInstance().start(withConsumerKey: "xxx", consumerSecret: "xxx")

    return true
}

  func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {

    if TWTRTwitter.sharedInstance().application(app, open: url, options: options) {return true}

    if FBSDKApplicationDelegate.sharedInstance().application(app, open: url, options: options) {return true}

    if SCSDKLoginClient.application(app, open: url, options: options) {return true} // not work this func

    return true
}

对于 Facebook 或 Twitter,还有一项功能可以让它们在您进入应用程序时发挥作用,但对于 Snapchat,它不存在。

我在 Snapchat 官方文档中找不到任何相关信息。 可能是什么问题?

最佳答案

再看看info.list,这很棘手,当我遇到同样的问题时,请确保你的 SCSDKRedirectUrl 在你的 snapchat 应用程序中相同,原因是我的 SCSDKRedirectUrl 的第一个字符是大写字母,当我将其更改为小信一切都好 即

<key>SCSDKRedirectUrl</key>
<string>yourAppName://auth/snap</string>

<key>LSApplicationQueriesSchemes</key>
<string>yourAppName</string>
<array>

关于ios - SCSDKLoginKit (snapchat) 中的重定向功能不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55379356/

相关文章:

Android - 如何在 Snapchat 等 Activity 之间滑动?

ios - Objective-C 如何只压缩视频而不压缩视频和文本叠加层?

snapchat - snapchat 用户名中允许使用的字符是什么

swift - Snapchat LoginKit 导致 fatal error (Swift)

iOS 自动化 : how to tap button that has no id

ios - 当我改变方向时,我的 View 的高度和宽度不会改变

ios - 如何将数据从 ViewController 传递到标签栏 iOS 中的 ViewController?

ios - 在 Zendesk (iOS) 中发送评论附件

ios - 如何检测设备是否为 iOS 8.3 中的 iPad?

swift - Snap Kit 登录套件错误 (Swift)