按照https://developers.google.com/identity/sign-in/android/sign-in指南操作无法指定YouTube登录渠道。
我请求了以下权限:
new Scope("email"),
new Scope("https://www.googleapis.com/auth/youtube.readonly"),
new Scope("https://www.googleapis.com/auth/yt-analytics.readonly")
那么
GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
.requestScopes(new Scope(Scopes.EMAIL), scopes)
.requestServerAuthCode(activity.getString(R.string.google_token_id), true)
.build();
googleApiClient = new GoogleApiClient.Builder(activity)
.enableAutoManage(activity, this)
.addApi(Auth.GOOGLE_SIGN_IN_API, gso)
.addConnectionCallbacks(this)
.build();
我希望能像YouTube一样实现登录功能,用户可以选择要连接的频道。
我知道可以使用webView和OAuth 2.0来选择频道,但我想使用Android SDK进行身份验证,就像YouTube一样...
感谢任何建议。