Hello,
These days i’ve been working on the hardware back button behaviour in my app, and i’ve found something strange in one specific situation.
According to these forums, I’ve seen that the priorities to the back button events are the following:
// PLATFORM_BACK_BUTTON_PRIORITY_VIEW = 100;
// PLATFORM_BACK_BUTTON_PRIORITY_SIDE_MENU = 150;
// PLATFORM_BACK_BUTTON_PRIORITY_ACTION_SHEET = 300;
// PLATFORM_BACK_BUTTON_PRIORITY_POPUP = 400;
// PLATFORM_BACK_BUTTON_PRIORITY_LOADING = 500;
I’ve also read that when the app can’t go back in history, the app is closed.
That is usually working right, but i’ve noticed that if I also initialize a modal in my controller using the following code, the event 100 is fired when the app can go backwards in history, but never exits the app. Also, the console doesn’t say anything.
$ionicModal.fromTemplateUrl('modal.html', function(modal) {
$scope.modal = modal;
}, {
animation: 'no-animation',
focusFirstInput: true
});
Removing the modal solves the issue, but I found that this might be worth commenting.