googlesigninapi

Check whether the user is already logged in using Auth.GoogleSignInApi?

♀尐吖头ヾ 提交于 2019-12-05 05:36:33
I fount that in order to sign in the user I have to use this code: Intent signInIntent = Auth.GoogleSignInApi.getSignInIntent(mGoogleApiClient); startActivityForResult(signInIntent, RC_SIGN_IN); to signout new ResultCallback<Status>() { @Override public void onResult(Status status) { disconnect(); } }); But when the user relaunch the app and he is already logged in (and no sign out before) is it possible to detect this 'currently logged in' state? Obviously, it is possible to save 'logged in' in the settings (shared preferences) of the app but is where any way to detect using google api? Here

Google Sign in doesn't return any result when 'Use another account' to sign in

岁酱吖の 提交于 2019-12-05 01:08:33
问题 This seems to be a basic feature but after following the signing-in tutorial, it only works if I choose the account that is already registered on the device. After choosing ' Use another account ' and completing some steps to authenticate it looses the call-back result, ( onActivityResult is not called ). I use GoogleSignInOptions : no exception occurs and I can't add any listener to detect exceptions. However, GoogleApiClient works fine but there are some deprecated methods, thus I decided

Google Sign in API - get photo Uri is null

那年仲夏 提交于 2019-12-04 09:58:55
I was using Google Sign in API to request user profile, likes user display name, avatar photo. I got null value GoogleSignInAccount.getPhotoUrl(), got value GoogleSignInAccount.getDisplayName(). Gmail account ok, but private account is not. private account is linked to Google gmail, it can see the picture in my Gmail account and Google Play store app, Google plus too. but why I got null value with using Google Sign In account API. GoogleSignInOptions.Builder builder = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN) .requestEmail(); builder.setAccountName(userAcc);

Google Sign in doesn't return any result when 'Use another account' to sign in

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-03 16:37:13
This seems to be a basic feature but after following the signing-in tutorial , it only works if I choose the account that is already registered on the device. After choosing ' Use another account ' and completing some steps to authenticate it looses the call-back result, ( onActivityResult is not called ). I use GoogleSignInOptions : no exception occurs and I can't add any listener to detect exceptions. However, GoogleApiClient works fine but there are some deprecated methods, thus I decided to switch to GoogleSignInOptions to avoid deprecation issues. Initizlization: googleSignInOptions = new

How to refresh ID token after it expires when integrating Google sign-in on Android?

混江龙づ霸主 提交于 2019-12-03 13:04:54
I've followed the guides on https://developers.google.com/ and I can get the Google ID token of the signed in user after the user signed in. But I noticed that the token will expire in 1 hour. I cannot find any official reference that tells me how to deal with expired Google ID token, so I can only ask the user to click the Google sign-in button again. How can I refresh a valid Google ID token after the old one expires, without bothering user to manually sign in again and again? Steven Soneff Yes, Google ID tokens are issued for one hour validity and will expire, you can simply use