Android hardware back button closes app after banner ad display
See original GitHub issueDescribe the bug When I opened a new page and after that called banner.show() screen makes a lightning effect. After that banner ad shown. When I clicked header back button and I can go back without any problem. When I clicked hardware back button, app closed.
To Reproduce Steps to reproduce the behavior:
- Go to a new page
- this.banner = new admob.BannerAd({ adUnitId: 123, size: 0 });
- await this.banner.show();
- Click hardware back button.
- App closed.
Expected behavior Go back to the previous page.
Screenshots If applicable, add screenshots to help explain your problem.
Environment
AdMob Plus Environment Info:
npmPackages:
admob-plus-cordova: ^1.7.0 => 1.8.2
cordova-android: ^9.0.0 => 9.1.0
cordova-ios: ^6.0.1 => 6.2.0
typescript: ~2.6.2 => 2.6.2
npmGlobalPackages:
cordova: 10.0.0
Cordova:
Version: 10.0.0
Plugins:
cordova-plugin-device: ^2.0.3
cordova-plugin-app-version: ^0.1.9
cordova-plugin-statusbar: ^2.4.3
cordova-plugin-splashscreen: ^5.0.3
admob-plus-cordova: ^1.7.0
Ionic:
Version: 6.12.3```
Issue Analytics
- State:
- Created 2 years ago
- Comments:13 (7 by maintainers)
Top Results From Across the Web
After click AdMob ads, I cannot return to my Android app by ...
The ad is displayed on my phone. However, it does not return to my app when I touch "Back" button. Instead, it returns...
Read more >Provide custom back navigation - Android Developers
Back navigation is how users move backward through the history of screens they previously visited. All Android devices provide a Back button ......
Read more >WebView and Android back button navigation - LogRocket Blog
Let's explore some solutions to common problems that Android developers often encounter when using WebView, such as back button navigation.
Read more >Is it allowed to use Admob's interstitial ads when Back Button ...
AFAIK You can show interstitial ad when going back from other activities within your app, You should not show ad on main activity...
Read more >Interstitial ads | Android - Google Developers
They're typically displayed at natural transition points in the flow of an app, such as between activities or during the pause between levels...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@ratson
More information.
After the bannerads view added and shown (it take focus), then hardware buttons event will not fire. If user touch/tap/interact at app webview a few times, the app takes the focus back and the buttons works correctly.
@zeezonez @markenapps Thanks for confirming that.