0

Use RequestConfiguration.Builder().setTestDeviceIds(Arrays.asList("185.......E7") to get test ads on this device.

This app use firebase_admob package for implementing Google AdMob in the app. I was getting the above statement in the logcat terminal when using the Test Ads provided in https://developers.google.com/admob/android/test-ads#enable_test_devices in my Flutter App.

If I use RequestConfiguration.Builder().setTestDeviceIds... it gives

Undefined name 'RequestConfiguration'.

rozerro
  • 5,787
  • 9
  • 46
  • 94

1 Answers1

0

Solution

The way to solve it is to update RequestConfiguration with the testDeviceIds

String version;
  List<String> testDeviceIds = ['289C....E6'];

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  timeDilation = 1;
  PackageInfo packageInfo = await PackageInfo.fromPlatform();
  version = packageInfo.version;
  MobileAds.instance.initialize();

  // thing to add
  RequestConfiguration configuration =
       RequestConfiguration(testDeviceIds: testDeviceIds);
  MobileAds.instance.updateRequestConfiguration(configuration);


  await Firebase.initializeApp();
  runApp(MyApp());
}

details in the link

Omor Faruqe
  • 39
  • 13