Skip to content
This repository has been archived by the owner on Sep 19, 2019. It is now read-only.

GoogleSignIn.getLastSignedInAccount for google fit api ALWAYS prompt account selection #44

Closed
ykorshev opened this issue Jan 7, 2019 · 2 comments

Comments

@ykorshev
Copy link

ykorshev commented Jan 7, 2019

I have an app which uses Google Fit. The integration code has been copied from google documentation:
if (!GoogleSignIn.hasPermissions(GoogleSignIn.getLastSignedInAccount(this), fitnessOptions)) { GoogleSignIn.requestPermissions( this, // your activity GOOGLE_FIT_PERMISSIONS_REQUEST_CODE, GoogleSignIn.getLastSignedInAccount(this), fitnessOptions); } else { accessGoogleFit(); }
In the debug mode, everything works fine, but when my app downloaded from Google Play, it ALWAYS display a prompt for selecting the google account to use:
image
The problem appears only when app downloaded from google play. When app installed with adb, everything works fine.

It seems like, Google Play Services does not cache last selected account.

Please help me, where is the issue here?

@codingjeremy
Copy link
Contributor

I am closing this issue/PR, as it has been migrated to the new repo linked above in the comments. Thank you!

@mlazari
Copy link

mlazari commented Sep 12, 2019

@ykorshev See my comment in android/fit-samples#25 (comment)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants