1
我下載了最新版本的GooglePlayServices
,幷包含在我的應用程序中。我生成了我的調試密鑰的SHA1指紋,並將它們設置爲Google API Console
。我只有一個應用程序。爲什麼Google+集成不適用於我的Android應用程序?
我使用谷歌加這樣的:
googlePlusClient = new PlusClient.Builder(getActivity(), new GooglePlayServicesClient.ConnectionCallbacks() {
@Override
public void onConnected(Bundle bundle) {
googlePlusClient.loadPeople(new PlusClient.OnPeopleLoadedListener() {
@Override
public void onPeopleLoaded(ConnectionResult connectionResult, PersonBuffer persons, String s) {
if(connectionResult.isSuccess()) {
ArrayList<String> result = new ArrayList<String>();
for(Person person : persons) {
result.add(person.getId());
}
// Some actions with the data
}
}
}, "me");
}
@Override
public void onDisconnected() {
}
}, new GooglePlayServicesClient.OnConnectionFailedListener() {
@Override
public void onConnectionFailed(ConnectionResult connectionResult) {
if(connectionResult.hasResolution()) {
try {
connectionResult.startResolutionForResult(getActivity(), REQUEST_GOOGLE_AUTH);
} catch (IntentSender.SendIntentException e) {
e.printStackTrace();
}
}
}
}).setScopes(Scopes.PLUS_PROFILE).build();
googlePlusClient.connect();
這:
public void onActivityResult(int requestCode, int resultCode, Intent data) {
if(googlePlusClient != null && requestCode == REQUEST_GOOGLE_AUTH && resultCode == Activity.RESULT_OK) {
googlePlusClient.connect();
}
}
我仍然得到403錯誤。這裏的LogCat這個:
E/Volley﹕ [907] ot.a: Unexpected response code 403 for https://www.googleapis.com/plus/v1/people/me
D/GooglePlusPlatform﹕ Unexpected response code (403) when requesting: getPerson
I/GooglePlusPlatform﹕ {"code":403,"errors":[{"message":"Access Not Configured","domain":"usageLimits","reason":"accessNotConfigured"}]}
我做錯了什麼?