0

I'm new using IONIC. I'm finding it difficult to set a function for the android's native back button.

I created a simple design in ionic, just to play with.

<div style="width: 100%; height: 100%;">
<iframe style=" width: 100%; height: 100%; "
src="http://exemplo.com">
</iframe>
</div>

I created an iframe to view my website, but when I click on the native back button of the android my app is terminated.

I would like to find a way to control the native back button so that it would return to the previous iframe page without finalizing the application completely.

If some power makes available a ready ionic project or some code that helps me in this matter I will be grateful.

1 Answers1

0

You should look into this cordova documentation:

https://cordova.apache.org/docs/en/4.0.0/cordova/events/events.backbutton.html

Also, check this question:

Ionic 2: How to handle the hardware back button which checks confirmation of Exit in app

and my answer:

https://stackoverflow.com/a/49159860/1383356

Ari
  • 7,251
  • 11
  • 40
  • 70