ios - Facebook 登录 ViewController 不存在
问题描述
我正在尝试在我的 firebase 应用程序中使用 facebook 登录。我设置了像firebase这样的所有东西,这个facebook网站说(https://developers.facebook.com/docs/facebook-login/ios?locale=en_US)使用facebook登录的ViewController没有出现。我不明白为什么。我什么都试过了...
我在控制台中收到这些错误:
-canOpenURL: failed for URL: "fbauth2:/" - error: "The operation couldn’t be completed. (OSStatus error -10814.)"
The operation couldn’t be completed. (com.facebook.sdk.core error 3.)
在
didFinishLaunchingWithOptions
在 AppDelegate 中,我像 fb 网站上的教程一样写了这个
FBSDKApplicationDelegate.sharedInstance().application(application, didFinishLaunchingWithOptions: launchOptions)
这在 application:openURL... 函数中:
let handled: Bool = FBSDKApplicationDelegate.sharedInstance().application(application, open: url, sourceApplication: options[UIApplication.OpenURLOptionsKey.sourceApplication] as? String, annotation: options[UIApplication.OpenURLOptionsKey.annotation])
return handled
我为 fb 安装了这些 cocoapods:
pod 'FBSDKLoginKit'
pod 'FBSDKCoreKit'
pod 'FBSDKShareKit'
提前致谢
解决方案
此错误已在 4.39.1 SDK 版本中修复。https://developers.facebook.com/docs/ios/change-log-4x/
推荐阅读
- java - 使用 JPA 注释强制加入查询
- ruby-on-rails - FFMPEG 安装在 Amazon Cloud9 IDE 上
- machine-learning - 使用 logit 损失函数创建自定义 BCE
- ios - 如何在 SpriteKit 中制作水平滚动字符选择器
- javascript - 如何在没有使用 KlaviyoClient 的 Http Get 的情况下从响应 API 获取状态码?
- string - 如何对具有关联整数(我为他们评分)的字符串(在我的情况下为玩家)进行排序?
- angular - 模块“AppModule”声明的意外值“CacheService”。请添加@Pipe/@Directive/@Component 注解
- sql - 选择该团队的每个成员在列中没有特定值的组
- flutter - Flutter 图表转换为 chromecast
- yaml - 如何使用 cy.Visit() 从 Docker 容器内的 keycloak 访问重定向 url?