Siddhika Chhelavda
Siddhika Chhelavda

Reputation: 31

Does ionic push notification work even if the app is closed or minimized?

I am new to ionic framework and trying to learn it.I wanted to know whether ionic push notification work even if the app (android or ios) is closed or minimized . Please provide this information with respect to both development and production versions of ionic push notification. Thanks in advance.

Upvotes: 1

Views: 1321

Answers (1)

Milad Faridnia
Milad Faridnia

Reputation: 9477

According to this:

All you need to do to get your app receiving notifications is add the following snippet somewhere. To ensure that it's always registered, we're going to put in inside the $ionicPlatform.ready() section within app.js file. This will create an instance of the push service and register your app for notifications each time it is opened.

.run(function($ionicPlatform) {
$ionicPlatform.ready(function() {
Ionic.io(); 

var push = new Ionic.Push({
  "debug": true
});

push.register(function(token) {
  console.log("Device token:",token.token);
});
});
})

Upvotes: 2

Related Questions