Closed drahmedgabr closed 2 years ago
Hi @drahmedgabr, Thanks for filing the issue. Does this happen 100% of the time. I suspect this to be a network issue where the ad preview fails to load?
Can you share the logs of flutter run -v
when this issue occurs?
`> Hi @drahmedgabr, Thanks for filing the issue. Does this happen 100% of the time. I suspect this to be a network issue where the ad preview fails to load? Can you share the logs of
flutter run -v` when this issue occurs?
Hello,
Yes it happens 100% times ..
this https://github.com/drahmedgabr/test_ads_project test project I wrote now to test this issue
1- Run App .. (it will dispaly banner + play audio in background) 2- close app (audio still working) 3- reopen app from notification 4- Banner disappeared
``> Hi @drahmedgabr, Thanks for filing the issue. Does this happen 100% of the time. I suspect this to be a network issue where the ad preview fails to load? Can you share the logs of flutter run -v when this issue occurs?
Hello,
Yes it happens 100% times ..
this Simple Test Project I wrote now to test this issue
Steps to Reproduce 1- Run App .. (it will dispaly banner + play audio in background) 2- close app (audio still working) 3- reopen app from notification 4- Banner disappeared & you can click on its place it will trigger adclick action and open web page
Hi @drahmedgabr, thanks for the reproducible sample project. I am able to reproduce the issue. Probably this is happening because when the app is launched from the notification in background (terminated state) It is invoked on a separate isolate (not on main isolate)
Labeling this issue for further insights from the team. Reproducible sample project can be found in above comment.
I'm unable to reproduce this issue seems in the flutter master channel. This is probably fixed already.
I confirmed that this issue is already fixed.
Face the same error on v4.0.0 but only on certain devices (e.g. samsung galaxy s22 ultra). The way to reproduce didn't change.
here is my code (not a minimal example). https://pastebin.com/4JUbVCAm
Video:
The same error keeps reproducing in v5.1.0 (Samsung Galaxy s23) Does not replicate in emulator.
One way I found to solve this is to listen to the AppLifecycleListener and refresh the state again so that the banner is rebuilt:
void _onStateChanged(AppLifecycleState state) async {
if (state == AppLifecycleState.resumed && _isAdBannerLoadedNotifier.value) {
WidgetsBinding.instance.addPostFrameCallback((_) {
_isAdBannerLoadedNotifier.value = true; // setState(() {});
});
_isAdBannerLoadedNotifier.value = false; // setState(() {});
}
}
Just test and it was fixed in 3.22.0-0.3.pre Ref: https://stackoverflow.com/a/78106710/9108773
Plugin Version
1.2.0
Steps to Reproduce
1- Run App (simple app run audio streams foreground & background) 2- Admob Banner shows normally 3- Play audio 4- Exit app 5- resume app by click push notification to come to last opened activity 6- Admob banner disappears leaving its place occupied and when click on its place redirects me to google ads page ( same behaviour as ad clicked )
Expected results:
when resume activity admob banner rebuild or keep showing
Actual results:
Admob banner disappears leaving its place occupied and when click on its place redirects me to google ads page ( same behaviour as ad clicked )
https://user-images.githubusercontent.com/25434640/162642744-65036d9c-c128-42d2-9656-09d1096ac553.mp4