PharmaLedger-IMI / ctr-workspace

UC8 Clinical Trials Recruitment
MIT License
2 stars 0 forks source link

Notifications server-push #57

Open joaoluis-pdm opened 2 years ago

joaoluis-pdm commented 2 years ago

General steps: 1 - test out the notifications and server-push APIs https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/Re-engageable_Notifications_Push and https://developers.google.com/web/ilt/pwa/introduction-to-push-notifications 2 - when the concepts are well understood, if the features are suitable, propose a re-fator/re-design of the MatchRequest/MatchResult mechanism so that the centralized server may notify the patient of new match-results (or potential new match results).

joaoluis-pdm commented 2 years ago

Chrome Incognito does not allow notifications. Tests must be performed in non-incognito mode with the debugger on.

joaoluis-pdm commented 2 years ago

Testing a notification with HTML content. (See previous commit).

Firefox 94 on Linux (Ubuntu 20 LTS Gnome): image

Remarks: Sponsor logo appears, but with wrong aspect ratio. Bold text appears bold, but no paragraphs or line-breaks shown. Message seems truncated until clicked upon.

Firefox 94 on Windows 10 Home Edition: image

Remarks: Sponsor logo appears with correct aspect ratio. No HTML markup shown whatsoever.

Edge 95 on Windows 10 Home Edition: image

Remarks: Sponsor logo appears with correct aspect ratio but truncated and over a black background. No HTML markup shown whatsoever.

Mobile Firefox Daylight 94.1.2 on Android 10: image

Mobile Chrome 96.0 on Android 10: image

Remarks: Failed. The notification needs to be pushed from the service worker.

Safari 14.1.2 macOS Big Sur 11.6

image

Remarks: Failed (but after asking permissions for notification).

Preliminary remarks:

Safari Support Issues

There appears to be no support for PushEvent on Safari and Safari on IOS: https://developer.mozilla.org/en-US/docs/Web/API/Push_API image

The Safari support for notifications seems also a bit limited: https://developer.mozilla.org/en-US/docs/Web/API/notification image

joaoluis-pdm commented 2 years ago

Desktop safari notifications should be operational on last commit.