AI-generated Key Takeaways
-
Native Validator helps catch policy violations in custom rendered ads before the app is shipped.
-
Native Validator appears only on test ads and is enabled by default.
-
You can disable Native Validator by calling
setNativeValidatorDisabled()
during SDK initialization. -
Using Native Validator requires Google Mobile Ads SDK (beta) 0.11.0-alpha01 or higher and configuring your device as a test device.
Native Validator is a new feature to help you catch policy violations before your app ships. It automatically identifies certain policy violations in your app and notifies you through the app's UI.
Native Validator is enabled by default for test ads, but can be disabled as shown below. Keep in mind however that once the validator is disabled, test ads will no longer show information about potential issues with your ad layouts.
Prerequisites
- Google Mobile Ads SDK (beta) 0.11.0-alpha01 or higher.
- Ensure your device is configured as a test device.
Using Native Validator
Native Validator automatically alerts you of certain policy violations in your UI through an overlay popup next to the ad.
Clicking on See Issues takes you to a fullscreen list of the relevant policy violations.
Disabling the validator
To disable Native Validator, call setNativeValidatorDisabled()
when
initializing Google Mobile Ads SDK (beta):
Kotlin
MobileAds.initialize(
this@MainActivity,
// Sample Ad Manager app ID: ca-app-pub-3940256099942544~3347511713
InitializationConfig.Builder("SAMPLE_APP_ID")
.setNativeValidatorDisabled()
.build()
) {
// Adapter initialization is complete.
}
Java
MobileAds.initialize(
this,
// Sample Ad Manager app ID: ca-app-pub-3940256099942544~3347511713
new InitializationConfig.Builder("SAMPLE_APP_ID")
.setNativeValidatorDisabled()
.build(),
initializationStatus -> {
// Adapter initialization is complete.
});