Spike: Create a web app that sends push notifications on iOS #2

Closed
opened 2024-04-16 22:48:37 -04:00 by aCheeseInTheDark · 3 comments
No description provided.
aCheeseInTheDark added this to the Tack Up Now project 2024-04-16 22:48:37 -04:00
Author
Owner

So far I've discovered that PushManager is not available on window, at least.

It seems that it may be available as pushManager on the ServiceWorkerRegistration object, but I haven't been able to directly verify this yet because I can't directly access a test device.

So far I've discovered that PushManager is not available on window, at least. It seems that it may be available as pushManager on the ServiceWorkerRegistration object, but I haven't been able to directly verify this yet because I can't directly access a test device.
Author
Owner

Okay, finally got this to work.

Several things required to make it work.

Your site MUST have a manifest called by the exact name of "site.webmanifest" included as a link with rel="manifest" (just kidding, apparently it also works with manifest.webmanifest)
The user must add the site to their home screen first which is done through the share menu in safari
The user has to initiate the notifications through a gesture of some sort
Notification subscription has to be immediate, you can't check permissions first
Page reloads must be done differently if your PWA is in standalone mode
The PWA has to be deleted if the user initially declines notifications to allow them to grant notification permissions again
Chrome has the share button in the address bar

Okay, finally got this to work. Several things required to make it work. Your site MUST have a manifest called by the exact name of "site.webmanifest" included as a link with rel="manifest" (just kidding, apparently it also works with manifest.webmanifest) The user must add the site to their home screen first which is done through the share menu in safari The user has to initiate the notifications through a gesture of some sort Notification subscription has to be immediate, you can't check permissions first Page reloads must be done differently if your PWA is in standalone mode The PWA has to be deleted if the user initially declines notifications to allow them to grant notification permissions again Chrome has the share button in the address bar
Author
Owner

Done! See notes above

Done! See notes above
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: aCheeseInTheDark/tack-up-now#2
No description provided.