Closed shnizzedy closed 4 years ago
If we want to manage the badge count dynamically then the best way to achieve this functionality is the push notification so the badge directly comes up with the push notification and badge display dynamically.
Please check this link https://stackoverflow.com/a/5962607.
Managing this count is typical process with the local notification because for that we need to track those count locally and manage with every schedule notification and at the time of resetting those count we need to make copy of the already scheduled notifications and at the time of resetting the data we need to re-schedule the notification again.
Let me know if you want more explanation for the same.
From this morning's standup meeting, I understand that incrementing a badge number is difficult with local notifications. We will set this issue aside and tackle it later.
Just to be clear, this issue is about badges/indicators on the app icon, not about numbered indicators on the applets, correct?
A badge, as discussed in #306, is circled in this screenshot:
@Eden2016:
So what I’ve figured out about this issue is… that the badge count can be increased only from the server-sent notifications (ex. Firebase notif. service). And we can increase the badge number manually only when the app is open.
I think Object.keys(overdue).length
is the value we want in the badge:
Badge shows with notification and disappears after push notification is selected
A few things about this line:
https://github.com/ChildMindInstitute/mindlogger-app/blob/c9b26b5a01649c5f3c8e8b7bb32a11532d744ad9/app/services/pushNotifications.js#L39
1
rather than incrementing. I think we'd want the number of un-responded-to notifications, not just always1
, right?