iOS Facebook and Google login at the same time?

前端 未结 3 1129
-上瘾入骨i
-上瘾入骨i 2020-12-18 11:33

I\'m trying to implement google+ and facebook sign ins in the same app. I followed the instructions by Parse and Google and I first successfully implemented Facebook login.

3条回答
  •  星月不相逢
    2020-12-18 12:23

    You need to combine them. The simplest way is to use an || on the return statement. Try this:

    func application(application: UIApplication,
        openURL url: NSURL, options: [String: AnyObject]) -> Bool {
    
            return FBSDKApplicationDelegate.sharedInstance().application(application, openURL: url, sourceApplication: options[UIApplicationOpenURLOptionsSourceApplicationKey] as! String, annotation: nil)  ||
                GIDSignIn.sharedInstance().handleURL(url,
                sourceApplication: options[UIApplicationOpenURLOptionsSourceApplicationKey] as? String,
                annotation: options[UIApplicationOpenURLOptionsAnnotationKey] as? String)
    }
    

提交回复
热议问题