重要提示:自
2024 年 5 月 1 日起,对于使用常用 SDK(包括 GoogleSignIn-iOS)的 iOS 应用,Apple
要求提供隐私权清单和签名。请在 2024 年 5 月 1 日之前升级到 GoogleSignIn-iOS v7.1.0 及更高版本。按照
我们的升级指南操作。
启用 App Check 强制执行
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
在了解 App Check 对用户有何影响并为后续操作做好准备之后,您便可以启用 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 分钟才能生效。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-31。
[null,null,["最后更新时间 (UTC):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."]]