ionic-team / ionic-framework

A powerful cross-platform UI toolkit for building native-quality iOS, Android, and Progressive Web Apps with HTML, CSS, and JavaScript.
https://ionicframework.com
MIT License
51.01k stars 13.52k forks source link

Navigating to an external link from an ionic 4 app makes the hardware back button close the app where there is navigation history? #20199

Closed ahmedelatab closed 4 years ago

ahmedelatab commented 4 years ago

Navigate to an external link or display an interstitial Ad (AdMob) and then return to the app by clicking on the hardware back button. At this stage where there are pages in the history (navigation stack), clicking on the hardware back button will cause the app to close! Knowing that I had tried to register to the back button by:

this.platform.backbutton.subscribe(()=>{
this.navCtrl.pop();
// Also tried: this.navCtrl.back();
});

But it is still exiting the app!

Any idea about how to solve this?!

liamdebeasi commented 4 years ago

Thanks for the issue. I am going to close this as this is more of a support request. I would recommend checking to see if the AdMob plugin you are using allows for any control over the hardware back button in terms of returning you to the app after displaying an ad.

ionitron-bot[bot] commented 4 years ago

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.