FB Login using Swift 3 not returning any values and not get back the user to the App after successful login

后端 未结 7 2281
南旧
南旧 2021-02-04 09:47

I\'m using iOS 10 Swift 3 to integrate FB Login. I have followed all steps from Facebook documentation. Now the issue is, aft

7条回答
  •  眼角桃花
    2021-02-04 10:12

    I have experienced the same problem with Facebook and Twitter integration.I have solved it as follows.

    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)
    }
    

提交回复
热议问题