Google 驱动器范围已弃用?

Google Drive scopes deprecated?

我正在编写一个可以直接播放媒体的应用程序 Google 驱动器。

Google 文档提到

https://www.googleapis.com/auth/drive.readonly

scope(见此处:https://developers.google.com/drive/web/scopes)这似乎正是我所需要的。然而,似乎 Android 驱动器 API 只支持那里提到的两个范围:

Drive.SCOPE_FILE Drive.SCOPE_APPFOLDER

所以我尝试了几个非标准范围,例如:

    mGoogleApiClient = new GoogleApiClient.Builder(XenoAmp.getContext())
            .addApi(Drive.API)
            //.addApi(DriveScopes.)
            //.addScope(Drive.SCOPE_APPFOLDER)
            .addScope(Drive.SCOPE_FILE)
            .addScope(new Scope("https://www.googleapis.com/auth/drive"))
            //.addScope(new Scope("https://www.googleapis.com/auth/drive.readonly"))
            //.addScope(new Scope("https://www.googleapis.com/auth/drive.metadata.readonly"))
            .addConnectionCallbacks(this)
            .addOnConnectionFailedListener(this).build();

然而我的 logcat 抱怨:

03-29 12:53:58.935:E/ClientConnectionOperation(9953):com.google.android.gms.drive.auth.c:授权失败:不支持的范围:https://www.googleapis.com/auth/drive

那么 - 是否不再支持驱动器作用域?那么我怎样才能访问 Goodle Drive 上的所有用户媒体文件呢?

是的,GDAA. If you need it, you have to go with the REST API. GDAA is not a 'newer' API, it is a different API. Both will be around for a while. You can compare these two here 不支持 DRIVE 范围。