OneSignal / OneSignal-Xamarin-SDK

OneSignal is a free push notification service for mobile apps. This plugin makes it easy to integrate your Xamarin app with OneSignal. https://onesignal.com
Other
105 stars 50 forks source link

Badge count don't reset after open App (iOS) #132

Closed paolo2796 closed 5 years ago

paolo2796 commented 5 years ago

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"

Nightsd01 commented 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.

Ankush-Redapple commented 5 years ago

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.

  1. Open your Info.plist file and add a new OneSignal_app_groups_key as a String type.
  2. Enter the group name you checked in the last step as it's value.
  3. Make sure to do the same for the Info.plist under the OneSignalNotificationServiceExtension folder.