-
Notifications
You must be signed in to change notification settings - Fork 26.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Could not hide ad immediately after displaying ad on flutter #21474
Comments
How to hide ads if we navigate to another page before the ad is loaded????? @zoechi @ganessaa @MistryHiral |
bump |
Is there any solution to this problem yet? |
Same, I can't hide banner from the screen. |
any idea about how to hide / remove banner immediately ? |
I was fighting with this problem same like you but the solution for this to hide Ad should be like this:
|
The behaviour of ad plugin is different in release and debug mode. i fixed it with delay 0.5 sec
|
This issue has been moved to firebase/flutterfire#669. Any further collaboration will be done there. |
Since |
workaround could be: using "this.mounted" property of state class before showing the add
That helped me dispose the ad when navigating away from a context |
I managed to solve it by creating a boolean that sets to true when I call my function hideBanner(), and checking if it's true when the banner event is loaded. Look at my code:
|
I have spent many hours debugging this dispose problem. And found a perfect solution: Don't use the firebase_admob plugin! Use the admob_flutter plugin instead. Very easy to use and works like a dream. |
jacaTM's answer hides the ad for me correctly (finally!), but I'm occasionally getting this error:
Has anyone figured out how to resolve this? Not sure where I'm going wrong. |
@srsudar I fixed this error by adding a line like this in the |
Closing, as |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
We have created the following class to display AdMob on flutter.
The following values are correctly defined in the Const class.
adAppId
,adUnitId
,testDevices
,keywords
init()
is called immediately after startup.showBanner()
will be called when showing the ad.hideBanner()
will be called when hiding the ad.These will work as expected in most cases.
But after
_bannerAd.show()
is called, the ad will not be hidden ifhideBanner()
is called before the listener receivesMobileAdEvent.loaded
.[OK]
_bannerAd.show()
-> receiveMobileAdEvent.loaded
->hideBanner()
flutter: @@@ load @@@
flutter: @@@ show @@@
flutter: @@@ MobileAdEvent.loaded @@@
flutter: @@@ dispose @@@
flutter: @@@ null @@@
[NG]
_bannerAd.show()
->hideBanner()
-> (receiveMobileAdEvent.loaded
)flutter: @@@ load @@@
flutter: @@@ show @@@
flutter: @@@ dispose @@@
flutter: @@@ null @@@
This trouble occurred in ASUS Z017DA. iPad mini, iPhone 6 Plus and iPhone 4S were hidden normally at any timing. We can not test all models, but it may be a problem only for Android.
How can we avoid this if we do?
The text was updated successfully, but these errors were encountered: