Skip to content

[Bug]: Badge Counter not resetting properly #527

@gadzilka

Description

@gadzilka

What happened?

After the badge counter is reset to 0 and a new push notification received with +1 on the badge, the old value is restored. Many of our customers report this issue to us from different apps.

Steps to reproduce?

1. Launch the app - bagde: 0
2. Receive a new push notification with +1 - bagde: 1
3. Receive a new push notification with +1 - badge: 2
4. Open the app - badge: 0
5. Receive a new push notification with +1 - badge: 3

What did you expect to happen?

Unfortunately, there are not many places in your code that can be debbuged. I tried to get more information from your Notification Extension.

In Step 5 before calling OneSignal.didReceiveNotificationExtensionRequest:
onesignalBadgeCount is 0 (this is the value from UserDefault associated with the app group)
bestAttemptContent.badge is 3 (the content of UNNotificationRequest)
after calling OneSignal.didReceiveNotificationExtensionRequest
onesignalBadgeCount is 3 (the badge counter also has the same value)

This means that your server send the wrong number for the badge counter. I can assume that something wrong happened in the app when you reset the badge counter and send the information to your server.

Unity version

Unity 2020.3.36f1

OneSignal Unity SDK version

3.0.3

Platform

iOS

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions