簡體   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