signInSilently() generates an error code=-4

前端 未结 8 1854
日久生厌
日久生厌 2020-12-20 11:24

I\'m having this case where the GIDSignIn.sharedInstance().signInSilently() is returning an error:

Error Domain=com.google.GIDSignIn Code=-4 \"The op

8条回答
  •  甜味超标
    2020-12-20 12:03

    Both Igor and Spydy worked for me

    A swift version of Igor's post

        GIDSignIn.sharedInstance().uiDelegate = self
    
        GIDSignIn.sharedInstance()?.hasAuthInKeychain()
        GIDSignIn.sharedInstance()?.signIn()
    
        // Uncomment to automatically sign in the user.
        GIDSignIn.sharedInstance().signInSilently()
    

    or from Spydy.

        // google sign in setup
        GIDSignIn.sharedInstance().uiDelegate = self
        if GIDSignIn.sharedInstance().hasAuthInKeychain() == true{
            GIDSignIn.sharedInstance().signInSilently()
        }
        else{
            GIDSignIn.sharedInstance().signIn()
        }
    

提交回复
热议问题