繁体   English   中英

getToken google +登录Android GoogleAuthException:未知

[英]getToken google+ login Android GoogleAuthException: Unknown

这仅在我调用getToken(param,param,param,param)时发生。

我不确定自己在做什么错。 这是我的代码,导致并包括getToken:

Bundle bundle = new Bundle();
                    bundle.putString(GoogleAuthUtil.KEY_REQUEST_ACTIONS,
                             "http://schemas.google.com/AddActivity http://schemas.google.com/BuyActivity");
                    bundle.putString(GoogleAuthUtil.KEY_REQUEST_VISIBLE_ACTIVITIES, "http://schemas.google.com/AddActivity http://schemas.google.com/BuyActivity");

                    String clientId = "xxxxxxxxxxxxx.apps.googleusercontent.com";

                    if(MyApplication.PRODUCTION){
                        clientId = "xxxxxxxxxxxxx.apps.googleusercontent.com";
                    } else {
                        clientId = "xxxxxxxxxxxxx.apps.googleusercontent.com";
                    }

                    String scopes = "oauth2:server:client_id:" + clientId + ":api_scope:oauth2:https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email";
                    LogUtils.log("scopes string: " + scopes);
                    accessToken = GoogleAuthUtil.getToken(ctx, mPlusClient.getAccountName(), scopes, bundle);


                  LogUtils.log("access token: " + accessToken);

作为回报,我得到一个异常:

01-31 17:38:28.093: I/test(7124): GoogleAuthException: com.google.android.gms.auth.GoogleAuthException: Unknown

原来也是别人帐户上使用的ID。

现在可以使用。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM