Google +1 button error on android app there was a

2019-02-04 17:22发布

I added google plus one button in my app by this guide https://developers.google.com/+/mobile/android/recommend

When I press button I see google plus window and after that window receive my google plus account name I receive error with message "There was a temporary problem with your +1. Please try again"

In the android monitor, I get

10-14 19:05:42.466 2107-2470/com.google.android.gms.persistent W/GLSUser: [DeviceKeyStore] Cannot load key: Device key file not found.
10-14 19:05:42.872 2421-3058/com.google.android.gms E/Volley: [162] BasicNetwork.performRequest: Unexpected response code 503 for https://www.googleapis.com/pos/v1/plusones/https%3A%2F%2Fplay.google.com%2Fstore%2Fapps%2Fdetails%3Fid%3Dcom.facebook.katana?abtk=&cdx=c89&container=http%3A%2F%2FD1Xfy1LMHWn3O%252FW%252BIyo6pO5l5Yo%253D.apps.googleusercontent.com%2F%3Fpkg%3Dcom.bestvpn.hotvpn%26api_key%3DAIzaSyBa9bgzwtnGchlkux96-c5Q_fi19fE1pEA&source=native%3Aandroid_app

answer from link in logcat

{
 "kind": "pos#plusones",
 "id": "https://play.google.com/store/apps/details?id=com.facebook.katana",
 "isSetByViewer": false,
 "metadata": {
  "type": "URL",
  "globalCounts": {
   "count": 0.0
  }
 },
 "abtk": ""
}

I turned on google plus API in the developer console four hours ago.

Can someone help me, please? Maybe I forget to check API anywhere. Checked in the google-services.json Maybe it's because I'm testing it from emulator. Can't test in real device now

2条回答
聊天终结者
2楼-- · 2019-02-04 17:50

Please use this code below :

mPlusOneButton.setOnPlusOneClickListener(new OnPlusOneClickListener() {

    @Override
    public void onPlusOneClick(Intent intent) {
        if(!plusClient.isConnected()) {
            plusClient.connect();
        } else {
            startActivityForResult(intent, 0);
        }
    }

}

and also see this activity in android-sdk for reference :

androidsdk/extras/google/google_play_services/samples/plus/src/com/google/android/gms/samples/plus/PlusOneActivity.java
查看更多
我欲成王,谁敢阻挡
3楼-- · 2019-02-04 18:07

I've reported the problem on the Google Issue tracker and they have closed it as won't fix stating that it's deprecated

https://issuetracker.google.com/issues/73993857

查看更多
登录 后发表回答