googleads / googleads-mobile-flutter

A Flutter plugin for the Google Mobile Ads SDK
Apache License 2.0
340 stars 284 forks source link

🐛 the Future of ad.load() does not return isLoaded #143

Closed kohry closed 3 years ago

kohry commented 3 years ago

Bug report

Describe the bug the return value of ad.load() is Future, but it does not do anything.

Steps to reproduce

Steps to reproduce the behavior:

ad.load().whenComplete((){ ad.show() })

and you will see 99% of Ads will not be properly loaded before showing

Expected behavior

It should be return false if Ad failed to load the ad, and true if ad is loaded

bounty1342 commented 3 years ago

Actually that's quite normal : image

You should do something like (as per ex https://codelabs.developers.google.com/codelabs/admob-inline-ads-in-flutter#6):

onAdLoaded: (_) {
        setState(() {
          _isAdLoaded = true;
        });
      },

Regards

bparrishMines commented 3 years ago

As @bounty1342 stated, this is working as intended. Ad.show should only be called after AdListener.onAdLoaded is called as explained here https://pub.dev/packages/google_mobile_ads#display-an-interstitial-ad