监控 App Check 请求指标
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
将 App Check SDK 添加到应用后,您应在启用 App Check 强制执行之前,先确保这样做不会干扰现有的合法用户。
您可以使用 App Check 请求指标屏幕这一重要工具,来决定是否为 Data Connect、Firebase AI Logic、Realtime Database、Cloud Firestore、Cloud Storage、Authentication、Google Identity for iOS、Maps JavaScript API 和 Places API(新版)启用 App Check 强制执行。
如需查看产品的 App Check 请求指标,请打开 Firebase 控制台的 App Check 部分。例如:

每个产品的请求指标分为四个类别:
已验证请求是具有有效 App Check 令牌的请求。启用 App Check 强制执行后,只有此类别的请求会成功。
过时的客户端请求是缺少 App Check 令牌的请求。这些请求可能来自应用中未包含 App Check 的旧版 Firebase SDK。
未知来源请求是缺少 App Check 令牌并且看起来不像来自 Firebase SDK 的请求。这些请求可能是使用被盗 API 密钥发出的请求,或者是在未使用 Firebase SDK 的情况下发出的伪造请求。
无效请求是具有无效 App Check 令牌的请求,这些请求可能来自企图冒充您的应用的虚假客户端,也可能来自模拟环境。
这些类别的分布情况可以帮助您决定何时为您的应用启用强制执行。下面列出了一些指南:
如果几乎所有近期请求都来自经过验证的客户端,请考虑启用强制执行,开始保护后端资源。
如果近期请求中有很大一部分来自可能已过时的客户端,为避免干扰用户,请考虑等待更多用户更新应用之后,再启用强制执行。如果对已发布的应用强制执行 App Check,未与 App Check SDK 集成的先前的应用版本将无法使用。
如果您的应用尚未发布,您应立即启用 App Check 强制执行,因为用户还没有使用任何过时的客户端。
后续步骤
在了解 App Check 对用户有何影响并为后续操作做好准备之后,您便可以针对 Data Connect、Firebase AI Logic、Realtime Database、Cloud Firestore、Cloud Storage、Authentication、Google Identity for iOS、Maps JavaScript API 和 Places API(新版)启用 App Check 强制执行。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-17。
[null,null,["最后更新时间 (UTC):2025-08-17。"],[],[],null,["After you add the App Check SDK to your app, but before you enable\nApp Check enforcement, you should make sure that doing so won't disrupt your\nexisting legitimate users.\n\nAn important tool you can use to make this decision for\nFirebase AI Logic, Data Connect, Realtime Database, Cloud Firestore, Cloud Storage, Authentication, Google Identity for iOS, Maps JavaScript API, and Places API (New) is the App Check request metrics screen.\n\nTo view the App Check request metrics for a product, open the\n[**App Check**](//console.firebase.google.com/project/_/appcheck) section of the\nFirebase console. For example:\n\nThe request metrics for each product are broken down into four categories:\n\n- **Verified** requests are those that have a valid App Check token. After\n you enable App Check enforcement, only requests in this category will\n succeed.\n\n- **Outdated client** requests are those that are missing an App Check\n token. These requests might be from an older version of the Firebase SDK\n before App Check was included in the app.\n\n- **Unknown origin** requests are those that are missing an App Check token,\n and don't look like they come from the Firebase SDK. These might be from\n requests made with stolen API keys or forged requests made without the\n Firebase SDK.\n\n- **Invalid** requests are those that have an invalid\n App Check token, which might be from an inauthentic client attempting to\n impersonate your app, or from emulated environments.\n\nThe distribution of these categories for your app should inform when you decide\nto enable enforcement. Here are some guidelines:\n\n- If almost all of the recent requests are from verified clients, consider\n enabling enforcement to start protecting your backend resources.\n\n- If a significant portion of the recent requests are from likely-outdated\n clients, to avoid disrupting users, consider waiting for more users to update\n your app before enabling enforcement. Enforcing App Check on a released\n app will break prior app versions that are not integrated with the\n App Check SDK.\n\n- If your app hasn't launched yet, you should enable App Check enforcement\n immediately, since there aren't any outdated clients in use.\n\nNext steps\n\nWhen you understand how App Check will affect your users and you're ready to\nproceed, you can [enable App Check enforcement](/docs/app-check/enable-enforcement)\nfor Firebase AI Logic, Data Connect, Realtime Database, Cloud Firestore, Cloud Storage, Authentication, Google Identity for iOS, Maps JavaScript API, and Places API (New)."]]