Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49087

Dsiplay received notifications in status bar

$
0
0

@cnpallares wrote:

Hello everyone!

One question with im dealing rigth now. My code is:

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. I just already added the follow into 'onNotification':

if(!notification.app.asleep) {
//some code here
}

This is the only way i found to see my notification where app is in foreground mode.

There are anyway to receive the notification always in the status bar???

Thanks! :slight_smile:

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 49087

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>