Skip to content
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

Push notifications do not work for groups/channels #6988

Closed
rasos opened this issue May 16, 2017 · 6 comments
Closed

Push notifications do not work for groups/channels #6988

rasos opened this issue May 16, 2017 · 6 comments

Comments

@rasos
Copy link
Contributor

rasos commented May 16, 2017

Even when setting notifications to receive all messages for mobile, in any group or channel they do not arrive at the mobile device.
[34kI20170517-00:51:23.974(2) Push: Sent message "#testraum1" to 0 ios apps 0 android apps

Mentions or notifications for PM work as expected.
[34kI20170517-00:51:48.097(2) Push: Sent message "#testraum1" to 0 ios apps 1 android apps
Also notifications for desktop work as expected.

See also #5308 and #1602 (comment) (allow to configure push independent of status).

Rocket.Chat Version: 0.56 (upgraded today), observed also with 0.52

@rafaelks
Copy link
Contributor

@rasos

  • What OS are you using?
  • What's the app version?
  • Are you using our app from the store, or you compiled it?

@rasos
Copy link
Contributor Author

rasos commented May 17, 2017

@rafaelks

  • RC server is on CentOS.
  • Tested with apps
    -- latest RC client from iTunes store for iOS
    -- latest RC+ client for Android (seems not to handle push at all?)
    -- custom ucom App (Qt based, can handle push)

As you see on the log, the RC server does not send a push token. So this issue is independent of the mobile client.

@rasos
Copy link
Contributor Author

rasos commented May 21, 2017

We found that our own Qt based client did not change back the status from "Online" to "Away". As this is a precondition to receive notifications, logged in users never received them. It seemed to be a coincidence, that the App was running when we tested the behaviour in rooms.

@rasos rasos closed this as completed May 21, 2017
@rasos
Copy link
Contributor Author

rasos commented May 23, 2017

We have now implemented online/away for the App, the status is shown correctly in Rocket.Chat.
Still, push notifications do not arrive when "away".
We also applied the patch #1602 (comment) - still no success.
Notifications only arrive, when there is no connection at all from the app to the server by closing app. Even if the app shows offline status, it seems that RC thinks the user is still online and does not send push notifications.

What are the conditions to send push notifications for mobile use?
I tried to study the code in rocketchat_lib.js:1771 but do not get a clue.

@rasos rasos reopened this May 23, 2017
@rafaelks
Copy link
Contributor

@rodrigok Can you help us here? What's the conditions to send a push notification to the mobile apps?

@rasos
Copy link
Contributor Author

rasos commented May 30, 2017

After studying the code in packages/rocketchat_lib/server/lib/sendNotificationsOnMessage.js around line 150 ( = rocketchat_lib.js on server around line 1820) we found out that push is only delivered to mobile Rocket:chat devices, if their network status is disconnected. Our Qt based App only went to user status "away", when backgrounded, which is not recognized really being away in the push notification logic. We are now also disconnecting and have solved the issue.

@rasos rasos closed this as completed May 30, 2017
rasos added a commit to rasos/Rocket.Chat.Docs that referenced this issue May 31, 2017
Describing basic mechanism of notifications, after having studied the code, see RocketChat/Rocket.Chat#6988
geekgonecrazy pushed a commit to RocketChat/docs-old that referenced this issue Jun 7, 2017
Describing basic mechanism of notifications, after having studied the code, see RocketChat/Rocket.Chat#6988
Cool-Dev121 added a commit to Cool-Dev121/docs that referenced this issue Mar 8, 2023
Describing basic mechanism of notifications, after having studied the code, see RocketChat/Rocket.Chat#6988
Cool-Dev121 added a commit to Cool-Dev121/docs that referenced this issue Mar 8, 2023
Describing basic mechanism of notifications, after having studied the code, see RocketChat/Rocket.Chat#6988
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants