updateRequestConfiguration static method

Future<void> updateRequestConfiguration({
  1. List<String>? testDeviceIds,
  2. int? tagForChildDirectedTreatment,
  3. int? tagForUnderAgeOfConsent,
  4. String? maxAdContentRating,
})

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);
}