fluttergoogle-mobile-ads

Where to put test device IDs in google_mobile_ads package?


I was using firebase_admob package where I could add the test devices IDs with:

var targetingInfo = MobileAdTargetingInfo(
  testDevices: <String> [...]
);

But with google_mobile_ads I couldn't find anything similar to that. So, where can I put the test device IDs? Am I only left with using the test Ad unit?


Solution

  • Use updateRequestConfiguration callback on the MobileAds instance, and provide test device IDs.

    MobileAds.instance
      ..initialize()
      ..updateRequestConfiguration(RequestConfiguration(
        testDeviceIds: <String>[],
      ));