Created
August 14, 2014 22:33
-
-
Save koalahamlet/c865b6fbce2504907a49 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public ArrayList<String> getGooglePlusToken() { | |
ArrayList<String> accessTokens = new ArrayList<>(); | |
try { | |
String accountName = Plus.AccountApi.getAccountName(googleApiClient); | |
String scope = "audience:server:client_id:" + Constants.GOOGLE_PLUS_SERVER_CLIENT_ID; | |
accessTokens.add(GoogleAuthUtil.getToken(context, accountName, scope)); | |
Object[] scopes = { | |
Scopes.PLUS_LOGIN | |
}; | |
accessTokens.add( | |
GoogleAuthUtil.getToken(context, accountName, "oauth2:" + TextUtils.join(" ", scopes))); | |
} catch (Exception e) { | |
Log.d(TAG, "google plus token exception"); | |
} | |
return accessTokens; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment