setMaxAdContentRating static method
Apps can set a maximum ad content rating for their ad requests using the setMaxAdContentRating method. AdMob ads returned when this is configured have a content rating at or below that level. The possible values for this network extra are based on digital content label classifications, and must be one of the following values: 0, 1, 2, 3
Max Rating | Digital Content Label | Google Play (Android) | App Store (iOS) |
---|---|---|---|
0 | G | 3+ | 4+ |
1 | PG | 7+ | 9+ |
2 | T | 12+ | 12+ |
3 | MA | 16+, 18+ | 17+ |
Basic usage:
MobileAds.setMaxAdContentRating(RATING_MA);
Implementation
static Future<void> setMaxAdContentRating(int maxRating) async {
assert(
[RATING_G, RATING_PG, RATING_T, RATING_MA].contains(maxRating),
'The provided int is not avaiable. Avaiable values: $RATING_G, $RATING_PG, $RATING_T, $RATING_MA',
);
await _pluginChannel.invokeMethod('setMaxAdContentRating', {
'maxRating': maxRating,
});
}