Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/198.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 通过Google Play服务撤销驱动器访问权限_Android_Google Play Services_Google Drive Android Api - Fatal编程技术网

Android 通过Google Play服务撤销驱动器访问权限

Android 通过Google Play服务撤销驱动器访问权限,android,google-play-services,google-drive-android-api,Android,Google Play Services,Google Drive Android Api,有没有办法撤销通过Google Play服务授予的驱动器访问权限 关于本条: 我通过我的应用程序授予了对g drive的访问权限,如下所示: mGoogleApiClient = new GoogleApiClient.Builder(this) .addApi(Drive.API) .addScope(Drive.SCOPE_FILE) .addConnectionCallbacks(this) .addOnConnectionFailedListener(this) .build();

有没有办法撤销通过Google Play服务授予的驱动器访问权限

关于本条:

我通过我的应用程序授予了对g drive的访问权限,如下所示:

mGoogleApiClient = new GoogleApiClient.Builder(this)
.addApi(Drive.API)
.addScope(Drive.SCOPE_FILE)
.addConnectionCallbacks(this)
.addOnConnectionFailedListener(this)
.build();
我的问题是,有没有一种干净的方法来撤销g驱动器访问权限

i、 无需执行credential.getToken()并对

我正在寻找类似Drive.DriveApi.revokeAccessAndDisconnect()的东西

我知道有一个适用于g plus,但我找不到适用于g drive的。

是的,有一种方法可以撤销Google Drive作用域

GoogleSignInClient googleSignInClient = buildGoogleSignInClient();
googleSignInClient.revokeAccess().addOnCompleteListener(onCompleteListener);
在哪里

有关更多信息,请查看此项

private GoogleSignInClient buildGoogleSignInClient() {
    GoogleSignInOptions signInOptions =
            new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
                    .requestScopes(Drive.SCOPE_FILE)
                    .build();
    return GoogleSignIn.getClient(this, signInOptions);
}