android - How can I avoid user being prompted a second time for Google account selection? -


i'm developing , android app google play games services , i've followed getting started guide importing basegameutils module intellij project. working fine except whenever open activity inherits basegameactivity , call beginuserinitiatedsignin(), user prompted select google account connect (if more 1 present @ phone). fine if weren't fact in app, user authed through google play services using oauth2 (googleauthutil/accountpicker). it's given account he/she wants use - 1 shouldn't need ask again.

is there anyway can modifiy basegameactivity.java or gamehelper.java user not prompted again? and/or need alter how log in oauth2?

i've tried adding 4 scopes plus_profile, plus_login, games , app_state oauth login routine, accountpicker-popup sill appears in activity inheriting basegameactivity.

update: logcat-log

07-23 11:45:25.275: debug/csdn-gms(22315): isgoogleplayservicesavailable returned 0 07-23 11:45:25.275: debug/csdn-gms(22315): beginuserinitiatedsignin: starting new sign-in flow. 07-23 11:45:25.285: debug/csdn-gms(22315): connecting gamesclient. 07-23 11:45:25.295: debug/csdn-gms(22315): onstart. 07-23 11:45:25.295: debug/csdn-gms(22315): onstart: connecting clients. 07-23 11:45:25.295: debug/csdn-gms(22315): connecting gamesclient. 07-23 11:45:25.395: debug/csdn-gms(22315): onconnectionfailed: result 4 07-23 11:45:25.395: debug/csdn-gms(22315): onconnectionfailed: since user initiated sign-in, trying resolve problem. 07-23 11:45:25.395: debug/csdn-gms(22315): resolveconnectionresult: trying resolve result: connectionresult{statuscode=sign_in_required, resolution=pendingintent{4190b780: android.os.binderproxy@4190a780}} 07-23 11:45:25.395: debug/csdn-gms(22315): result has resolution. starting it. 

do need login oauth2 first, or sign google games first? if can away signing google games first, maybe use gamesclient.getcurrentaccountname(). https://developer.android.com/reference/com/google/android/gms/games/gamesclient.html#getcurrentaccountname() :

get name of selected account. account user has chosen use google play games.

then feed account selection oauth2 authentication.


Comments

Popular posts from this blog

How to mention the localhost in android -

php - Calling a template part from a post -

c# - String.format() DateTime With Arabic culture -