zulip-mobile
zulip-mobile copied to clipboard
Badge count on iOS app icon
~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.
@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 It says we could it using widgets as vanilla android doesnot allow you to draw on app icon. What are your thoughts?
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 -
- https://facebook.github.io/react-native/docs/native-modules-android.html currently i found this i will do a bit more research as suggested by you and @timabbott.
@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: https://github.com/zulip/zulip-mobile/issues/408
@vishwesh3 what is Facebook an example for? Not sure I follow. Showing counts on icon
@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.
yup! it depends on mobile launcher
In my default launcher it is showing
but not showing in google now 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 https://github.com/zulip/zulip/issues/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. Feel free to explore the issue and let us know if any back-end changes are required to make this work.
@borisyankov I believe this is actually in progress, and mostly complete; see https://github.com/zulip/zulip/issues/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).
- Actually, perhaps Zulip should do this elsewhere, as well. I've gotten the feedback from housemates that they find the number of unread messages that Zulip tells them they have overwhelming.
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: https://developer.android.com/training/notify-user/badges
To summarize my thoughts:
- we should try to have consistent unread count between the web favicon, the iOS app's badge and the Android launcher badges (latter might be impossible due to differences in meaning between launchers and platform versions)
- we should try to keep a low unread count, only including high priority messages or even an aggregate by narrow
(See also zulip/zulip#10271 .)
(I just closed https://github.com/zulip/zulip-mobile/issues/676 as covered by this issue; it has a link to https://developer.android.com/preview/features/notification-badges.html.)
Bumping the priority.
@timabbott said:
We just got another user question about when Zulip will support iOS unread badges on the app (like we have on Android); this is starting to feel like LaTeX as a feature we've had 10+ people explicitly ask for.
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.
Since this issue has the labels a-IOS
and a-notifications
, I'm marking it as blocked by https://github.com/zulip/zulip-mobile/issues/4115, so we only have to implement a solution once. The PR https://github.com/zulip/zulip-mobile/pull/4163 is currently open for that issue.
#4163 is merged!
So the issue is back in this status:
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.
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.