Closed paolo2796 closed 5 years ago
@paolo2796 please make sure you correctly set up your App Group and that it shares the same name in both the App and Extension Service targets.
In essence, this issue is definitely an issue with the app group since it can not communicate with your main app to synchronize the badge count.
Please follow https://documentation.onesignal.com/docs/ios-sdk-app-groups-setup in detail.
The name of your app group should be group.{your_bundle_id}.onesignal. So for example, if your application's bundle identifier is com.test.app, your app group name should be group.com.test.app.onesignal.
Assign the group to both target.
- Open your Info.plist file and add a new OneSignal_app_groups_key as a String type.
- Enter the group name you checked in the last step as it's value.
- Make sure to do the same for the Info.plist under the OneSignalNotificationServiceExtension folder.
Description:
Push notifications and incrementing of the badge count all work perfectly. Unfortunately, while the badge is "cleared", when a new notification comes through, it resumes with the previous badge count rather than starting from 0.
Environment
Steps to Reproduce Issue: Attempt to receive a push notification Badge count bumps to 1. Open app, clearing the iOS badge Attempt to receive a push notification Badge count bumps to 2, but should be 1 again after having been "cleared"