誰が私が間違っているのか教えてもらえますか? Google Plus からアクセス トークンを取得する必要があります。
これをメソッドに入れましたonConnected()
が、アクセストークンを取得していません。代わりにエラーが発生しています...
コード:
try {
String token = GoogleAuthUtil.getToken(this, mPlusClient.getAccountName() + "", "oauth2:" + Scopes.PLUS_PROFILE +
"https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email");
Log.d("AccessToken", token);
} catch (UserRecoverableAuthException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (GoogleAuthException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
エラー:
08-07 10:10:24.199: E/GoogleAuthUtil(17203): Calling this from your main thread can lead to deadlock and/or ANRs
ユーザーから Google Plus アクセス トークンを取得する正しい方法を誰か教えてもらえますか?