@tushar4ic wrote:
I am trying to exit from the app on soft-back-button press from home screen. Following code inside app.js does not work -
angular.module('starter', ['ionic', 'MyController'] ) .run(function($ionicPlatform, $ionicHistory, $ionicPopup) { $ionicPlatform.ready(function() { $ionicPlatform.registerBackButtonAction(function(event) { var currentState = $ionicHistory.currentStateName(); if (currentState == 'tab.business' || currentState == 'tab.personal') { console.log('About to exit the app'); ionic.Platform.exitApp(); navigator.app.exitApp(); // none works } else { $ionicHistory.goBack(); } }, 101); });
Please help
Posts: 4
Participants: 2