Spike: Create a web app that sends push notifications on iOS #2
Labels
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: aCheeseInTheDark/tack-up-now#2
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.
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
Done! See notes above