flutter_native_admob icon indicating copy to clipboard operation
flutter_native_admob copied to clipboard

native ads not showing.

Open mingoogle opened this issue 5 years ago • 5 comments
trafficstars

When I run the example project, I see the ad. However, if I change the info.plist and _adUnitID values, the ad is not visible.

How to solve it?

mingoogle avatar Jul 30 '20 06:07 mingoogle

@mingoogle You can run on Android the emulator, check log you will find AdMob Error Codes then reference below page to find out what exactly what's wrong.

https://support.google.com/admob/thread/3494603?hl=en

phungrk avatar Jul 30 '20 13:07 phungrk

Hi there, I used to use admob_flutter package and I decide to switch this one since I found it has more options to control and customize the ads. Please note, while I was using admob_flutter package, I was able to see test ads on the emulator and test device, hence I believe all required configs are done properly. However, at the moment I switched to this package, I have got onAdFailedToLoad errorCode = 0 and looking at Google AdMob error codes, I see this quote:

This indicates that something happened internally; for instance, an invalid response was received from the ad server.

They also suggest switching to test ads. However, even if I use test banner id e.g. ca-app-pub-3940256099942544/6300978111 I still get the same errorCode = 0. This is how I call the ad:

...
Container(
                      height: 300,
                      child: NativeAdmob(
                        // Your ad unit id
                        adUnitID: 'ca-app-pub-3940256099942544/6300978111', // test ad id
                        loading: ProgressIndicatorWidget(),
                        type: NativeAdmobType.banner,
                        //controller: _nativeAdController,
                        //type: NativeAdmobType.full,
                      ),
                    ),
...

One thing I noted, however is - nowhere in the code is required to initialize the package with AdMob appId. Of course I have it set in AndroidManifest.xml, but shouldn't I have to initialize the AdMob module with this appId somehow?

angel1st avatar Jul 31 '20 08:07 angel1st

@angel1st You should use

adUnitID: 'ca-app-pub-3940256099942544/2247696110' //Native Advanced

or

adUnitID: 'ca-app-pub-3940256099942544/1044960115'  // Native Advanced Video

adUnitID: 'ca-app-pub-3940256099942544/6300978111' for Banner Ad not for Native Ad.

Ref:

  • Test Ads guide for Android https://developers.google.com/admob/android/test-ads

  • Test Ads guide for iOS https://developers.google.com/admob/ios/test-ads

phungrk avatar Jul 31 '20 09:07 phungrk

Thanks, @phungrk - native advanced id did the trick. It seems it was my initial issue, since once I moved to native ad type, all seems to be as it should be.

angel1st avatar Jul 31 '20 10:07 angel1st

hello. ( sorry english little )

Thank you so much for your reply.

I solved it. (The source has not been modified )

After a certain period of time since the app was released, Automatically exposed.

have a good day.

mingoogle avatar Aug 21 '20 07:08 mingoogle