iOS how do I get accurate badge count when sending push via Business Logic
L
Lodijones
started a topic
over 5 years ago
I am just trying to make sense of the badge count being sent to iOS with Business Logic. I can set the number but it will not be accurate as I am not sure how to track unread notifications.
Best Answer
P
Pranav J
said
over 4 years ago
Lodijones,
You might want to store a “read” flag in your collection that stores notifications, also send the notification id and any other metadata in iOSExtras when calling sendPayload from BL and then when the user reads a notification set this read flag to true. Whenever you are calculating the badge count - only count the notifications which are not read for the user.
Thanks, Pranav Kinvey Support
1 Comment
P
Pranav J
said
over 4 years ago
Answer
Lodijones,
You might want to store a “read” flag in your collection that stores notifications, also send the notification id and any other metadata in iOSExtras when calling sendPayload from BL and then when the user reads a notification set this read flag to true. Whenever you are calculating the badge count - only count the notifications which are not read for the user.
Lodijones
I am just trying to make sense of the badge count being sent to iOS with Business Logic. I can set the number but it will not be accurate as I am not sure how to track unread notifications.
You might want to store a “read” flag in your collection that stores notifications, also send the notification id and any other metadata in iOSExtras when calling sendPayload from BL and then when the user reads a notification set this read flag to true. Whenever you are calculating the badge count - only count the notifications which are not read for the user.
Thanks,
Pranav
Kinvey Support
Pranav J
You might want to store a “read” flag in your collection that stores notifications, also send the notification id and any other metadata in iOSExtras when calling sendPayload from BL and then when the user reads a notification set this read flag to true. Whenever you are calculating the badge count - only count the notifications which are not read for the user.
Thanks,
Pranav
Kinvey Support
-
Why do I get "Undefined symbols" errors when building with KinveyKit?
-
How do I register push tokens?
-
When using social login, to perform a log-out, do I need to log out of the social network, Kinvey, o
-
How can I assign additional properties to users?
-
Does KinveyKit support 64-bit ARM devices, such as iPhone 5s?
-
Authorization Token Invalid or Expired
-
BOOL and how it is stored in the database.
-
Offline saving throwing errors
-
Custom endpoint not able to form request object
-
Security through business logic
See all 437 topics