Problems with push notifications

Issue
push notifications do not work on web-browsers and mobile apps (android).
background: we want to use Nextcloud-Talk and unfortunately the function of push notifications is essential for a proper use of this feature.

information about the installation
nextcloud version: 15.0.2
operating system and version: Ubuntu 18.04
apache: 2.4.29
php version: 7.2.10
database: mysql

Is this the first time you’ve seen this error? (Y/N): Y

steps to reproduce:

browser:
1.) sign in with two test account on two different machines.
2.) in the browser of one testaccount open the Nextcloud-Talk function.
3.) start a conversation with the other test account.
4.) no push notification on the other computer (second test account) is displayed.
5.) after a few seconds (after the refresh of the nextcloud page), the notification bar indicates that there are notifications.

in summary: Nextcloud-Talk in Browser works in principle.
but there is no push notification in case of new conversations or messages.

mobile application:
1.) sign in with two test account on two different mobiles (for login, the login process with username and password is used directly in the app.)
2.) immediately after login confirmation, the message “Push notifications disabled” appears.
3.) the sending and receiving of messages works without any problems when every user on the devices is online and “inside” in the app.
4.) push notifications do not work

5.) as another test, the account was removed on both devices again and the login was done via an “app token” which was created on the nextcloud menu “Security”.

Information about the mobile app
app version: 3.2.3 (from play store)
google play service version: 14.7.99

on every android device, the app (Nextcloud-Talk) was installed directly from the App Store (Google Play).
each device has native Google-Play-Services installed.

additional Information
the output of your Nextcloud log:
unfortunately there are no log entries in connection with “notifications” or “push” (also in the debug setting)

The output of your config.php file:

$CONFIG = array (
‘instanceid’ => ‘############’,
‘passwordsalt’ => ‘############’,
‘secret’ => ‘############’,
‘trusted_domains’ =>
array (
0 => ‘############’,
1 => ‘############’,
2 => ‘############’,
3 => ‘############’,
),
‘datadirectory’ => ‘/srv/nextcloud’,
‘dbtype’ => ‘mysql’,
‘version’ => ‘15.0.2.0’,
‘dbname’ => ‘############’,
‘dbhost’ => ‘localhost’,
‘dbport’ => ‘’,
‘dbtableprefix’ => ‘oc_’,
‘dbuser’ => ‘############’,
‘dbpassword’ => ‘############’,
‘installed’ => true,
‘memcache.local’ => ‘\OC\Memcache\APCu’,
‘mail_domain’ => ‘############’,
‘mail_from_address’ => ‘nextcloud’,
‘mail_smtphost’ => ‘############’,
‘mail_smtpport’ => ‘25’,
‘mail_smtpdebug’ => true,
‘mail_smtptimeout’ => ‘30’,
‘auth.bruteforce.protection.enabled’ => false,
‘default_language’ => ‘de’,
‘maintenance’ => false,
‘theme’ => ‘’,
‘loglevel’ => ‘0’,
‘overwriteprotocol’ => ‘https’,
‘overwritehost’ => ‘############’,
‘overwrite.cli.url’ => ‘############’,
‘updater.release.channel’ => ‘stable’,

software:
notifications and nextcloud-talk plugin (app) is installed on the nextcloud server.

plugin-versions:
Notifications 2.3.0
Talk 5.0.2

other:
the compatibility check on the endpoint (/ocs/v2.php/cloud/capabilities) show up the “push” entry.

The output of your apache log:
unfortunately there are no log entries in connection with notifications or push (for example: https://push-notifications.nextcloud.com/)

database:
the table “oc_notifications_pushtokens” is emty…?!

i suspect that indicates that, no client registers with the push notification service?

no log entry on the server indicates that the nextcloud server contacts the push notification service (https://push-notifications.nextcloud.com/).

but on this point no other idea how to continue debugging…

thankful for any help.

Hello,

we have the same Problem. Did you upgrade from Owncloud or a new Nextcloud installation?

Hi,

also an Upgrade from Owncloud.
apache 2.4.29
php 7.2
NC 15 und NC 16 Talk
Notificaion 2.4.1

There are 2 instances. The upgraded one, which sends an 404 on Android Request and don’t register the device.
… - admin [23/May/2019:20:38:11 +0000] “POST /ocs/v2.php/apps/notifications/api/v2/push?devicePublicKey=-----BEGIN%20PUBLIC%20KEY-----%0xxxxxxxxx-----END%20PUBLIC%20KEY-----%0A&proxyServer=https%3A%2F%2Fpush-notifications.nextcloud.com&format=json&pushTokenHash=yyyyyyyy HTTP/1.1” 404 1150
This is the new installed one the same server with the same android client
… - admin [23/May/2019:21:07:16 +0000] "POST /ocs/v2.php/apps/notifications/api/v2/push?devicePublicKey=-----BEGIN%20PUBLIC%20KEY-----%0xxxxxxxxx-----END%20PUBLIC%20KEY-----%0A&proxyServer=https%3A%2F%2Fpush-notifications.nextcloud.com&format=json&pushTokenHash=yyyyyyyy … - admin [23/May/2019:20:38:11 +0000] “POST /ocs/v2.php/apps/notifications/api/v2/push?devicePublicKey=-----BEGIN%20PUBLIC%20KEY-----%0xxxxxxxxx-----END%20PUBLIC%20KEY-----%0A&proxyServer=https%3A%2F%2Fpush-notifications.nextcloud.com&format=json&pushTokenHash=yyyyyyyy HTTP/1.1” 201 1684

On Both Requests the devicePublicKey und pushTokenHash are the same.
Any hints, what i can do to fix that?
Are there any Settings?
Debug Logs?

Okay, extended the apps/notifications/lib/Controller/PushController.php with ilogger for debugging.
Solution was simpler:
chown -R www-data:www-data data/appdata_oc…/identityproof