奇怪的 facebook 在启动时崩溃

Strange facebook crash on launch

这是错误报告

Crashed: com.apple.main-thread
0  libswiftCore.dylib             0x103c2faa4 swift_getObjectType + 60
1                          0x102e3dc58 @objc AppDelegate.application(UIApplication, open : URL, sourceApplication : String?, annotation : Any) -> Bool (AppDelegate.swift)
2                          0x102f5e730 -[FIRAuthAppDelegateProxy object:selector:application:openURL:sourceApplication:annotation:] + 4303562544
3                          0x102f5d8e4 __47-[FIRAuthAppDelegateProxy initWithApplication:]_block_invoke.199 + 4303558884
4                          0x102ee6aa0 -[FIRAAppDelegateProxy application:openURL:sourceApplication:annotation:] + 4303071904
5  UIKit                          0x18e064acc __58-[UIApplication _applicationOpenURLAction:payload:origin:]_block_invoke + 880

用户从 Facebook 应用程序授予访问权限并返回我的应用程序后崩溃。

知道问题出在哪里吗?

在 AppDelegate 中尝试此代码

     func application(_ application: UIApplication,
                 open url: URL, sourceApplication: String?, annotation: Any) -> Bool {  ...   }

 @available(iOS 9.0, *)
func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any]) -> Bool {   ...   }

设置此 code.in 应用委托

   //For Facebook
func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool
{
    return FBSDKApplicationDelegate.sharedInstance().application(app, open: url, options: options)
}