notifications icon indicating copy to clipboard operation
notifications copied to clipboard

trigger "notification:test-push" via mobile apps (to self test push notifications)

Open mahibi opened this issue 3 years ago • 4 comments

It should be possible to trigger

sudo -u www-data php /var/www/yourinstance/occ notification:test-push --talk youruser

via API, so the mobile apps could have a "Test Notifications" button in the settings-view.

That notification should be catched on mobile clients and they show a success dialog. If notification is not received within x seconds, show a dialog with the link to the troubleshooting checklist etc.

With this every user could check that pushproxy is working or not and it can be narrowed down why a notifications is not shown.. If possible, also give feedback to the mobile clients that the "notification:test-push" command was successfully executed on server...

mahibi avatar Jun 01 '22 10:06 mahibi

Current issue is that all notification handling is user based and using a real notification. It would be good enough if that is still the case, but the push only happens to this one device, right?

nickvergessen avatar Jun 02 '22 09:06 nickvergessen

Current issue is that all notification handling is user based and using a real notification. It would be good enough if that is still the case, but the push only happens to this one device, right?

sure. all we need would be a new type for the notification, like "selfcheck"? and if possible maybe add a timestamp to the message when the "notification:test-push" was executed? so we could show in the dialog how long it took to reach the phone..?

mahibi avatar Jun 02 '22 11:06 mahibi

As far as I can tell this feature is currently not possible to implement, because the OCP IManager does not expose a way to send a notification to a single token and not to the all the devices a user has, right? IMO it would also be fine to just send a self-test notification to all devices. Devices that are not doing the self-test at the moment the notification is received can just ignore it. The downside of that would be that older clients wouldn't know how to handle such a notification and possibly crash or display strange popup notifications.

provokateurin avatar Feb 12 '24 10:02 provokateurin

Since we are the app that handles pushing, we can add an endpoint to do exactly that ourselves.

nickvergessen avatar Feb 12 '24 11:02 nickvergessen