-
-
Notifications
You must be signed in to change notification settings - Fork 654
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Badge count on iOS app icon #438
Comments
@timabbott While searching for this i found this stackoverflow link - http://stackoverflow.com/questions/17565307/how-to-display-count-of-notifications-in-app-launcher-icon |
There seem to be a number of apps that do this on Android without requiring the user to install a widget; it's probably worth doing a bit more research into options for doing this. |
@divs4debu Note the date of the question on StackOverflow. Things move fast on mobile and 4 years is definitely an eternity. I actually have not seen an app on stock Android doing the badges (while it is a standard feature on iOS). Maybe it is very dependent on what launcher the user has?!? In any way, there are prerequisites to be implemented before this is even possible. We need to add mechanism for the app to pull messages while not running. |
@borisyankov the mechanism for app to pull messages while not running could be -
@timabbott can you mention some apps that does that i would like to do specific research on app that does that. |
facebook app is a good example. |
@vishwesh3 what is Facebook an example for? Not sure I follow. @divs4debu ideally the solution will be both for Android and iOS. Related issue: |
|
@vishwesh3 i just downloaded the facebook app but it doesnt show any badge and i have 11 notification 2 messages on facebook . This might be due to some mobile provide this function and some not . |
@borisyankov Using headless.js would help only if app is not focus but wont help when app is closed . We can wait for 0.44 update. it might have some component for that |
ok. This might depend on phone UI or launcher. |
Looks like Android O (API 26) adds notification badge support natively - https://developer.android.com/reference/android/app/NotificationChannel.html#setShowBadge |
Hello @zulip/server-notifications members, this issue was labeled with the "area: notifications" label, so you may want to check it out! |
For cross-reference: the server-side issue for this is zulip/zulip#7459 . |
my app doesn't providing any notifications but even though it is showing some notification count badge on app icon. please help me out |
Is this issue still open? I'd like to look at it. |
@AmitJoki yeah, no one is currently working on that. |
@borisyankov I believe this is actually in progress, and mostly complete; see zulip/zulip#7459. |
I haven't looked at the code in zulip/zulip#7459 to see what it currently does, but I was thinking that Zulip might actually want to display something other than raw unread counts. On iOS, the badge for the Messages shows the number of unread messages across all conversations, while the badge for the Facebook Messenger app shows the number of conversations that have unread messages in them. At first I found the FB Messenger app behavior weird, but I've now come to believe that it feels less overwhelming to have a lower badge count. I think Zulip should do something similar to FB Messenger and aggregate unread messages for the badge count [*]. I suspect the correct grouping for the counts are: each distinct PM conversation (individual and group), muted stream/topic pairs with @-mentions (assuming Zulip alerts on those to begin with), and each stream/topic pair with unread messages (or possibly only each stream with unread messages).
|
These are good points. We should be conservative with the 'unread counts' and badges in general. People love heir 'Inbox zero' and if a user does not have anything urgently needing their attention, we should probably not be showing any badge. It is worth noting that the badges on Android did not even exist prior to Android 8, and were kinda 'emulated' by the launchers to be something like 'unread notifications' which may or may not be equal to the unread count we would be showing. There is some short reading here: |
To summarize my thoughts:
|
(See also zulip/zulip#10271 .) |
(I just closed #676 as covered by this issue; it has a link to https://developer.android.com/preview/features/notification-badges.html.) |
Bumping the priority.
|
Update: The implementation of this feature lives on the server side. We have a draft implementation, but it remains disabled because of a bug; see chat discussion. We had another report of this missing feature today in chat. |
I've edited this issue to be specifically about iOS, because the implementation will be pretty much separate for iOS and Android. On Android, badge counts don't even exist on stock Android, at least in versions from the last few years. There are badge dots, but with no numbers -- it's just there or not -- and I believe it's controlled automatically by whether a notification exists. Badge counts do exist in some vendors' Android launchers, notably Samsung. We have some code in the app (and have for a long time now) that is supposed to maintain these, using a third-party library with this purpose. I don't actually know for sure whether that code, for those proprietary vendors' launchers, works -- the APIs unfortunately seem to be vendor-specific, so the implementation of that library in turn goes and does something for each of a long list of different vendors, as applicable: Samsung, Huawei, Sony, Vivo, Asus, … 14 of them in total. That in turn makes it infeasible to test. If for someone it's not working, a separate bug report would be appropriate. |
#4163 is merged! |
So the issue is back in this status:
That bug is #4182. The bug isn't live now, because the feature is disabled (we have the server just always send 0 for the badge count.) But I expect that if we were to just re-enable the current implementation, that bug would reappear with it, so that we'll need to do some debugging. |
If it'd be useful to re-enable the feature on chat.zulip.org only (for example), that's certainly something we can do. |
We've had another request for this in chat, and one more back in November: |
We've had another request on CZO. |
Can confirm that this bug lives on... There is still no unread count on the ios icon |
Recent (experimental) convert from Slack here...would also really love this feature to work! |
This seems so basic to all iOS apps that I’m a bit surprised by the lack if progress in 5!! years. |
Currently evaluating Zulip. Absence of decent support for iOS is a show stopper for every company. |
Could be easy to contribute, why don't you give it a try. |
I wish I was an iOS developer to contribute this, the only thing I can say is: such a missing feature :( |
Most requested feature in zulip, on my mind. Unread counter works perfect on MacOS, but does not work at all on iOS. |
Posting this patch here to enable the iOS badge notifications that our team likes to see, even though there is a pending bug on the iOS side that clears the badge when the app is opened/foregrounded, but the server does still set the badge count properly on the next push notification. diff --git a/push_notifications.py b/home/zulip/deployments/current/zerver/lib/push_notifications.py
index 7023639..9c08d8f 100644
--- a/push_notifications.py
+++ b/home/zulip/deployments/current/zerver/lib/push_notifications.py
@@ -1042,10 +1042,14 @@ def get_apns_alert_subtitle(
def get_apns_badge_count(
user_profile: UserProfile, read_messages_ids: Optional[Sequence[int]] = []
) -> int:
- # NOTE: We have temporarily set get_apns_badge_count to always
- # return 0 until we can debug a likely mobile app side issue with
- # handling notifications while the app is open.
- return 0
+ # The iOS mobile app does not keep a correct badge count after the app is opened,
+ # but will show the correct value when the push notfication is received. Issue
+ # number https://github.com/zulip/zulip-mobile/issues/438
+ return (
+ UserMessage.objects.filter(user_profile=user_profile)
+ .extra(where=[UserMessage.where_unread()])
+ .count()
+ )
def get_apns_badge_count_future( |
Thanks @jefferypalmer for posting that patch. One refinement you might like (which I expect we'd do when we eventually return to this issue) would be to add As an update for everyone interested in this issue: this app is now in maintenance mode as we're focused on building the new Zulip mobile app in Flutter, and so this is an issue I don't expect us to go back and fix for the legacy app. But once that migration is done, this is definitely an issue I expect us to come back to and fix there — it's been a longstanding gap which we regularly hear bothers people. It's in the new app's tracker as zulip/zulip-flutter#153 . This is also among the areas where Flutter will put us in a much better position to fix things than we've been with React Native in the existing app. In particular, to get this right it's likely we'll need some code handling the notification blobs from the server to also consult the data we've previously stored locally from the server (and your other servers where applicable) — and, at #5589, that's the very point where I decided we'd had enough with React Native and it was time to seriously consider a move to Flutter. (That issue is focused on the Android case but I expect the story is similar with iOS and Swift.) And indeed Flutter supports that situation quite smoothly. |
As part of our effort to display unread message counts, we should make sure to include an unread messages bad on the app icon.[edited following discussion below]
We want to show a badge on the app's icon on the iOS home screen when the user has notifications for messages they haven't read.
The text was updated successfully, but these errors were encountered: