-
Notifications
You must be signed in to change notification settings - Fork 264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: background notification badge count not increasing #1523
Comments
Same here, nothing seems to work. {
"app_id": "APP-ID",
"target_channel": "push",
"headings": {"en": "English Title"},
"contents": {"en": "English Message"},
"include_aliases": {
"external_id": [
"ID"
]
},
"ios_badgeType": "SetTo",
"ios_badgeCount": "5"
} |
@filecc your issue seems to be with foreground notifications (as you include a "contents" key in your request). This issue is specifically about background notifications. |
I did some further digging and found that the latest SDK v5.2.8 has this issue too. When testing with the new SDK, I also used the new API: curl --request POST \
--url 'https://api.onesignal.com/notifications' \
--header 'Authorization: Basic YOUR_REST_API_KEY' \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '
{
"app_id": "YOUR_APP_ID",
"target_channel": "push",
"include_subscription_ids": [
"SUBSCRIPTION_ID_1",
],
"content_available": true,
"ios_badgeType": "Increase",
"ios_badgeCount": 1
}
' wich leads to the same issue. When checking the contents of the background notification with the OneSignalExample app,
i noticed that the I would expect the |
Hi @bbjay thanks for reporting. We will take a look into this issue. |
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:
When sending a normal foreground notification (with content),
"ios_badgeType": "Increase"
is behaving as expected.Steps to reproduce?
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
Relevant log output
No response
Code of Conduct
edit: updated affected SDK versions
The text was updated successfully, but these errors were encountered: