I am working on a small mobile app in appery.io service. There are only two screens in the app. Initial is the login screen and after successful login is a screen for updating some details.
I am testing through Appery.io tester app. The issue that i am facing is with the device back button. Whenever i press the back button on device even after login it takes me back to login screen. I have the below code on "OnLoad" even o the screen that checks that if the user is logged in then redirect to next screen.
if(Apperyio.storage.UserSessionToken.get()){
Apperyio.navigateTo('ScanBarcode', {transition : 'slideup'});
}
I placed an alert before the condition but it is not triggered on back button click.
Also i read on appery.io forum that they use phonegap backbutton event. So i also tried to add the below code but its also of no use.
$(document).ready(function(){
document.addEventListener("deviceready", onDeviceReady, false);
});
function onDeviceReady(){
document.addEventListener("backbutton", onBackButton, false);
}
function onBackButton(){
var backExit = confirm("Do you want to exit");
if(backExit){
navigator.app.exitApp();
}
}
Is this issue because i am ruing through the tester app and would resolve if i install the .apk or is it my OS fault. I am testing on Sony Xperia P 4.1.2 android version. I havent tested on any other phone yet.
Please suggest if there is some possible solution or if i am missing something.
