This repository has been archived by the owner on Sep 4, 2020. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Make WebPush easier and more standardized for the
browser
platform, using same/similarregistration
semantics as iOS and Android. Eliminates hard-wired manifest and service worker injection as well as the hard-wiredpushServiceURL
logic, which made the old code unusable for real-world applications.These changes will break apps that depend on the plugin's hard-wired manifest, service worker and pushServiceURL logic (a fix, IMHO). If this is a concern for 2.x it would be nice to see a 3.0.alpha soon.
Description
www/browser/push.js:
manifest.json
into htmlhead
element -manifest.json
should be provided by appregistrationType
of valueWEB_PUSH
toregistration
event to align with iOS/Android push.jssubscription
element to registration data to pass full browser push subscription dictplugin.xml:
ServiceWorker.js
andmanifest.json
assets andafter_prepare
hook - should be provided by appAPI.MD, EXAMPLES.md, PAYLOAD.md
Related Issue
#2626, #1399
Motivation and Context
Makes it easier to use WebPush; eliminates obsolete boilerplate and places responsibility for sub/unsub logic in client code (as is already the case for iOS and Android).
How Has This Been Tested?
Runs in Chrome, Firefox, Edge.
Screenshots (if appropriate):
Types of changes
It only breaks existing functionality if anyone is using the current pushServiceURL mechanism.
Checklist: