I have a game, but I want to backup the user's data without them having to log in as they already sign in to Google Play Games. I use the below code to sign them in:
val signInOption = GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_GAMES_SIGN_IN)
.requestId()
.requestEmail()
.build()
signInClient = GoogleSignIn.getClient(this, signInOption)
if (GoogleSignIn.getLastSignedInAccount(/*context*/ this) != null) {
showButtons()
} else {
hideButtons()
}
I know I can get some sort of ID using
GoogleSignIn.getLastSignedInAccount(this)
but this ID changes, I was using it during testing, but now the app is in production the IDs of all users have changed.
My question is, if I use
.requestId()
.requestEmail()
how can I access either the ID or the email to use those to store the user's data? (obviously I'd prefer non-identifiable data like ID)