Skip to content

Instantly share code, notes, and snippets.


kypflug/sw-10.js Secret

Created Dec 15, 2017
What would you like to do?
function registerPush(appPubkey) {
if (navigator.serviceWorker) {
.then(function(reg) {
return reg.pushManager.getSubscription().then(function(subscription) {
if (subscription) {
return subscription;
return registration.pushManager.subscribe({
userVisibleOnly: true, applicationServerKey: appPubkey

This comment has been minimized.

Copy link

@Silic0nS0ldier Silic0nS0ldier commented Jan 12, 2018

Line 10, registration is meant to be reg right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment