Google and Facebook Firebase Auth using swift 3

大兔子大兔子 提交于 2019-12-04 20:31:28

I think in application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> Bool, you need to get the result of GIDSignIn.sharedInstance().handle(url, sourceApplication: sourceApplication, annotation: annotation) and return it along with FB's too. So it should be something like this:

return handled || GIDSignIn.sharedInstance().handle(url,
                                      sourceApplication: sourceApplication,
                                      annotation: annotation)

Because according to the documentation here:

Returns YES if GIDSignIn handled this URL.

I guess your problem is not call GIDSignIn sign in function in your loginViewController:

@IBAction func signInButtonDidTouch(_ sender: Any) {

    GIDSignIn.sharedInstance().uiDelegate = self
    GIDSignIn.sharedInstance().delegate = self

    if GIDSignIn.sharedInstance().hasAuthInKeychain() {
        GIDSignIn.sharedInstance().signInSilently()
    } else {
        GIDSignIn.sharedInstance().signIn()
    }
}

The code above I had custom GG sign in button @IBOutlet weak var signInButton: GIDSignInButton!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!