简体   繁体   中英

Google Play Services - granting Oauth2 permission

Can you get the user to Authorize Oauth Permission(display the dialog) before a request is made? I would like to ask my users to grant permissions when they first use the app. The only way I know is to catch the UserRecoverableAuthException and launch the intent from there.

您可以致电http://developer.android.com/reference/com/google/android/gms/auth/GoogleAuthUtil.html#getToken(android.content.Context,java.lang.String,java.lang 。字符串)在您的应用首次启动时启动,如果用户已经同意,它将返回一个有效的令牌,或者抛出UserRecoverableAuthException,在这种情况下,您应该将用户定向到其中包含的意图。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM