Skip to content Skip to sidebar Skip to footer

Use Requestconfiguration.builder().settestdeviceids(arrays.aslist("289.......e6") To Get Test Ads On This Device

Use RequestConfiguration.Builder().setTestDeviceIds(Arrays.asList('289.......E6') to get test ads on this device. I was getting this statement in the logcat terminal. When implemen

Solution 1:

Solution

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

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

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

How to get TestDeviceIDs

If you want to test ads in your app as you're developing.

  • Load your ads-integrated app and make an ad request.
  • Check the logcat output for a message that looks like the one below, which shows you your device ID and how to add it as a test device:

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

  • Add the device ID that your logcat gave you in the terminal, and use it as testDeviceId

Post a Comment for "Use Requestconfiguration.builder().settestdeviceids(arrays.aslist("289.......e6") To Get Test Ads On This Device"