ios - signInSilently() generates an error code=-4 -


i'm having case gidsignin.sharedinstance().signinsilently() returning error:

error domain=com.google.gidsignin code=-4 "the operation couldn’t completed. (com.google.gidsignin error -4.)"

i can't seem find documentation of error under google signin docs or stackoverflow matter.

i'm expecting error happen if request silent signin no signedin user. surprise happens when have user signedin , attempt signin silently second time after few seconds.

a second issue i'm having difficulty determine if there user signed in using :

gidsignin.sharedinstance().currentuser 

which either nil or gidgoogleuser object.

any making progress on issue appreciated.

thanks

here error codes gidsignin.h. -4 code sent signinsilently when there no auth tokens in keychain. see comments.

// list of potential error codes returned google identity sdk. typedef ns_enum(nsinteger, gidsigninerrorcode) {   // indicates unknown error has occured.   kgidsigninerrorcodeunknown = -1,   // indicates problem reading or writing application keychain.   kgidsigninerrorcodekeychain = -2,   // indicates no appropriate applications installed on user's device can handle   // sign-in. code ever returned if using webview , switching browser have   // both been disabled.   kgidsigninerrorcodenosigninhandlersinstalled = -3,   // indicates there no auth tokens in keychain. error code returned   // signinsilently if user has never signed in before given scopes, or if have   // since signed out.   kgidsigninerrorcodehasnoauthinkeychain = -4,   // indicates user canceled sign in request.   kgidsigninerrorcodecanceled = -5, }; 

for google sdks in general i've found header file comments pretty place look, more informative published documentation.


Comments