管理 Play 遊戲服務 API 用量
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
本主題將會說明如何偵測並管理遊戲內的 Play 遊戲服務 API 用量。
偵測頻率限制
如果您使用 Play 遊戲服務 SDK,則回呼處理常式和事件監聽器會在遊戲超出頻率限制時回傳錯誤。
在 Android 中,會回傳 PendingResult
物件的呼叫 (例如 incrementAchievementImmediate
) 會在結果物件中回傳 STATUS_NETWORK_ERROR_OPERATION_DEFERRED
狀態碼。這個狀態碼表示,當遊戲不再受到頻率限制,程式庫會自動嘗試再度進行呼叫。
如果想為遊戲申請額外配額,請參閱提高配額一節。
管理每日配額
您可以前往 Google Cloud Platform 檢視專案,即可瞭解應用程式的每日 Google Cloud Platform 配額。
如要查看或變更專案的用量限制,或是想申請更多配額,請進行以下步驟:
- 確認您的專案已設有帳單帳戶。如果沒有,請先建立一個。
- 開啟 API 控制台並前往 API 程式庫「已啟用的 API」頁面,從清單中選取 API。
- 如要查看及變更配額相關設定,請點選「配額」。如要查看用量統計資料,請點選「用量」。
您可以設定使用者每秒的呼叫數量上限,防止違規使用者用光應用程式配額。如果想進一步瞭解用量上限,請參閱 Google Cloud Platform 說明文件。
如果想為遊戲申請額外配額,請參閱提高配額一節。
申請提高配額
如果想申請提高遊戲配額,請到 Google Cloud Platform 找到應用程式的配額項目,然後按一下旁邊的「要求更多配額」連結。
一般來說,遊戲出現罕見的用量情形,同時已經遵循品質檢查清單中的最佳做法,我們才會受理提高遊戲配額的申請。
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間:2025-07-26 (世界標準時間)。
[null,null,["上次更新時間:2025-07-26 (世界標準時間)。"],[],[],null,["# Manage Play Games Services API usage\n\nThis topic describes how to detect and manage Play Games Services API usage in\nyour game.\n\nDetect rate limiting\n--------------------\n\nIf you are using the Play Games Services SDK, your callback handlers or listeners\nreturn errors when your game exceeds its rate limit.\n\nIn Android, calls that return\n[`PendingResult`](https://developer.android.com/reference/com/google/android/gms/common/api/PendingResult.html)\nobjects,\nsuch as\n[`incrementAchievementImmediate`](https://developer.android.com/reference/com/google/android/gms/games/achievement/Achievements.html#incrementImmediate(com.google.android.gms.common.api.GoogleApiClient,%20java.lang.String,%20int)),\nreturn a `STATUS_NETWORK_ERROR_OPERATION_DEFERRED` status code in the\nresult object. This status code indicates that the library will automatically\nattempt to make the call again later when your game is no longer rate limited.\n\nTo request additional quota for your games, see the\n[quota increase](#quota-increase) section.\n\nManage your daily quota\n-----------------------\n\nYou can review your application's daily quota for Google Cloud Platform by\nvisiting your project in the\n[Google Cloud Platform](https://console.developers.google.com/).\n\nTo view or change usage limits for your project, or to request an increase to\nyour quota, do the following:\n\n1. If you don't already have a [billing account](//cloud.google.com/billing/docs/how-to/manage-billing-account) for your project, then create one.\n2. [Visit the Enabled APIs page of the\n API library](https://console.cloud.google.com/apis/enabled) in the API Console, and select an API from the list.\n3. To view and change quota-related settings, select **Quotas** . To view usage statistics, select **Usage**.\n\nYou can set the maximum number of calls a user can make per second, to\nhelp ensure that an abusive player doesn't use up all of your application's\nquota. To learn more about capping usage, see the\nGoogle Cloud Platform\n[documentation](https://developers.google.com/console/help/capping-usage).\n\nTo request additional quota for your games, see the\n[quota increase](#quota-increase) section.\n\nRequest a quota increase\n------------------------\n\nTo request a game quota increase, click the *Request more* link next to\nyour app's quota entry in the\n[Google Cloud Platform](https://console.developers.google.com/).\n\nRequests to increase the games quota usually aren't accepted unless your game is\nexperiencing exceptional usage and is obeying the best practices in the\n[quality checklist](https://developers.google.com/games/services/bestpractices#9_quota_and_rate_limiting)."]]