I have the mail app on both iPhone and Desktop. If I read the mail from desktop
then the badge count of iPhone mail app is automatically updated (decrement of badge count) while I don not open mail on iPhone
. It means my iPhone
mail app is not launched yet.
How does APNS
badge count work in these scenario?
Asked
Active
Viewed 240 times
0

Ved Rauniyar
- 1,539
- 14
- 21
-
When you read the mail from desktop,The app server get this action and send another APNS message which to change the badge – Dandelion Mar 29 '19 at 09:21
-
but my iOS app is in not running state / kill state. How does badge count got updated? – Ved Rauniyar Mar 29 '19 at 09:24
-
Check out this stack answer : https://stackoverflow.com/a/14256852/3278326 – Jarvis The Avenger Mar 29 '19 at 09:31
-
The server can send APNS which contains the "badge" to set iphone`s badge. It just like you received APNS add badge without launching App – Dandelion Mar 29 '19 at 09:31
-
Thanks @Dandelion – Ved Rauniyar Mar 29 '19 at 09:32
-
Thanks @JarvisTheAvenger – Ved Rauniyar Mar 29 '19 at 09:35
1 Answers
0
you need to pass badge counter in the payload. see the following code.
{"aps":
{"alert":"Notification Hub test notification2",
"badge":20,
"sound":"Default"}
}
See this post for more information: How to do badge increment on iOS push notification

AtulParmar
- 4,358
- 1
- 24
- 45