Skip to content

Commit 4a43b15

Browse files
authored
feat: add documentation to clear iOS notification badge count (#1774)
1 parent 4654dfb commit 4a43b15

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

docusaurus/docs/reactnative/guides/push_notifications_v2.mdx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,20 @@ client.updateAppSettings({
501501
});
502502
```
503503
504+
A good practice is to remove the badge count once the app is opened. We can do that using notifee like below:
505+
506+
```js
507+
function App() {
508+
useEffect(() => {
509+
const clearBadge = async () => {
510+
await notifee.setBadgeCount(0);
511+
};
512+
clearBadge();
513+
}, []);
514+
// Rest of your application
515+
}
516+
```
517+
504518
### Make iOS Payload Data Only
505519
506520
If the iOS payload is made to be data only, then `setBackgroundMessageHandler` can be used to display notifications using Notifee. The payload can be customized using the JavaScript SDK like below:

0 commit comments

Comments
 (0)