// Set a sample device ID of 2077ef9a63d2b398840261c8221a0c9bfirebase::gma::RequestConfigurationrequest_configuration=firebase::gma::GetRequestConfiguration();request_configuration.test_device_ids.push_back("2077ef9a63d2b398840261c8221a0c9b");firebase::gma::SetRequestConfiguration(request_configuration);
重新執行應用程式。如果廣告是 Google 廣告,您會在廣告 (橫幅、插頁或獎勵廣告) 頂端中央看到「測試模式」標籤:
[null,null,["上次更新時間:2025-02-25 (世界標準時間)。"],[[["The Google Mobile Ads C++ SDK is deprecated and will be end-of-maintenance on June 17, 2025; consider using the iOS or Android SDKs instead."],["During development, utilize test ads by using Google's demo ad units or enabling test mode to prevent invalid activity flags on your account."],["Replace demo ad unit IDs with your own before publishing and remember that Android and iOS simulators are automatically configured as test devices."],["When enabling test mode programmatically, ensure to remove the test device ID code before releasing your app."],["Mediated ads do not display a \"Test mode\" label; consult each network's mediation guide to ensure test mode is enabled and avoid clicking ads from networks without a confirmed test mode during development."]]],["The Google Mobile Ads C++ SDK is deprecated as of June 17, 2024, with maintenance ending June 17, 2025; AdMob's iOS and Android SDKs are recommended replacements. To test ads, use Google's demo ad units or enable test mode with your own. Demo units prevent invalid traffic, while test mode lets you configure your device, either in the AdMob UI or programmatically via the SDK, and use your own ad unit IDs. If using mediated ads, ensure each network is in test mode.\n"]]