I’m using ionic2 with corodva-plugin-fcm to connect on Firebase
I could handle my notifications correctly using this code
FCMPlugin.onNotification((d) => {
this.badge.increase(1); // not work (don't increase badge) if app in background
if (d.wasTapped) {
// Background recieval (Even if app is closed),
// bring up the message in UI
} else {
// Foreground recieval, update UI or what have you...
}
}, function (msg) {
// No problemo, registered callback
}, function (err) {
console.log("Arf, no good mate... " + err);
});
But i can’t increase number of badge, even i tapped on notification
What i want is increase number badge if app in background without clicking on notification
Algorithm example:
If (push notification arrived && app in background) {
increase badge
}