Skip to content

Instantly share code, notes, and snippets.

@goofmint
Created July 2, 2018 09:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save goofmint/a0344863ad89d174f2ca8cf647c19abe to your computer and use it in GitHub Desktop.
Save goofmint/a0344863ad89d174f2ca8cf647c19abe to your computer and use it in GitHub Desktop.
navigator.serviceWorker.ready
.then(serviceWorkerRegistration => {
return serviceWorkerRegistration.pushManager.subscribe({
userVisibleOnly: true,
applicationServerKey: convertedVapidKey
});
})
.then(subscription => {
// 購読開始
console.log(subscription.toJSON());
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment