重要事項:自
2024 年 5 月 1 日起,針對使用常用 SDK (包括 GoogleSignIn-iOS) 的 iOS 應用程式,Apple
規定隱私權資訊清單和簽名。請在 2024 年 5 月 1 日前升級至 GoogleSignIn-iOS 7.1.0 以上版本。按照
升級指南操作。
啟用強制執行 App Check
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
瞭解應用程式檢查對使用者的影響,並準備好繼續後,即可啟用應用程式檢查強制執行功能。
在 Google API Console中啟用強制執行功能
如要啟用強制執行功能,請完成下列步驟:
前往「憑證」頁面,編輯 iOS 用戶端。您會在頁面右側的「Google Identity for iOS」部分下方看到指標。
按一下「強制執行」按鈕,然後確認所選項目。強制執行後,系統會拒絕來自用戶端的所有未經驗證要求。
注意:啟用強制執行後,變更最多可能需要 15 分鐘才會生效。
在 Firebase 控制台中啟用強制執行功能
您可以對特定 iOS 用戶端或所有 iOS 用戶端強制執行 App Check
為所有 iOS 用戶端啟用強制執行功能
如要在 iOS 上強制執行 Google 登入,請完成下列步驟。
強制執行後,系統會拒絕所有未經驗證的要求,包括與未連結 Firebase 應用程式的 iOS OAuth 用戶端相關聯的要求。
開啟 Firebase 控制台的「App Check」部分。
展開「Google Identity for iOS」部分。
按一下「強制執行」,然後確認所選項目。
請注意,啟用強制執行後,最多可能需要 15 分鐘才會生效。
針對特定 iOS 用戶端啟用強制執行功能
您也可以為特定 iOS OAuth 用戶端設定 App Check 強制執行設定。如要這麼做,請按照下列步驟操作:
在 Firebase 控制台的 App Check 部分,開啟「OAuth 用戶端」。
展開要設定的 OAuth 用戶端指標檢視畫面。
如果用戶端尚未連結至應用程式,請連結。
按一下「建立強制執行覆寫」。
選擇是否要對這個 OAuth 用戶端強制執行 App Check。這項設定會覆寫專案的 Google Identity for iOS 全域強制執行設定。
請注意,啟用強制執行後,最多可能需要 15 分鐘才會生效。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-08-31 (世界標準時間)。
[null,null,["上次更新時間:2025-08-31 (世界標準時間)。"],[[["\u003cp\u003eApp Check enforcement can be enabled to ensure only verified requests are accepted, rejecting unverified ones.\u003c/p\u003e\n"],["\u003cp\u003eEnforcement can be enabled through the Google API Console or the Firebase Console, with options for specific or all iOS clients.\u003c/p\u003e\n"],["\u003cp\u003eEnabling enforcement involves navigating to the respective platform's console, locating the App Check or Google Identity for iOS settings, and clicking the 'Enforce' button.\u003c/p\u003e\n"],["\u003cp\u003eAfter enabling, it takes up to 15 minutes for the changes to take effect, impacting all subsequent requests.\u003c/p\u003e\n"],["\u003cp\u003eFirebase Console provides granular control, allowing enforcement overrides for individual iOS OAuth clients linked to your project.\u003c/p\u003e\n"]]],[],null,["When you [understand how App Check will affect your users](/identity/sign-in/ios/appcheck/monitor-metrics)\nand you're ready to proceed, you can enable App Check enforcement.\n\nEnable enforcement in the Google API Console\n\nTo enable enforcement, complete the following steps:\n\n1. Go to the edit view of your iOS client in the\n [Credentials page](https://console.cloud.google.com/apis/credentials). There, you will see metrics to the right of the page\n under the **Google Identity for iOS** section.\n\n2. Click the **ENFORCE** button and confirm your choice. Once enforcement is\n active, all unverified requests from your client will be rejected.\n\n**Note** : After you enable enforcement, it can take up to 15 minutes for the\nchanges to take effect.\n\nEnable enforcement in the Firebase Console\n\nApp Check can be enforced for specific iOS clients or for all your iOS clients\n\nEnable enforcement for all iOS clients\n\nTo enable enforcement for Google Sign-in on iOS, complete the following steps.\nOnce you enable enforcement, all unverified requests will be rejected, including\nrequests associated with iOS OAuth clients that aren't linked to a Firebase app.\n\n1. Open the [App Check](https://console.firebase.google.com/project/_/appcheck) section of the Firebase console.\n\n2. Expand the **Google Identity for iOS** section.\n\n3. Click **Enforce** and confirm your choice.\n\nNote that it can take up to 15 minutes after you enable enforcement for it to\ntake effect.\n\nEnable enforcement for specific iOS clients\n\nYou can also configure App Check enforcement for specific iOS OAuth clients. To\ndo so:\n\n1. Open [OAuth clients](https://console.firebase.google.com/project/_/appcheck/products/oauth) under the App Check section of\n the Firebase console.\n\n2. Expand the metrics view for the OAuth client you want to configure.\n\n3. If the client is not yet linked to an app, do so.\n\n4. Click **Create enforcement override**.\n\n5. Choose whether to enforce or unenforce App Check for this OAuth client. This\n setting overrides your project's global Google Identity for iOS enforcement\n setting.\n\nNote that it can take up to 15 minutes after you enable enforcement for it to\ntake effect."]]