#include"firebase/app_check.h"voidInitializeFirebase(){// Configure the Debug Provider factory with your debug token.firebase::app_check::DebugAppCheckProviderFactory::GetInstance()->SetDebugToken("INSERT YOUR DEBUG TOKEN HERE");// Set App Check to use the debug provider factoryfirebase::app_check::AppCheck::SetAppCheckProviderFactory(firebase::app_check::DebugAppCheckProviderFactory::GetInstance());// Proceed to initialize Firebase as normal}
[null,null,["最后更新时间 (UTC):2025-08-23。"],[],[],null,["After you have registered your app for App Check, your app normally won't run\non desktop platforms, in an emulator, or from a continuous integration (CI)\nenvironment, since those environments don't qualify as valid devices. If you\nwant to run your app in such an environment during development and testing, you\ncan create a debug build of your app that uses the App Check debug provider\ninstead of a real attestation provider.\n| **Warning:** The debug provider allows access to your Firebase resources from unverified devices. Don't use the debug provider in production builds of your app, and don't share your debug builds with untrusted parties.\n\nConfiguration via code\n\nTo use the debug provider while running your app\n(during development, for example), do the following:\n\n1. In the [**App Check**](//console.firebase.google.com/project/_/appcheck) section\n of the Firebase console, choose **Manage debug tokens** from your app's\n overflow menu. Then, create a new debug token. You'll need the token in the\n next step.\n\n Because this token allows access to your Firebase resources without\n a valid device, it is crucial that you keep it private. Don't commit it to a\n public repository, and if a registered token is ever compromised, revoke it\n immediately in the Firebase console.\n\n2. In your initialization code, do the following:\n\n #include \"firebase/app_check.h\"\n\n void InitializeFirebase() {\n // Configure the Debug Provider factory with your debug token.\n firebase::app_check::DebugAppCheckProviderFactory::GetInstance()\n -\u003eSetDebugToken(\"INSERT YOUR DEBUG TOKEN HERE\");\n\n // Set App Check to use the debug provider factory\n firebase::app_check::AppCheck::SetAppCheckProviderFactory(\n firebase::app_check::DebugAppCheckProviderFactory::GetInstance());\n\n // Proceed to initialize Firebase as normal\n }\n\nOther configuration options\n\nOther configuration options are available based on platform, for example using\nthe platforms environment variables. For more\ninformation, refer to the [iOS+](/docs/app-check/ios/debug-provider) or\n[Android](/docs/app-check/android/debug-provider) debug provider documentation.\n\nBecause this token allows access to your Firebase resources without a\nvalid device, it is crucial that you keep it private. Don't commit it to a\npublic repository, and if a registered token is ever compromised, revoke it\nimmediately in the Firebase console."]]