$ionicPlatform.registerBackButtonAction(function(e) {
if ($state.current.name == "app.wifipsw") { // your check here
$state.go('tab.dash');
//navigator.app.exitApp();
} else {
navigator.app.exitApp();
}
}, 100);
when i click back button it go to tab.dash.but some time app exit.