Auto-reload when application is background mode

#1

Hi everyone !

I have a question about the background mode in Android & iOS.

When my app is in background, I want it to reload (like if I kill him) if it’s in background mode since more than 30 minutes.

I saw applications like Facebook, Twitter that show splashscreen when there are not displaying since a few time.

Do you know how to manage it on Ionic ? I don’t see function with $ionicPlatform.

Thank you in advance.

#2

You can use onresume function of IonicPlatform.

app.run(function($ionicPlatform) {
    $ionicPlatform.on('resume', function() {
    $rootScope.$broadcast('onResume');
    //Refresh Scope and Views
});

$ionicPlatform.on('pause', function() {
$rootScope.$broadcast('onPause');
  });
  })
1 Like
#3

It works !

Thank you