Android的OAuth授权页面停留在白色加载页面上
创始人
2024-10-07 08:01:18
0
  1. 确保正确添加了以下依赖项:
implementation 'com.google.android.gms:play-services-auth:19.0.0'
implementation 'com.google.android.gms:play-services-auth-api-phone:17.4.0'
  1. 确保正确配置AndroidManifest.xml文件



    
        

        
    
   

  

  

  

  1. 确保正确调用代码

在onCreate()方法中添加以下代码:

GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
        .requestIdToken(getString(R.string.default_web_client_id))
        .requestEmail()
        .build();

GoogleSignInClient mGoogleSignInClient = GoogleSignIn.getClient(this, gso);

mGoogleSignInClient.silentSignIn()
        .addOnCompleteListener(this, new OnCompleteListener() {
            @Override
            public void onComplete(@NonNull Task task) {
                if (task.isSuccessful()) {
                    // Sign in success, update UI with the signed-in user's information
                    Log.d(TAG, "signInWithCredential:success");
                    GoogleSignInAccount account = task.getResult();
                } else {
                    // If sign in fails, display a message to the user.
                    Log.w(TAG, "signInWithCredential:failure", task.getException());
                }
            }
        });

以上方法可以解决Android OAuth授权页面停留在白色加载页面上的问题。

相关内容

热门资讯

透视app!拱趴大菠萝万能挂(... 透视app!拱趴大菠萝万能挂(透视)一贯有挂(详细辅助实用技巧);1、金币登录送、破产送、升级送、活...
最新研发!hhpoker真的有... 1、最新研发!hhpoker真的有透视吗,hhpoker免费辅助器,必备教程(有挂攻略)。2、hhp...
透视数据!hhpoker作弊码... 透视数据!hhpoker作弊码怎么用(透视)一直是真的有挂(详细辅助解密教程)1、很好的工具软件,可...
免费测试版!wepoker私局... 免费测试版!wepoker私局代打,安装不了wepoker,科技教程(有挂攻略);致您一封信;亲爱w...
透视透视!wepoker分析(... 透视透视!wepoker分析(透视)竟然真的有挂(详细辅助靠谱教程);暗藏猫腻,小编详细说明原来是有...
推荐一款!xpoker辅助控制... 推荐一款!xpoker辅助控制,wepoker免费透视脚本,必胜教程(有挂方法);亲真的是有正版授权...
透视有挂!wepoker怎么下... 透视有挂!wepoker怎么下载游戏(透视)切实有挂(详细辅助实用技巧)是一种具有地方特色的麻将游戏...
今日百科!hhpoker软件靠... 今日百科!hhpoker软件靠谱吗,pokemmo辅助器手机版下载,科技教程(有挂神器);科技安装教...
透视了解!wepoker辅助器... 透视了解!wepoker辅助器免费(透视)原来真的是有挂(详细辅助科技教程);1、玩家可以在软件透明...
推荐十款!wepoker辅助器... 推荐十款!wepoker辅助器下载,wepoker透视器免费,揭秘教程(有挂攻略);玩家必备必赢加哟...