nextcloud / ios

📱 Nextcloud iOS App
https://itunes.apple.com/us/app/nextcloud/id1125420102
GNU General Public License v3.0
1.96k stars 882 forks source link

Banner notifications don’t work for secondary trusted domains #931

Open Whissi opened 5 years ago

Whissi commented 5 years ago

Expected behaviour

When your iOS plays the notification sound I expect to see a notification in notification screen.

Actual behaviour

When you receive a notification from Nextcloud (like an update notification, invitiation to Nextcloud event...) my iOS device will play the iOS notification sound but I don't see anything in iOS' notification screen. It took me a while to figure out that this was coming from Nextcloud.

Note: When I open Nextcloud iOS app, I see notifcations within the Nextcloud app.

Steps to reproduce

  1. Install Nextcloud app.
  2. Add an account.
  3. Leave app (go to iOS main screen, open another app or enter standby).
  4. Trigger a notification (the hard part... maybe wait for a plugin update notification).

Your iOS device will now receive that notification and play normal iOS notification sound. However, when you view iOS notification screen, it's empty (at least nothing new/from Nextcloud shows up).

Open Nextcloud app, touch the notification icon (bell) and you will see that the notification now shown in Nextcloud app correlates to the time your iOS devices played to notification sound.

iOS version

iOS 12.4.x

App version

2.23.8.30

Server configuration

Operating system: Gentoo Linux

Web server: nginx

Database: Percona-Server 5.7

PHP version: 7.3.9

Nextcloud version: 16.0.4

inthreedee commented 5 years ago

I'm having trouble generating notifications for step four. Can you give a reliable way to produce one?

Also, double check that all the banners are actually enabled in your iOS settings. The version of iOS you're using is over a year old and I don't recall where these settings exist in that version, but in 12.4 I have a section in settings labeled "Notifications" right near the top. Find Nextcloud and there and confirm it has access to Lock Screen, Notification Center, and Banner alerts.

Whissi commented 5 years ago

Sorry, it was a typo. I am using latest 12.4.1... I wanted to express that I see this for a while. Didn't started with 12.4.1 which was released a few days ago.

And no, I don't really know a way to trigger notifications. Maybe downloading and installing and old plugin version will do that.

Yes, I checked that banners are enabled. Lockscreen is disabled but that shouldn't be the reason like I have it disabled for all other applications, too but I still see their notifications like expected in notification view.

inthreedee commented 5 years ago

I found this command to generate a notification: sudo -u www-data php occ notification:generate <username> "This is a test"

When I run that in a console on my server, I see both a temporary banner notification when my phone is unlocked and a lock screen notification when my phone is locked, in addition to the sound. So it seems to work for me.

I'm currently running the beta to help test that, v2.24.0 beta12. If you don't see notifications with the above command, can you try again with the beta?

Whissi commented 5 years ago

Nope, doesn't work: The command will generate a notification, I'll hear the notification sound. But I don't see any banner or anything on the iOS notification screen (the thing you pull down). When I open the app I see the notification when touching on the bell).

I joined Testflight and installed latest Beta (2.24.0.12) and still have the same problem. IMG_1277 IMG_1278

Of course I disabled notification. Waited a few minutes and re-enabled everything, but still the same problem:

2019-09-02 19-32-03-1

Enabling the first option (lock screen) doesn't change anything.

inthreedee commented 5 years ago

Hm. I'm not sure what else to try here; I can't seem to reproduce the problem on my end. I assume you see notifications from other apps on your phone? Do you have any other iOS settings enabled that might be interfering? Parental control or other privacy settings, etc?

I just tested with your settings (lock screen off, the other two on) and I see the temporary banner come down from the top of the screen when my phone is unlocked, but nothing on my lock screen as expected.

Maybe try completely deleting and re-installing the app to make it re-register for push notifications?

Whissi commented 5 years ago

Yes, notifications from other applications are working fine. Or let me say it that way: It's just Nextcloud app where I am experiencing any problems so far (you never know what will happen ;))

I am also not aware of any interfering settings. Not using parental control.

I re-installed the application but the problem is still there.

We have multiple iOS devices and all are showing the same problem: Only notification sound but no banner.

inthreedee commented 5 years ago

Could it be server-side? Is the Notifications app enabled and up to date?

Since notifications are working for me, I'd be willing to log into a test account to rule out a server issue if that would help. Otherwise the maintainer will need to have a look next as I'm out of ideas!

Whissi commented 5 years ago

