Open jake-bickle opened 4 years ago
Related to https://github.com/uniqush/uniqush-push/issues/117
There's no real objection to web push features, it's just that the maintainers haven't had the free time to implement and qa the features to provide a complete implementation (e.g. does it vary between browsers/OSes, are there edge cases in networking, how has it changed since 2016, security concerns with user-provided endpoints, etc).
It's also a complicated spec.
I'd thought at least one of the maintainers would be involved in an application that used web push, but they had ended up working on other projects instead.
Miscellaneous findings that may help with implementing this in uniqush-push
Uniqush would have to handle unsubscriptions, and the response payload differs between platforms. https://developers.google.com/web/fundamentals/push-notifications/common-issues-and-reporting-bugs mentions some of the differences between Chrome and Firefox - I don't know about edge/opera/safari. Checking the HTTP response code with https://developers.google.com/web/fundamentals/push-notifications/common-issues-and-reporting-bugs#http_status_codes may work on more/all platforms? https://developers.google.com/web/fundamentals/push-notifications/sending-messages-with-web-push-libraries mentions some relevant details
To determine the type of error from a push service it's best to look at the status code. Error messages vary between push services and some are more helpful than others.
In this example, it checks for status codes 404 and 410, which are the HTTP status codes for 'Not Found' and 'Gone'. If we receive one of these, it means the subscription has expired or is no longer valid. In these scenarios, we need to remove the subscriptions from our database.
And https://developers.google.com/web/fundamentals/push-notifications/display-a-notification would be useful for mapping uniqush's property names to, for <uniqushhost>/push
{"subscription":{"endpoint":"https://fcm.googleapis.com/fcm/send/<data>","expirationTime":null,"keys":{"p256dh":"<data>","auth":"<data>"}}}
. In Firefox on Linux, {"subscription":{"endpoint":"https://updates.push.services.mozilla.com/wpush/v2/<data>","keys":{"auth":"<data>","p256dh":"<data>"}}}
. And probably various other services for opera/safari/edge and others.A guess of common major endpoints, which will go out of date or may only apply to receiving, not sending:
*.notify.windows.com
android.googleapis.com
fcm.googleapis.com
updates.push.services.mozilla.com
gateway.push.apple.com
If uniqush-push were to be set up behind a firewall that limits access to only a few external ips, that may cause problems. It may be useful to allow it to configure an https proxy and have all web pushes go through that proxy
It's my understanding that uniqush-push provide a simple means of sending push notifications to android, apple, and kindle devices and has no means of sending web push notifications.
Are there any plans to support this? Does that lie outside the scope of uniqush-push? I ask this because other platforms (such as OneSignal) do provide web push services.