Android Google Play 遊戲服務 (Android Google Play Games Services)


問題描述

Android Google Play 遊戲服務 (Android Google Play Games Services)

正在嘗試將 google play 遊戲排行榜集成到 android 應用程序中。

Google API 客戶端連接成功。我得到的結果代碼為 ‑1,這不過是 RESULT_OK。

但是當我在我的活動結果中使用排行榜意圖調用 google 排行榜 api 時,我得到 10001,它代表不一致的狀態,即 RESULT_RECONNECT_REQUIRED。即使在調用意圖之前我正在檢查谷歌 api 客戶端是否已連接。每次都返回 true。

無法理解可能導致此問題的原因。


參考解法

方法 1:

hope this may help you in solving your problem:

https://code.tutsplus.com/tutorials/google‑play‑game‑services‑leaderboards‑‑cms‑20700

方法 2:

These links will help u in, Overview : https://code.tutsplus.com/tutorials/google‑play‑game‑services‑achievements‑‑cms‑20591. Integration :https://code.tutsplus.com/tutorials/integrating‑google‑play‑services‑on‑android‑‑cms‑19828. If you are not satisfied refer this link,https://coronalabs.com/blog/2013/06/25/tutorial‑introducing‑google‑play‑game‑services/

方法 3:

According to the documentation, RESULT_RECONNECT_REQUIRED is sent back to the calling Activity when a reconnect is required.

The GoogleApiClient is in an inconsistent state and must reconnect to the service to resolve the issue. Further calls to the service using the current connection are unlikely to succeed.

To handle it call googleApiClient.reconnect() and onConnected() will be called when the client is connected again.

方法 4:

The reason you might get that code is because app is not linked. So on play games developer console linked my application and it started to work.

(by Pritam KadamVarma460Ashwin ElangovanClayton WilkinsonPritam Kadam)

參考文件

  1. Android Google Play Games Services (CC BY‑SA 2.5/3.0/4.0)

#android-googleapiclient #google-play-games #Android #google-play






相關問題

Scope 在 GoogleApiClient 中的作用是什麼? (What does Scope do in GoogleApiClient?)

Android studio - 將 GCM api 更新為 Google 服務 (Android studio - updating GCM api to Google services)

Android:為沒有 Google Play 服務的用戶登錄 Google? (Android: Google signin for a user without Google Play Services?)

GoogleApiClient onConnected 未被調用,在服務中使用 (GoogleApiClient onConnected not being called, using in a Service)

從 Play 商店安裝應用程序後嘗試使用 Google 登錄時出現“使用 Google 進行身份驗證時出錯:未知”異常。閱讀詳情 (Getting 'Error authenticating with Google: unknown' exception when trying to signin with google after installing app from play store. See details)

Android google Sign In 總是顯示 handleSignInResult:false (Android google Sign In always shows handleSignInResult:false)

Android Google Play 遊戲服務 (Android Google Play Games Services)

android - 即使沒有可用的互聯網,也會調用 onLocationChanged (android - onLocationChanged is called even when there is not internet available)







留言討論