Notification app is enabled and should be up to date (2.4.1). Given that all devices will play a sound and show the notification in the Nextcloud app I assume it's working server-side.

Please send me an email (address should be visible in my GitHub profile) and I'll send you the credentials.

inthreedee commented 5 years ago

So an update:

I logged into the test account provided by @Whissi and I experience the same issue as he describes in his OP. To be clear, push banner notifications work when I'm logged into my server but do not when I log into his server. Sound push notifications work in both cases, so at least some part of push notifications is functioning properly. The notifications appear under the bell icon, so they are working server-side.

I'm out of ideas!


Here's the details of my setup for comparison:

iOS: v12.4

Nextcloud App: v2.24.0b13

Server configuration

Operating system: Ubuntu 18.04.3

Web server: Apache

Database: mysql v5.7.27

PHP version: 7.2.20

Nextcloud version: 16.0.3

App List Enabled: - accessibility: 1.2.0 - activity: 2.9.1 - calendar: 1.7.0 - cloud_federation_api: 0.2.0 - comments: 1.6.0 - contacts: 3.1.3 - dav: 1.9.2 - deck: 0.6.6 - dropit: 0.2.1 - encryption: 2.4.0 - federatedfilesharing: 1.6.0 - federation: 1.6.0 - files: 1.11.0 - files_pdfviewer: 1.5.0 - files_rightclick: 0.15.1 - files_sharing: 1.8.0 - files_texteditor: 2.8.0 - files_trashbin: 1.6.0 - files_versions: 1.9.0 - files_videoplayer: 1.5.0 - firstrunwizard: 2.5.0 - gallery: 18.3.0 - logreader: 2.1.0 - lookup_server_connector: 1.4.0 - nextcloud_announcements: 1.5.0 - notifications: 2.4.1 - oauth2: 1.4.2 - password_policy: 1.6.0 - privacy: 1.0.0 - provisioning_api: 1.6.0 - recommendations: 0.4.0 - serverinfo: 1.6.0 - sharebymail: 1.6.0 - spreed: 6.0.4 - support: 1.0.0 - systemtags: 1.6.0 - text: 1.0.2 - twofactor_backupcodes: 1.5.0 - twofactor_totp: 3.0.1 - viewer: 1.0.0 - workflowengine: 1.6.0 Disabled: - admin_audit - files_external - survey_client - theming - user_ldap
Whissi commented 5 years ago

Server configuration detail

Operating system: Gentoo Linux

Webserver: nginx/1.17.3 (fpm-fcgi)

Database: mysql 5.7.27

PHP version: 7.3.9

Modules loaded: Core, date, libxml, openssl, pcre, zlib, bcmath, bz2, ctype, curl, dba, dom, hash, fileinfo, filter, ftp, gd, gettext, SPL, iconv, session, intl, json, mbstring, standard, mysqlnd, pcntl, mysqli, PDO, pdo_mysql, Phar, posix, readline, Reflection, imap, SimpleXML, soap, sodium, exif, tokenizer, xml, xmlreader, xmlwriter, zip, cgi-fcgi, igbinary, imagick, realpath_turbo, redis, Zend OPcache

Nextcloud version: 16.0.4 - 16.0.4.1

Updated from an older Nextcloud/ownCloud or fresh install: Upgrade

Where did you install Nextcloud from: Nextcloud

