Quantcast
Channel: Ionic Forum - Latest posts
Viewing all articles
Browse latest Browse all 228595

PushPlugin notificationReceived Called Multiple Times when Push Notification Received in Background

$
0
0

If the Ionic iOS app is in the background and you receive a push notification for the first time, the $cordovaPush:notificationReceived' event fires once when you click the notification and open the app. If you receive another push notification in the background and click on the notification, the notificationReceived event fires twice. If a third push received ... fires 3 times and on and on. This does not happen if you receive push notifications in the foreground unless you have already received push notifications in the background. Receiving a push notification in the foreground does not add to the firing count like a background push does.

This is the code that gets executed multiple times depending on the number of push notifications received in the background.

$rootScope.$on('$cordovaPush:notificationReceived', function(event, notification) {
$log.debug(notification.alert, "Push Notification Received");
}

Any suggestions appreciated.


Viewing all articles
Browse latest Browse all 228595

Trending Articles