我有一个使用Rx Retrofit的项目结构.
我想用它来实现WebSocket通信,任何想法我怎么能做到这一点?
按照指南 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")
Run Code Online (Sandbox Code Playgroud)
然后
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();
Run Code Online (Sandbox Code Playgroud)
虽然我想像 youtube 一样实现登录...
您可以在其中选择要连接的频道。
我知道使用 webView 和 OAuth 2.0 我可以选择频道,但我想像 youtube 一样使用 Android sdk 进行身份验证...
感谢您的任何见解