I am using an account I created in the nine.testrun.org chatmail server on an android device and I can not get push notifications working. Since Google notifications work with other apps I use, I do not think this is my phone’s fault…
If someone can give me some advice why this is not working, I’ll so grateful!
Which phone do you use, which Android version it has?
Which version of Delta Chat do you have installed, is it installed from Google Play or F-Droid? F-Droid does not have support for FCM push notifications because of non-free Google libraries.
What does the log say? Does it contain “push-enabled=true” and “push-token”?
Try sending a message to self from another account, there should be a log line “FcmReceiveService: FCM push notification received”.
Does it fail to deliver notifications only on one network? Can you try switching to another internet connection, e.g. between Wi-Fi and LTE?
In the notification settings, do you have “Use Background Connection” and/or “Force Background Connection” settings enabled?
This is however expected for force stopped apps as described here:
Note that Delta Chat for Android only shows notifications when it manages to download some message from IMAP server. If FCM notification is received but connection to IMAP server fails, you will not receive a notification. For example if you configure SOCKS proxy inside Delta Chat and the proxy is not working at the moment, FCM notification will be received as Google services do not use the proxy, “FcmReceiveService: FCM push notification received” will be logged, but no notification will be displayed.
I also found a similar catch-all issue for Signal:
Signal likely uses a similar architecture: notification is only displayed if fetching actual message over WebSocket connection to Signal servers succeed.
Hey!
Thanks for the complete answer!
As you said on one of the questions, I downloaded the app from F-Droid and didn’t think of that, but it makes sense Sorry for that…
Maybe this could be a good think to add on the notifications section of the FAQ, since a lot of FOSS enthusiasts download it from there!
However, I’ve been testing with both “Use background connection” and “Force background connection” enabled, and it doesn’t work as good as I would need for everyday use. I’ve disabled all battery optimizations for the app following dontkillmyapp.com and hid the permanent notification for convenience. It works well a while after I open the app, but after a couple of ours or so, it just stops the background connection and I have to open the app again. I suppose it is a battery optimization thing, but I’m not sure (I disabled battery optimization).
I’m using a Xiaomi Redmi 7 with the last update from the stock android (MIUI Global 11.0.2, Android 10).
Is this behavior expected or known?
You can try enabling permanent notification and then hiding it with OS by long-pressing it and selecting some option.
Another common problem is that even though FCM manages to start the app and it logs “FcmReceiveService: FCM push notification received”, it then fails to connect to IMAP and resolve DNS, logging something like “DNS resolution for … failed: DNS lookup failure: failed to lookup address information: No address associated with hostname.”
This happens at least on some stock Samsung phones.
What can probably done in this case is that if Delta Chat gets FCM notification but fails to connect, it can show a notification saying “Failed to connect” if connectivity status is “not connected” (DC_CONNECTIVITY_NOT_CONNECTED) so user can try to open the app. This will at least make this situation visible instead of silently failing.
It has new “foreground service” started when notification is received besides new proxy settings.
If you have as Android phone which has trouble receiving notifications, please test if this version is better at receiving notifications.
It is not a final release version so it displays annoying “Not connected”/“Connecting…” status each time a notification is received, this will be fixed before proper even version number non-beta release. The most important part to test is that you get message notifications in background when you previously got no message notification at all.
I’ve done some tests and seems to work pretty well, better than the older version, for sure!
I think I’ve reached a great balance now between usability and notification receiving.