updateRequestConfiguration static method
Updates Google Mobile Ads request configuration (COPPA, Families Policy, test devices, content rating).
Implementation
static Future<void> updateRequestConfiguration({
List<String>? testDeviceIds,
int? tagForChildDirectedTreatment,
int? tagForUnderAgeOfConsent,
String? maxAdContentRating,
}) async {
if (!AdConstants.isPlatformSupported) return;
// ignore: deprecated_member_use
final configuration = RequestConfiguration(
testDeviceIds: testDeviceIds,
// ignore: deprecated_member_use
tagForChildDirectedTreatment: tagForChildDirectedTreatment,
// ignore: deprecated_member_use
tagForUnderAgeOfConsent: tagForUnderAgeOfConsent,
maxAdContentRating: maxAdContentRating,
);
await MobileAds.instance.updateRequestConfiguration(configuration);
}