为什么 IOS13 登录 facebook 不起作用?

emr*_*maz 2 authentication facebook swift

我点击了 Facebook 按钮,但它在 iOS 13 上没有响应,但在 iOS 12.x 上它工作正常。我该怎么办?

我正在使用:
1) pod 'FBSDKCoreKit', '~> 5.13.1'
2) pod 'FBSDKLoginKit', '~> 5.13.1'
3) pod 'FacebookCore'
4) pod 'FacebookLogin'
5) pod 'FacebookShare'

Him*_*tel 12

您在 open url 方法中的 appdelegate 不起作用,因为 ios13 已更改

func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any]) -> Bool {
  return 
}    
Run Code Online (Sandbox Code Playgroud)

在添加此方法时,您必须使用最新的 xcode,而不是 SceneDelegate.swift 文件。请尝试一下。

func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) {
      guard let url = URLContexts.first?.url else {
          return
      }
      let _ = ApplicationDelegate.shared.application(
          UIApplication.shared,
          open: url,
          sourceApplication: nil,
          annotation: [UIApplication.OpenURLOptionsKey.annotation])
  }
Run Code Online (Sandbox Code Playgroud)

而不是忘了进口FBSDKLoginKit在SceneDelegate