RocketChat / Rocket.Chat.ReactNative

Rocket.Chat mobile clients
https://rocket.chat
MIT License
2k stars 1.17k forks source link

No push notification : I dont receive notifications if the app is not running #2385

Closed nixxou closed 1 year ago

nixxou commented 4 years ago

I don't know if that's a normal behavior. With apps like whatsapp, when i reboot my phone, dont launch the app and i receive a private message, i get the notification, but the same does not apply with rocketchat android app (both reactNative and the old one).

I'm on Android 9.

I only get notification after i launch the app, if i swipe out the app in the list of active app, i don't receive notifications anymore.

I did try in my own server, i try with the "test push notification" on the admin settings page and i make some try with the public open workspace with two accounts (one on my desktop, one on my mobile).

I didn't get any success. The only notifications i can receive is when the app is runing (front or in the background) I tried everything, disabled anything related to battery optimisation for the app, but nothing so far.

Is that a normal behavior ?

st1gok commented 4 years ago

I also have similar behavior. I dont receive notifications if stopped application in Options->Applications. Tried sending push from admin interface and as user message.

Android 9 App 4.9.0.2132 Server 3.5.1

diegolmello commented 4 years ago

Can you test that on https://open.rocket.chat? We're using it on this server and it works.

nixxou commented 4 years ago

Can you test that on https://open.rocket.chat? We're using it on this server and it works.

Like i said, i did exactly that. Two account on the open rocket chat server, one with my desktop, one with my android. If i launch the mobile app, press home (so the app still runing in the background), and send a private message from my computer account to my mobile account i get the notification. But if i swipe out the app in the list of active app, and then send a private message from my computer, i receive no notifications. The same happen if i reboot my phone and dont launch rocket chat : i will not receive any notifications.

diegolmello commented 4 years ago

It's hard to guess what's happening, as it's working on the phone on my desk. What's you Android device? Can you share a log report?

nixxou commented 4 years ago

My phone is a Black Shark 2, runing a close to stock Android 9. I tried to disable all battery optimisations options for Rocket.chat application, but that dont change anything. How can i produce a log report ?

diegolmello commented 4 years ago

https://developer.android.com/studio/debug/bug-report

nixxou commented 4 years ago

I'm not confortable posting a log report on a public page, can i send it to you as a private message ?

I captured debug data while sending a "test push notification" on my server, with my android app swiped out. And indeed, i see on the debug log :

08-12 10:26:41.061 10222 30453 31121 D ReactNativeNotifs: New message from FCM: Bundle[{soundname=default, google.delivered_priority=normal, google.sent_time=1597220801545, google.ttl=2419200, google.original_priority=normal, from=673693445664, title=@Administrateur, google.message_id=0:1597220801550281%a859fc92f9fd7ecd, message=This is a push test message, google.c.sender.id=673693445664}]

But i didn't see a notification on my phone.

