Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notifications - handle Turn On action #351

Merged
merged 1 commit into from
Sep 5, 2023
Merged

Notifications - handle Turn On action #351

merged 1 commit into from
Sep 5, 2023

Conversation

marcinbodnar
Copy link
Contributor

This is the full implementation of the process of enabling push notifications:

  • isNotificationSupported, isPushManagerSupported, isPermisionGranted will help manage the UI, and prevent redundant requests
  • handleRequestPermission - first thing that needs to be done is request permission from the user
  • registerServiceWorker - next we are registering service worker
  • handlePushManagerSubscribe - next we wait for the service worker to be ready and subscribe user - this gives us subscription object
  • sendToPushServer - sending subscription abject and accountId to push server.

@vercel
Copy link

vercel bot commented Aug 29, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
near-discovery ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 29, 2023 9:06pm
near-discovery-testnet ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 29, 2023 9:06pm

@shelegdmitriy
Copy link
Contributor

@marcinbodnar public/service-worker.js - empty, is this OK?

@marcinbodnar
Copy link
Contributor Author

@marcinbodnar public/service-worker.js - empty, is this OK?

@shelegdmitriy yes, at this stage, the service worker is only registered

@marcinbodnar marcinbodnar merged commit b0b537b into develop Sep 5, 2023
3 checks passed
@marcinbodnar marcinbodnar deleted the DEC-1440 branch September 5, 2023 14:35
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.

3 participants