List of activated apps ``` Enabled: - accessibility: 1.2.0 - activity: 2.9.1 - admin_audit: 1.6.0 - cloud_federation_api: 0.2.0 - dav: 1.9.2 - federatedfilesharing: 1.6.0 - federation: 1.6.0 - files: 1.11.0 - files_pdfviewer: 1.5.0 - files_rightclick: 0.15.1 - files_sharing: 1.8.0 - files_texteditor: 2.8.0 - files_trashbin: 1.6.0 - files_versions: 1.9.0 - files_videoplayer: 1.5.0 - firstrunwizard: 2.5.0 - gallery: 18.3.0 - groupfolders: 4.1.0 - logreader: 2.1.0 - lookup_server_connector: 1.4.0 - nextcloud_announcements: 1.5.0 - notifications: 2.4.1 - oauth2: 1.4.2 - password_policy: 1.6.0 - privacy: 1.0.0 - provisioning_api: 1.6.0 - recommendations: 0.4.0 - serverinfo: 1.6.0 - sharebymail: 1.6.0 - support: 1.0.0 - survey_client: 1.4.0 - systemtags: 1.6.0 - theming: 1.7.0 - twofactor_backupcodes: 1.5.0 - twofactor_totp: 3.0.1 - updatenotification: 1.6.0 - viewer: 1.1.0 - workflowengine: 1.6.0 Disabled: - comments - encryption - files_external - user_ldap ```
Configuration (config/config.php) ``` { "passwordsalt": "***REMOVED SENSITIVE VALUE***", "secret": "***REMOVED SENSITIVE VALUE***", "trusted_domains": [ "cloud1.example.net", "cloud2.example.com" ], "datadirectory": "***REMOVED SENSITIVE VALUE***", "overwrite.cli.url": "https:\/\/cloud1.example.net", "dbtype": "mysql", "version": "16.0.4.1", "dbname": "***REMOVED SENSITIVE VALUE***", "dbhost": "***REMOVED SENSITIVE VALUE***", "dbport": "", "dbtableprefix": "oc_", "dbuser": "***REMOVED SENSITIVE VALUE***", "dbpassword": "***REMOVED SENSITIVE VALUE***", "enabledPreviewProviders": [ "OC\\Preview\\PNG", "OC\\Preview\\JPEG", "OC\\Preview\\GIF", "OC\\Preview\\BMP", "OC\\Preview\\XBitmap", "OC\\Preview\\MP3", "OC\\Preview\\TXT", "OC\\Preview\\MarkDown", "OC\\Preview\\PDF", "OC\\Preview\\Movie" ], "installed": true, "instanceid": "***REMOVED SENSITIVE VALUE***", "mail_from_address": "***REMOVED SENSITIVE VALUE***", "mail_smtpmode": "smtp", "mail_smtpauthtype": "LOGIN", "mail_domain": "***REMOVED SENSITIVE VALUE***", "memcache.local": "\\OC\\Memcache\\Redis", "filelocking.enabled": "true", "memcache.locking": "\\OC\\Memcache\\Redis", "redis": { "host": "***REMOVED SENSITIVE VALUE***", "port": 0, "dbindex": 0, "password": "***REMOVED SENSITIVE VALUE***", "timeout": 1.5 }, "maintenance": false, "loglevel": 2, "mail_smtphost": "***REMOVED SENSITIVE VALUE***", "simpleSignUpLink.shown": false, "tempdirectory": "***REMOVED SENSITIVE VALUE***", "theme": "", "mysql.utf8mb4": true } ```

External storages: files_external is disabled

Encryption: no

User-backends:

Whissi commented 5 years ago

I think I found the problem: Like you can see in my config, I have mutliple trusted domains,

    "trusted_domains": [
        "cloud1.example.net",
        "cloud2.example.com"
    ],

@jmattt and I were using cloud2.example.com which is not the 'primary' URL. When I add an account from primary URL cloud1.example.net in addition, I suddenly will receive visible notifications (like banners) for both accounts.

When I remove the cloud1.example.net account again, my remaining cloud2.example.com account will return to not visible notifications again.

inthreedee commented 5 years ago

@marinofaggiana is that a problem with the way the iOS app handles banner notifications for multiple trusted domains or is it an upstream server problem?

Whissi commented 5 years ago

Because it's working fine with the same 'secondary' account on my Android devices I assume this is an iOS App bug.

melyux commented 5 years ago

Having the same issue. I get the sound only on all iOS devices, but no notification banner. I'm running through a reverse proxy, maybe that has something to do with it? But everything else works to a tee.

melyux commented 5 years ago

I reinstalled the server, but now I don't even get the sound on notifications.

inthreedee commented 5 years ago

@Whissi I noticed some changes to push notifications in the code for today's beta, build 20 (RC2). No word from the developer, but can you double check that this still happens?

Whissi commented 5 years ago

Problem is still present in RC2.

melyux commented 5 years ago

I only have one trusted domain, and still getting this. Not sure if it's related to having secondary trusted domains. After the latest minor update, I'm getting notification sound again, but still no banners.

melyux commented 4 years ago

@marinofaggiana

hatiac commented 4 years ago

I have this issue also with Nextcloud server 18.0.0, Nextcloud iOS 2.25.3.6 iOS 12.4.4. Issue has been there for some time before upgrading from 17 to 18 too. I don't receive any notification sound or banners but when I open Nextcloud app I can see that there are notifications. I have tried reinstalling app and removing device from Nextcloud settings. Also tried to disable and re-enable notifications app from Nextcloud.

Rello commented 4 years ago

I don´t know which topic is monitored. this or #946 so also a bump here from me

NC-talk works NC-app does not

It seems there is an issue with the registration of the apple notification service?