Tuesday, 15 April 2014

android - Reset GoogleAuthUtil so it will as for permission again -



android - Reset GoogleAuthUtil so it will as for permission again -

i'm using google play services authentication illustration here

how reset googleauthutil inquire permission again?

it asks permission throwing userrecoverableexception fed dialog. asks permission 1 time. need test asking permission again.

i've tried uninstall sample app , re-install sample app , didn't work doesn't inquire permission seems knows app.

protected string fetchtoken() throws ioexception { seek { homecoming googleauthutil.gettoken(mactivity, memail, mscope); } grab (userrecoverableauthexception userrecoverableexception) { // googleplayservices.apk either old, disabled, or not // present, // recoverable, need show user ui through // activity. mygoogleplay.handleexception(userrecoverableexception); } grab (googleauthexception fatalexception) { onerror("unrecoverable error " + fatalexception.getmessage(), fatalexception); } homecoming null; } /** * method hook background threads , async tasks need provide * user response ui when exception occurs. */ public void handleexception(final exception e) { runonuithread(new runnable() { @override public void run() { if (e instanceof googleplayservicesavailabilityexception) { // google play services apk old, disabled, or not present. // show dialog created google play services allows // user update apk int statuscode = ((googleplayservicesavailabilityexception)e) .getconnectionstatuscode(); dialog dialog = googleplayservicesutil.geterrordialog(statuscode, helloactivity.this, request_code_recover_from_play_services_error); dialog.show(); } else if (e instanceof userrecoverableauthexception) { // unable authenticate, such when user has not yet granted // app access account, user can prepare this. // forwards user activity in google play services. intent intent = ((userrecoverableauthexception)e).getintent(); startactivityforresult(intent, request_code_recover_from_play_services_error); } } }); }

you can utilize google settings app de-authorize connected applications, next these steps:

launch google settings app

choose connected apps alternative (at top)

a list of connected apps displayed; find app want de-authorize , select it. sorry there no screenshot i'm not able remove personal info atm - should quite straightforward here :)

finally, click disconnect button (at bottom) on details page of app

note might take moment before app de-authorized.

android google-play-services

No comments:

Post a Comment