Edit I installed rocket chat experimental on an other phone, a Xiaomi Redmi Note 4, and it works perfecly well, so i wonder what went wrong. On my black shark 2, push notification of other app like Whatsapp works perfectly well. But, now on my black shark phone, i didn't even receive push notification, even with rocket chat runing. I spoted that on a debug log, idk if it's related : (i replaced some data with XXXXX because idk if that's private or sensible data)

08-12 13:14:48.176 10226 17476 17501 W Firebase-Installations: Error when communicating with the Firebase Installations server API. HTTP response: [403 Forbidden: { 08-12 13:14:48.176 10226 17476 17501 W Firebase-Installations: "error": { 08-12 13:14:48.176 10226 17476 17501 W Firebase-Installations: "code": 403, 08-12 13:14:48.176 10226 17476 17501 W Firebase-Installations: "message": "Requests to this API firebaseinstallations.googleapis.com method google.firebase.installations.v1.FirebaseInstallationsService.CreateInstallation are blocked.", 08-12 13:14:48.176 10226 17476 17501 W Firebase-Installations: "status": "PERMISSION_DENIED", 08-12 13:14:48.176 10226 17476 17501 W Firebase-Installations: "details": [ 08-12 13:14:48.176 10226 17476 17501 W Firebase-Installations: { 08-12 13:14:48.176 10226 17476 17501 W Firebase-Installations: "@type": "type.googleapis.com/google.rpc.Help", 08-12 13:14:48.176 10226 17476 17501 W Firebase-Installations: "links": [ 08-12 13:14:48.176 10226 17476 17501 W Firebase-Installations: { 08-12 13:14:48.176 10226 17476 17501 W Firebase-Installations: "description": "Google developer console API key", 08-12 13:14:48.176 10226 17476 17501 W Firebase-Installations: "url": "https://console.developers.google.com/project/673693445664/apiui/credential" 08-12 13:14:48.176 10226 17476 17501 W Firebase-Installations: } 08-12 13:14:48.176 10226 17476 17501 W Firebase-Installations: ] 08-12 13:14:48.176 10226 17476 17501 W Firebase-Installations: } 08-12 13:14:48.176 10226 17476 17501 W Firebase-Installations: ] 08-12 13:14:48.176 10226 17476 17501 W Firebase-Installations: } 08-12 13:14:48.176 10226 17476 17501 W Firebase-Installations: } 08-12 13:14:48.176 10226 17476 17501 W Firebase-Installations: ] 08-12 13:14:48.176 10226 17476 17501 W Firebase-Installations: Firebase options used while communicating with Firebase server APIs: XXXXXXXXXXXXXX, rocketchat-9e9be, 1:XXXXXXXXXXXXXXXX:android:XXXXXXXXXXX 08-12 13:14:48.176 10226 17476 17501 E Firebase-Installations: Firebase Installations can not communicate with Firebase server APIs due to invalid configuration. Please update your Firebase initialization process and set valid Firebase options (API key, Project ID, Application ID) when initializing Firebase. 08-12 13:14:48.177 10226 17476 17502 E FirebaseInstanceId: Failed to get FIS auth token

nixxou commented 4 years ago

Ok, so my last issue was related to this : https://github.com/RocketChat/Rocket.Chat/issues/18541 And i manage to fix it.

But right now, i'm back to step one, and i still only get notification if my app is active (or runing in background).

@diegolmello Can i send you a bug report in a private message ?

diegolmello commented 4 years ago

@nixxou sure! https://open.rocket.chat/ I'm @diego.mello

nixxou commented 4 years ago

Ok, i send you a private message in the rocket chat open workplace.

nahid commented 4 years ago

I am facing the same issue from couple of days

diegolmello commented 4 years ago

@nahid @nixxou is this still happening for you?

gamingumar commented 4 years ago

I am not able to login at https://cloud.rocket.chat/

diegolmello commented 4 years ago

@gamingumar Ask on https://open.rocket.chat/channel/support

nixxou commented 4 years ago

@diegolmello yes, i still have the issue

nahid commented 4 years ago

@diegolmello yes I still facing this issue

wolfcreative commented 3 years ago

@diegolmello I have this problem. Moreover, my users with Huawei and Xiaomi do not receive ANY notifications.

Notifications from other apps come perfectly. Slack, Whatsapp, etc.

aleadco commented 3 years ago

This happens with the latest version of the stable app 4.11.0.2137, in the experimental version it works correctly.

wolfcreative commented 3 years ago

@aleadco As it turned out, the problem was in the Android system settings. Some users didn't have notifications enabled by default, while others did the opposite.

It is strange that this problem is only with Rocket.Chat app.

aleadco commented 3 years ago

@wolfcreative In the Push notifications settings in the user's profile "Default" is set, so according to the server settings all the notifications sent to the private chats should reach me, as happens in the experimental version of rocket. However I changed the setting to "Mentions" and if I receive notifications in that regard. With these it is possible to assume that with the last update the default settings are not being read correctly. It is unquestionably an application problem.

diegolmello commented 1 year ago

Is it still valid?

azhinu commented 1 year ago

@diegolmello yes. Android 12 and Android 13 on Pixel. Sometimes I receive a notification with a big delay and only if application is running.

diegolmello commented 1 year ago

Thanks, @azhinu. We're going to investigate Pixel devices. In the meantime, please create two accounts on https://open.rocket.chat and send messages between them to test if notifications are going to work on your device.

If anyone else has issues with push notifications, please list your affected devices and OS versions.

azhinu commented 1 year ago

@diegolmello, I tried that you wrote. When I just switched to another app, I receive push within 20-30 seconds after i send a message. But when i swapped off rocket chat from recent apps or waited for a few hours, i doesn't receive a push.