question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Android hardware back button closes app after banner ad display

See original GitHub issue

Describe 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:

  1. Go to a new page
  2. this.banner = new admob.BannerAd({ adUnitId: 123, size: 0 });
  3. await this.banner.show();
  4. Click hardware back button.
  5. 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:closed
  • Created 2 years ago
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
zeezonezcommented, May 10, 2021

@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.

0reactions
ratsoncommented, May 12, 2021

@zeezonez @markenapps Thanks for confirming that.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found