I am working on icon badges using APNS. It looks like I can send down the the badge count in the notification, but in order to send down the right badge count and reset it, I need to keep track of each users notification counts on the backend. I am just confirming this is correct. I have seen it asked before, but wanted to make sure before I implement. I am using Tags in Azure Notification Hubs, which allows me to send notifications to groups of users, but in order to track badge counts (how many "things" have I not seen) I still need at least a record for each user (could be a record for each notification to each user which is more granular, but at least each user).
I suppose you only need a record for every user who has opted into that specific notification type (accounting for >1 types of notifications). I guess I need to send notifications on a user by user basis and check a table which keeps a record of the badge count for each user + notification type (example: inbox item and alert) and increment whatever is in there with an update and select the value to include in the json "badge" value. Is that how others are doing it?
{
"aps":
{
"alert":"Test notification",
"alert type":"inbox",
"badge":9
}
}
I guess I thought this might be a client side thing or built into notifications somehow. Is this how others are doing it? It's hard for me to imagine all chat, news, etc. apps do it this way. I do want an overall icon badge count which is an aggregate of the badge counts for 2 tabItems in the TabView.