我正在开发一个 android 应用程序,其中包括 Google Classroom 和 Google Drive 之间的交互功能。问题是,Google Classroom API 似乎相当有限,并且尚未与其他 Google API 很好地集成。
我想通过 Google Sign-In 请求 Google Classroom 访问权限(我也请求 Google Drive 访问权限)。有没有一种简单的方法可以做到这一点,如果有,怎么做?
请参阅下面的代码以更好地理解。
GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
.requestEmail()
.requestScopes(Drive.SCOPE_FILE)
// *HERE* is where I want to request Classroom SCOPES
.build();
// Build a GoogleApiClient with access to the Google Sign-In API,
// Google Dirve API, Google Classroom API, and options specified by gso.
mGoogleApiClient = new GoogleApiClient.Builder(this)
.enableAutoManage(this /* FragmentActivity */, this /* OnConnectionFailedListener */)
.addApi(Auth.GOOGLE_SIGN_IN_API, gso)
.addApi(Drive.API)
// *HERE* is where I want to add the API .addApi(Classroom.API)
.build();