UserRecoverableAuthException: NeedPermission

后端 未结 6 645
醉酒成梦
醉酒成梦 2020-12-01 09:16

I tried to follow tutorial: https://developers.google.com/android/guides/http-auth.

Code:

token = GoogleAuthUtil.getToken(getApplicationContext(),
           


        
6条回答
  •  旧巷少年郎
    2020-12-01 09:39

    Try following the Drive quickstart for Android, it is a step-by-step guide showing how to authorize and upload a file to Drive: https://developers.google.com/drive/quickstart-android

    To be more specific, it looks like you are not catching the UserRecoverableException and triggering the intent to have the user authorize the app. This is documented in the Google Play Services docs you linked and handled in the quickstart sample as follows:

    ...
    } catch (UserRecoverableAuthIOException e) {
      startActivityForResult(e.getIntent(), REQUEST_AUTHORIZATION);
    }
    ... 
    

提交回复
热议问题