You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Badge counter keeps incrementing across notifications despite OneSignal.Notifications.clearAll() being called on every app foreground #1657
When using the Increase badge model (badge_inc: 1 in each push payload), the iOS icon badge keeps accumulating across notifications even though OneSignal.Notifications.clearAll() is called on every relevant trigger (app foreground, notification tap).
The next push after a reset is supposed to arrive with badgeNumber: 1, but instead arrives with badgeNumber: N+1, where N is whatever the counter was before reset.
Based on PR #1649, clearBadgeCount:fromClearAll: should explicitly zero ONESIGNAL_BADGE_KEY. That fix is present in 5.4.2+, but the bug still manifests end-to-end.
Steps to reproduce?
1- Fresh install, log in, call OneSignal.login(userId).
2- Send notification from dashboard with badge type Increase +1.
3- Icon shows 1 ✓
4- Foreground the app (or tap the notification). JS calls:
OneSignal.Notifications.clearAll()
Background the app (no user-initiated notification interaction needed).
5- Send notification, with the same Increase +1 payload.
6- Icon shows 2 ❌ — expected 1.
What did you expect to happen?
Per PR #1649's fix and the documented behavior of clearAll(): after OneSignal.Notifications.clearAll() is called, the next Increase +1 push should result in aps.badge: 1, not aps.badge: N+1.
On iOS, "Increase" badges are tracked on-device by your Notification Service Extension (NSE), not on the server. The NSE keeps a running badge count in a shared App Group, and clearAll() resets that count back to zero. We confirmed clearAll() is correctly wired from React Native to the native SDK.
The key requirement: the running count is only shared correctly if your main app and your OneSignalNotificationServiceExtension use the same App Group. The behavior you're seeing, increments work (1 → 2 → 3) but clearAll() never resets back to 1, is a sign that the two targets aren't sharing the same App Group, so the NSE keeps counting up while clearAll() resets a separate, unused count.
Could you verify:
The App Group capability is enabled on both the app target and the OneSignalNotificationServiceExtension target, with the identical identifier (e.g. group.<your_bundle_id>.onesignal), and included in both provisioning profiles.
If you set the OneSignal App Group key in Info.plist, that it's present and identical in both targets' Info.plist.
Activity
nan-li commentedon Jun 23, 2026
Hi @anastely thanks for the report,
On iOS, "Increase" badges are tracked on-device by your Notification Service Extension (NSE), not on the server. The NSE keeps a running badge count in a shared App Group, and
clearAll()resets that count back to zero. We confirmedclearAll()is correctly wired from React Native to the native SDK.The key requirement: the running count is only shared correctly if your main app and your OneSignalNotificationServiceExtension use the same App Group. The behavior you're seeing, increments work (1 → 2 → 3) but
clearAll()never resets back to 1, is a sign that the two targets aren't sharing the same App Group, so the NSE keeps counting up whileclearAll()resets a separate, unused count.Could you verify:
OneSignalNotificationServiceExtensiontarget, with the identical identifier (e.g.group.<your_bundle_id>.onesignal), and included in both provisioning profiles.Info.plist, that it's present and identical in both targets'Info.plist.Setup steps for both targets are here: https://documentation.onesignal.com/docs/en/react-native-sdk-setup (see the iOS App Group steps).
For a step-by-step checklist to confirm the App Group is shared on both targets, see https://documentation.onesignal.com/docs/en/confirmed-delivery#ios
If you can share both
.entitlementsfiles and confirm the NSE is installed, we can pinpoint it quickly.