You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am new to adding Swift code for push notifications. I did the following and still have no badge count displaying when I send a push notification. I set the applicationIconBadgeNumber in the fetchCompletionHandler function.
Has anyone else had this issue and resolved it? Or is there something else that needs done for badge counts to work using the OneSignal push service?
The badge count is handled for you by OneSignal, no need to add your own code to set it. Just set or increase the badge count by the value you want on our dashboard or REST API.
Badge icons are only set when a push notification is received while the app is not in focus or closed.
Keep in mind that the badge count is only incremented when the app isn't open. So if the notification was received while the app was open, the badge count won't increase.
You should not need to do anything on the client side (iOS)
my badge count was 54. and i removed my app from background. when i got notification the sender send
[OneSignal postNotification:@{@"contents":@{@"en":text}, @"include_player_ids":oneSignalIds,@"content_available":@true,@"ios_badgeType":@"Increase",@"ios_badgeCount":@1}];
but when notification received it starts with 1. why it is not starting with 54?
let notificationReceivedBlock: OSHandleNotificationReceivedBlock = { notification in
is called when application is not in background? if not then which method is called when our application is not in background and we received notification.
Activity
jkasten2 commentedon Mar 15, 2016
The badge count is handled for you by OneSignal, no need to add your own code to set it. Just set or increase the badge count by the value you want on our dashboard or REST API.
Badge icons are only set when a push notification is received while the app is not in focus or closed.
Let us know if this isn't what you're seeing.
Thanks.
AngelaJune commentedon Mar 16, 2016
Thank you so much for the reply. This was my ignorance. I was thinking it was all set in the code.
Sruthin86 commentedon Nov 20, 2016
Is there a way to increment badge number when using OneSignal.postNotification ?
Pratik9909 commentedon Dec 13, 2017
Hi,
[OneSignal postNotification:@{@"contents":@{@"en":text}, @"include_player_ids":oneSignalIds,@"content_available":@true,@"ios_badgeType":@"Increase",@"ios_badgeCount":@1}];
I have set ios_badgeType and ios_badgeCount both during sending of Notification so do i need to set anything for receiver side?
when i got notification the application badge doesn't auto incremented.
Nightsd01 commentedon Dec 13, 2017
Keep in mind that the badge count is only incremented when the app isn't open. So if the notification was received while the app was open, the badge count won't increase.
You should not need to do anything on the client side (iOS)
Pratik9909 commentedon Dec 13, 2017
Hi Thanks for your reply,
my badge count was 54. and i removed my app from background. when i got notification the sender send
[OneSignal postNotification:@{@"contents":@{@"en":text}, @"include_player_ids":oneSignalIds,@"content_available":@true,@"ios_badgeType":@"Increase",@"ios_badgeCount":@1}];
but when notification received it starts with 1. why it is not starting with 54?
Pratik9909 commentedon Dec 13, 2017
My simple question is
let notificationReceivedBlock: OSHandleNotificationReceivedBlock = { notification in
is called when application is not in background? if not then which method is called when our application is not in background and we received notification.
Custom triggers (#19)
Merge 021100 into master (#528)