Open timstoute opened 3 years ago
it looks like Firebase Cloud Messaging supports setting badge values, and that looks like the best way to achieve both notifications and badges when the app is not running or not in the foreground:https://firebase.google.com/docs/cloud-messaging/http-server-ref#notification-payload-support
I'm trying to set the badge count for the user when the app is running in the background. But it's not working.
I'm using Firestore, and save the user-specific number of new messages the user has as a field on the Firestore user document. This is an Ionic Cordova app.
The following code works when the app is in the foreground, but not when the app is running in the background on the IOS device.
In app.component.ts I have code like:
` if ((this.platform.is('ios')) || (this.platform.is('android'))) { this.appBadge.requestPermission() .then(async result => {
...` What am I missing?