Skip to content

[Bug]: background notification badge count not increasing #1523

Description

@bbjay

What happened?

When sending an iOS background notification with "ios_badgeType": "Increase", it behaves the same as "ios_badgeType": "SetTo"

I use the following API call:

curl --request POST \
     --url https://onesignal.com/api/v1/notifications \
     --header 'Authorization: Basic YOUR_REST_API_KEY' \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '
{
  "app_id": "app id",
  "include_player_ids": [
    "Subscribed device id"
  ],
  "content_available": true,
  "ios_badgeType": "Increase",
  "ios_badgeCount": 5
}
'

When sending a normal foreground notification (with content), "ios_badgeType": "Increase" is behaving as expected.

Steps to reproduce?

1. Send a background notification with the above API call and "ios_badgeCount": 5
2. Notice badge count on app icon to show "5"
3. Send background notification again, but with "ios_badgeCount": 1
4. Notice badge count on app icon to show "1"

What did you expect to happen?

Badge count on app icon should show "6"

OneSignal iOS SDK version

3.12.10, 5.2.8

iOS version

17

Specific iOS version

17.4

Relevant log output

No response

Code of Conduct

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

edit: updated affected SDK versions

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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