Facebook登录ViewController不存在

时间:2019-01-05 22:41:30

标签: ios swift firebase firebase-authentication facebook-login

我正在尝试在我的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文件 enter image description here

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'

预先感谢

2 个答案:

答案 0 :(得分:2)

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

答案 1 :(得分:0)

已解决此问题:

在pod文件中

pod 'FBSDKCoreKit', '~> 4.38.0'
pod 'FBSDKLoginKit', '~> 4.38.0'

pod install 

清理构建文件夹并运行