Closed ghost closed 3 years ago
Unfortunately, there's no way to change the badge count automatically when a trigger notification is displayed. iOS gives you the option to change the badge count with the notification payload but it's not possible to dynamically increase/decrease it.
Can we reopen this as a doc fix? The example here is not working given that EventType.DELIVERED
is not triggered when the app is running in background or killed.
@mars-lan good spot. Will update
Example updated https://notifee.app/react-native/docs/ios/badges#integration
@helenaford was the new doc published? I didn't seem to spot any difference in https://notifee.app/react-native/docs/ios/badges#integration.
@mars-lan here's the diff https://github.com/notifee/documentation/commit/668881e68dc2a001bb1474416f12b63860ed2e61.
I swapped out the example that used trigger notifications with an example of when a remote notification is delivered in the background, you may want to adjust the badge count, and then when the user interacts with the notification, decrease it again.
The original example as you pointed out to us was not feasible. The new example I used, I think, is a pretty common scenario. But, open to suggestions 😅
Got it. I think you should also add a note saying that this will only work if the app is running (in either fg or bg). In other words notifee.onBackgroundEvent
won't get called if it's a cold launch. Or did I misunderstand it?
Hi
In the documentation we see that the delivered event is not fired for triggered notifications. How can we increase the badge count for triggered notifications?
Thank you!