@redfox05 wrote:
Strangely enough, when trying to catch the use of the back button on view changes, using $ionicPlatform.registerBackButtonAction with a priority of 100 or 101, did not work and did not trigger the back button code, but setting it to 102 (or anything above that) made it work. How is that? The code is very basic:
Within the angular .run() function:
$ionicPlatform.registerBackButtonAction(function() { log.info('Device Back button pressed'); if (true) { // your check here $ionicPopup.confirm({ title: 'System warning', template: 'are you sure you want to exit?' }).then(function(res) { if (res) { ionic.Platform.exitApp(); } }); } }, 102);
Posts: 2
Participants: 1