Skip to content

fix: subscribe push sample on activation#1698

Open
KirtiRamchandani wants to merge 1 commit into
GoogleChrome:mainfrom
KirtiRamchandani:fix/push-auto-subscribe
Open

fix: subscribe push sample on activation#1698
KirtiRamchandani wants to merge 1 commit into
GoogleChrome:mainfrom
KirtiRamchandani:fix/push-auto-subscribe

Conversation

@KirtiRamchandani

Copy link
Copy Markdown

Fixes #1408

Summary

  • Subscribe the cookbook.push service worker during activate so the sample covers non-interactive registration.
  • Make subscribeUserVisibleOnlyFalse() safe to rerun by logging an existing subscription instead of trying to create a duplicate.
  • Update the README flow so DevTools is used to copy or reprint the subscription data, not to create the first subscription manually.

Tests

  • npx prettier functional-samples/cookbook.push/README.md functional-samples/cookbook.push/manifest.json --check
  • npx eslint functional-samples/cookbook.push/background.js
  • git diff --check
  • node -e "JSON.parse(require(''fs'').readFileSync(''functional-samples/cookbook.push/manifest.json'',''utf8'')); console.log(''manifest ok'')"

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Complete web push example with non-interactive subscription

1 participant