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.

Ionic: Banner won't show up again, when app has been closed via hardware back button before

See original GitHub issue

Is this a bug report?

Yes.

Environment

 ~> npx admob-plus info --clipboard
npx: Installierte 94 in 12.036s

  AdMob Plus Environment Info:
    System:
      OS: macOS 10.14
      CPU: (4) x64 Intel(R) Core(TM) i5-4288U CPU @ 2.60GHz
      Memory: 213.30 MB / 16.00 GB
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 8.11.3 - /usr/local/bin/node
      Yarn: 1.6.0 - /usr/local/bin/yarn
      npm: 4.6.1 - ~/development/_own/admob-plus/examples/ionic-angular/node_modules/.bin/npm
    SDKs:
      iOS SDK:
        Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
      Android SDK:
        API Levels: 26, 27, 28
        Build Tools: 26.0.2, 27.0.3, 28.0.3
    IDEs:
      Android Studio: 3.1 AI-173.4720617
      Xcode: 10.1/10B61 - /usr/bin/xcodebuild
    Languages:
      Java: 1.8.0 - /usr/bin/javac
    npmPackages:
      cordova: ^8.1.2 => 8.1.2
      cordova-admob-plus: ^0.24.1 => 0.24.1
      cordova-android: 7.1.4 => 7.1.4
      cordova-browser: 5.0.4 => 5.0.4
      cordova-ios: 4.5.5 => 4.5.5
      cordova-plugin-device: ^2.0.2 => 2.0.2
      cordova-plugin-ionic-keyboard: ^2.1.3 => 2.1.3
      cordova-plugin-ionic-webview: ^1.2.1 => 1.2.1
      cordova-plugin-splashscreen: ^5.0.2 => 5.0.2
      cordova-plugin-statusbar: ^2.4.2 => 2.4.2
      cordova-plugin-whitelist: ^1.3.3 => 1.3.3
    npmGlobalPackages:
      cordova: 8.1.2
      ionic: 4.7.1

AndroidManifest.xml: looks ok

Steps to Reproduce

  1. Checkout your very own example ionic project (https://github.com/admob-plus/admob-plus/tree/master/examples/ionic-angular)
  2. Add Android platform: ionic cordova platform add android.
  3. Run app on real android device: ionic cordova run android --device
  4. Tap admob.banner.show() and verify that the banner is shown.
  5. Important: Close the app via the hardware back button of the device!
  6. Restart the sample app (don’t do a new install via ionic cordova command! just open the installed version via the app icon of the sample app).
  7. Tap admob.banner.show(). Nothing will happen. Banner will not show up anymore!

Expected Behavior

The banner should be shown again, regardless how I close the app before.

Actual Behavior

See “Steps to Reproduce”.

Reproducible Demo

https://github.com/admob-plus/admob-plus/tree/master/examples/ionic-angular

No single modification needed, you have everything you need. You just need a physical android device (didn’t test on simulator).

Best, Sven

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
dragonbane0commented, Feb 8, 2019

Can confirm this. Encountered it a few weeks ago and it is 100% consistent. Only happens if app is closed via back button or when you use platform.exitApp() via Ionic. In this soft closed state the banners won’t appear again if you boot the app again, no error is triggered at any point. I think the iFrame is just not correctly shown, but the logic works.

If you close the app completely it will work again. This never happens on iOS as it doesn’t have this soft closed state.

Probably an issue with plugin initialization during a soft boot vs. cold boot?

0reactions
kostisMcommented, Mar 5, 2019

Same problem

Read more comments on GitHub >

github_iconTop Results From Across the Web

Hardware Back Button for Capacitor & Cordova on Android ...
By default in Ionic, when the back button is pressed, the current view will be popped off the navigation stack, and the previous...
Read more >
Ionic 3+ solving the hardware back button, avoiding to close ...
Solving the hardware back button, avoiding to close or crash the app.
Read more >
bug: backdropDismiss: false prevents hardware back button ...
Create a regular ionic app. Navigate to a new a path (to add something to the stack). Add a loading to it that...
Read more >
Hardware back button doesn't the app on Android with Ionic 4
I have simple app with menu and this is my solution: 1) in app.components.ts i have hardware back button implemented to get back...
Read more >
Ionic/Angular: How to exit application on pressing ... - YouTube
The following tutorial explains how to override standard hardware back button behaviour by custom logic in three scenarios:1.
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