首页 > 解决方案 > 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.)

那是我的 Info.plist 文件 在此处输入图像描述

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'

提前致谢

标签: iosswiftfirebasefirebase-authenticationfacebook-login

解决方案


此错误已在 4.39.1 SDK 版本中修复。https://developers.facebook.com/docs/ios/change-log-4x/


推荐阅读