web-push-notification | Realtime Web push notification using Socket.IO | Websocket library
kandi X-RAY | web-push-notification Summary
kandi X-RAY | web-push-notification Summary
Web push notification using Socket.IO and RabbiMQ.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Notification function
- publish a new notification message to another
- dispose ready event handler
- Imports the given context into a JavaScript object .
- Opens a transport .
- Constructs a new Request object .
- Clear the empty
- Get browser storage .
- Initialize if iframe .
- Find a module .
web-push-notification Key Features
web-push-notification Examples and Code Snippets
Community Discussions
Trending Discussions on web-push-notification
QUESTION
When a user create a subscription through the PushManager.subscribe(), given the applicationServerKey
(VAPID public key), it creates a valid subscription the contents of which can be sent and stored in the database. The content sent to the database looks something like the following:
ANSWER
Answered 2020-Sep-06 at 21:46You can safely use the endpoint
as a unique identifier in your database and in the frontend calls to the backend.
We have been using it in the Pushpad Javascript SDK since 2015 without any problem.
For example, you can use the endpoint as an identifier when you make a call from Javascript to the backend in order to store data for that specific subscription.
An endpoint can be considered unique and secret (since it contains a long random token).
This is true now and it was also true at the beginning of the standard... in the past the keys
and payload were not even present and the endpoint
alone was used for everything, including fetching the new notifications from the application server.
For the keys
I would simply keep them secret in the database and not use them as identifiers.
QUESTION
I want to implement web push notification in django project where frontend is implemented using react. I was following https://www.digitalocean.com/community/tutorials/how-to-send-web-push-notifications-from-django-applications this documentation but i didn't find the way to get VAPID_PUBLIC_KEY and VAPID_PRIVATE_KEY for WEBPUSH_SETTINGS. What is the way to get that?
...ANSWER
Answered 2020-Jul-13 at 09:16The DigitalOcean tutorial that you referred to instructs you to "navigate to the web-push-codelab web application. Here, you’ll be given automatically generated keys. Copy the private and public keys." However, it seems like this web page is no longer available.
Another way to generate a VAPID key pair is to use the web-push reference implementation. First install the web-push npm package using npm install web-push -g
, then run web-push generate-vapid-keys
to get an output like:
QUESTION
I have followed this tutorial: https://dzone.com/articles/how-to-add-real-web-push-notifications-to-your-web to enable push notifications on my rails app. I am using the webpush gem to send the notifications.
So far, all I have managed to do is get the browser to ask for permission to send notifications, and when I try to call the method send_web_push_notification (shown below) line 2 is throwing up an error.
I think it is because I am not saving the user's pushSubscription info to the database, but I don't know how to do this. In the tutorial, there is this line at the end: 'We use a database JSON field called web_push_subscription to save the pushSubscription info on our users.'
Would someone be able to show me how to do this?
Any help would be appreciated. Thanks.
send_web_push_notification method:
...ANSWER
Answered 2020-Jan-09 at 02:43If you look closely codes you will notice that you have to create a Json field in database to save subscription. If there is subscription available than push notification will be sent. Actually there many more scenarios it is not necessary the you want to save one browser for user notification, if you plan multiple browser than you have to create separate table, but if you want to add one browser for push notification, than you can add this information in user table too. Create new migration to update your user table and add following column
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install web-push-notification
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page