Hello everyone!
This is what im doing:
var push = $ionicPush.init({
“debug”: false,
“onNotification”: function(notification) {
//open notification action
$cordovaInAppBrowser.open(notification.payload.url, “_blank”,options);
},
“onRegister”: function(data) {
console.log(data.token);
}
});
With this im receiving my notification in my notification bar (top of screen of my device) only when my app is in background mode.
And this is what i added into ‘onNotification’:
if(!notification.app.asleep) {
//some code here
}
This is the only way i found to see my notification when app is in foreground.
There are anyway to receive the notification always in the status bar???
Thanks!