Rocket.Chat.ReactNative
Rocket.Chat.ReactNative copied to clipboard
iOS notifications, but no badge count
Description:
I receive iOS notifications, but the badge count (any number) never appears.
Environment Information:
- Rocket.Chat Server Version: 4.8.1
- Rocket.Chat App Version: 4.28.0
- Device Name: iPhone / iPad
- OS Version: iPhone 15.5 / iPad 15.5
Steps to reproduce:
- Follow the documentation step for step: https://developer.rocket.chat/mobile-app/mobile-app-white-labelling/ios-app-white-labelling
- Build the App to physical device
- Log in with user
- Send user a message so push notification is sent
Expected behavior:
I would expect a badge to appear when I receive a push notifications.
Actual behavior:
The badge never appears when I receive push notifications.
Additional context:
The only thing I can think of, is that it has to do with the Rocket.Chat target (see attached image), which is in my Xcode project, but absent from the documentation. I’m new to ReactNative and iOS development in general, so I will miss things if the docs miss things. Android notifications and badges work as expected.
Same here
@aimeecringle I sent you a message on rocket.chat We need help trying to find a solution.
I experience the same, but with the standard Rocket.Chat app.
Self hosted server 5.4.3, iOS App 4.35.1.37441, using the push service from cloud.rocket.chat. My iOS is 16.2.
After a quick research it appears to me, that the icon badge counter is set by local notifications, not with push notifications. So the App would wake up from the push notification and then set the badge counter accordingly with local notifications. Here is an article how to set that up with ReactNative: Creating React Native badge components in iOS - LogRocket Blog (I didn’t look at the code of the iOS App yet, so no idea if it maybe is already done that way.)
@ansiwen That's not the case. The badge count is calculated on backend and sent on push payload.
@diegolmello right, later in the article they also mention that.
Anyway, would be great to find the issue. Maybe a look at how https://github.com/vector-im/element-ios does that can help? That is working very reliably in this respect.
This is my app right now. Of course it's the experimental version of the app, but nothing changed in comparison to the store build.
Something maybe related: I get badges on the app symbol for private messages, but not for new unread messages in private (?) channels.
I get the push notification, and when I open the app it's there, but no badge.
Something maybe related: I get badges on the app symbol for private messages, but not for new unread messages in private (?) channels.
Pretty sure that can't happen. Here's the query on backend https://github.com/RocketChat/Rocket.Chat/blob/0abc0d6d446e46b68c92fe31b9d4a2c89fb45d7a/apps/meteor/server/models/raw/Subscriptions.ts#L30
@diegolmello You're right! That was a setting on the server side, showing the counter for channels only for mentions. Switching the counter to all messages, also shows the badge for those.
But maybe that's also the problem for OP's test case?
@phriedrich That's it! There is a global setting for that (Unread_Count
), that is only set to mentions by default. I'm not surprised many people get that wrong, because virtually every other messenger system has that as a per-user setting. I mean, that's something every user wants to decide separately, no?
For the record: for what messages a push notification is sent out is a per-user setting, but the read-count is a global setting.
@diegolmello and you are obviously using the "Platin Edition" of the app, of course everything will work perfectly there. 😋
Great to hear that. I'm going to close the issue. @aimeecringle feel free to comment here if it doesn't solve it for you.
@ansiwen hahaha you would be amazed on the amount of issues we find on daily basis while trying new things 😅