I have been using Nextcloud (shared hosting) for a few years and I have kept the server and the clients up to date. I have never been abel to get the push notifications to the Android clients (Nextcloud and Talk) to work on my server, whereas they do flawlessly when I use the demo.nextcloud.com test server.
To me, this points to an issue with my server rather than with my device. I read a lot of similar threads here and on github, but I cannot get any push notification on the Android clients.
Nextcloud (server) version : 18.0.2
Nextcloud Talk (server) version : 8.0.7
Nextcloud Notification (server) : 2.6.0
Server IP address: 184.108.40.206
Device : Xiaomi Redmi Note 8 Pro, Android 10
Nextcloud (android) : 3.11.0, from Google Play Store
Nextcloud Talk (android) : 8.0.8, from Google Play Store
I have tried clearing cache and data on the Android device apps, uninstalling and reinstalling a few times the apps, unabling and disabling 2FA authentication, using admin and non-admin accounts, without success. Again, using demo.nextcloud.com I get push notifications on this device e.g. when I receive a federated-shared document, without having to tweak anything e.g. battery management or notification parameters.
I guess the culprit is the device registration process. When I start from scratch (i.e. after deleting the entries in oc_notifications_pushtokens table, I see some hints in the server logs indicating that my device has correctly registered to my server:
[07/Apr/2020:13:39:39 +0200] “POST /ocs/v2.php/apps/notifications/api/v2/push?format=json&pushTokenHash=ed36(…)2eff&devicePublicKey=-----BEGIN%20PUBLIC%20KEY-----%0AMIIBIjANB(…)0A0QIDAQAB%0A-----END%20PUBLIC%20KEY-----%0A&proxyServer=https%3A%2F%2Fpush-notifications.nextcloud.com HTTP/1.1” 201 1027 “-” “Mozilla/5.0 (Android) Nextcloud-android/3.11.0”
Neihter the logs in the administration nor nextcloud.log show entries in the timeframe of device registration and push notification triggering.
According to the documentation I found about the push notifications subsrcibing process (https://github.com/nextcloud/notifications/blob/5a2d3607952bad675e4057620a9c7de8a7f84f0b/docs/push-v3.md), it looks like the 201 response means that the Push token has been correctly created, and needs to be sent to the Proxy. Indeed, a new entry in oc_notifications_pushtokens has been created.
So it looks like the next step (subscribing at the Push Proxy) might be the one that fails, but due to my limited technical knowledge I cannot test whether it is the case or not. Is there a way to check somewhere if the device is able to correctly communicate with the Push Proxy? Is it possible that there is a kind of blacklist preventing my server and the Push proxy to properly communicate?
Finally, in the Nextcloud Android App, when I click on “Notifications”, a message is displayed at the bottom reading “Push notifications currently not available”
Thank you for reading this lengthy post, hopefully someone will be able to shed some light on my issue. I appreciate your input