I am following a tutorial of adding a Banner Ad. But for me it gives this error.
The getter 'testAdUnitID' isn't defined for the type 'BannerAd'.
Is testAdUnitID
is deprecated or something? What's the way out?
My code is:
void _initBannerAd() {
_bannerAd = BannerAd(
size: AdSize.banner,
adUnitId: BannerAd.testAdUnitID,
listener: BannerAdListener(),
request: AdRequest(),
);
}
Here is the screenshot:
Which tutorial did you watch?
found update log here.
https://pub.dev/packages/google_mobile_ads/changelog
you can get some test id for adUnitId from here.
https://developers.google.com/admob/android/test-ads
and flutter sample here.