简体   繁体   中英

FBSDKLoginKit freezes App after Login on iPad with iOS 10.x

I have a problem that after a successful login on iPads with iOS 10.x, the app freezes. The problem does not occur on iOS 11.x, I'm able to reproduce this behaviour in simulator as well as on real devices. Updated to version 4.34.0 , didn't solve the issue.

Anyone else experiencing this? Someone found a solution?

I faced after successful login it doesn't returning any values and not get back the user to the app. One Possible way is this. (change your openURL code with)

func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool {

    let appname:String = options.first?.value as! String
    print(appname)
    if appname == "com.facebook.Facebook" {
        return FBSDKApplicationDelegate.sharedInstance().application(
            app,
            open: url as URL!,
            sourceApplication: options[UIApplicationOpenURLOptionsKey.sourceApplication] as! String,
            annotation: options[UIApplicationOpenURLOptionsKey.annotation]
        )
    }
    return Twitter.sharedInstance().application(app, open: url, options: options)
}

Second Method for other iOS versions (iOS 10).

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

这个Facebook SDK适合我。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM