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

Ionic Push "onNotification" only triggered when opening the app

$
0
0

@jose_martos_twago wrote:

Given this piece of code:

var push = new Ionic.Push({
  "debug": true,
  "onNotification": function(notification) {
    var payload = notification.payload;
    console.log(notification, payload);
  },
  "onRegister": function(data) {
    console.log(data.token);
  }
});

As the title suggests, I was testing the function onNotification for a new push message received. The idea was to do something, like increasing the number in the icon badge (cordova-plugin-badge), but then I noticed this function was only triggered when opening the app after clicking on the new received push message (when it is on the foreground).

I guess this is the way to go, but I am just writing to know if there is a different possibility to handle this when the app is on the background.

Thank you very much in advance.

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 49164

Trending Articles



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