Open alphanso opened 9 years ago
this would be great, rather than relying on window.location and hacking it.
just add below lines. It will work.
if(Meteor.isCordova)
{
Meteor.startup(function()
{
/back button does not exit app..
below function check and exit if back from home page
/
document.addEventListener("backbutton", function(e)
{
e.preventDefault();
if (document.location.pathname =="/") {
navigator.app.exitApp();
} else {
history.go(-1);
}
});
});
}
I am creating an android app using meteor + cordova, When user clicks back button on landing page it goes back to same page again which feels buggy. Is there any way to detect if we can't go back in history and ask user to exit the app.