Ionic.platform.exitapp and background mode

$ionicPlatform.ready(function() {

if(window.cordova && window.cordova.plugins.Keyboard) {
if(window.StatusBar) {

title:  'Dj Robert',
text:   '-Live-'


// Disable BACK button on home
$ionicPlatform.registerBackButtonAction(function(event) {

if (Scopes.get('status')==2) {
  // your check here

else if (Scopes.get('status')==4||Scopes.get('status')==undefined) { // your check here
    title: 'System warning',
    template: 'are you sure you want to exit?'
  }).then(function(res) {
    if (res) {

}, 100);

This is my first post so sorry if it’s not formatted correctly.
The app close when i exit using the back button but enter background mode if i switch from it without unsing the back button

I have the same problem. I can’t find a way to put the application in background mode using the back button.

In case someone would be interested, here is a solution that works for me:

  1. Install this plugin:
    cordova plugin add

  2. Override the ionic exit: ($ionicPlatform, IONIC_BACK_PRIORITY) {
         $ionicPlatform.registerBackButtonAction(function (e) { 
             var backView = $ionicHistory.backView(); 
             if (backView) {
             } else {
                 navigator.Backbutton.goHome(function() {
                     console.log('app is in background (eventually push a local notif)');
                 }, function () {
                     console.log('fail to put app in bg');
         }, IONIC_BACK_PRIORITY.view);
1 Like

i did a work around but i’ll try this out and see what happens

I’ve just edited the previous example to still be able to use the back button if a back view is available in the history.