web-push-notification | Progressive web app PWA , Firebase Cloud Messaging FCM | Notification library

 by   anuraggautam77 JavaScript Version: Current License: MIT

kandi X-RAY | web-push-notification Summary

kandi X-RAY | web-push-notification Summary

web-push-notification is a JavaScript library typically used in Messaging, Notification, Firebase applications. web-push-notification has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can download it from GitHub.

web-push-notification , Progressive web app PWA , Firebase Cloud Messaging FCM
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              web-push-notification has a low active ecosystem.
              It has 4 star(s) with 1 fork(s). There are 1 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 0 open issues and 2 have been closed. On average issues are closed in 1038 days. There are 75 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of web-push-notification is current.

            kandi-Quality Quality

              web-push-notification has no bugs reported.

            kandi-Security Security

              web-push-notification has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              web-push-notification is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              web-push-notification releases are not available. You will need to build from source code and install.
              Installation instructions are not available. Examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of web-push-notification
            Get all kandi verified functions for this library.

            web-push-notification Key Features

            No Key Features are available at this moment for web-push-notification.

            web-push-notification Examples and Code Snippets

            No Code Snippets are available at this moment for web-push-notification.

            Community Discussions

            QUESTION

            Is it safe to use the "p256dh" or "endpoint" keys values of the push notification subscription object as an identifier within the back-end?
            Asked 2020-Sep-06 at 21:46

            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:46

            You 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.

            Source https://stackoverflow.com/questions/63767889

            QUESTION

            How to get VAPID_PUBLIC_KEY and VAPID_PRIVATE_KEY for django webpush implementation?
            Asked 2020-Jul-13 at 09:16

            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:16

            The 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:

            Source https://stackoverflow.com/questions/62861030

            QUESTION

            Save a user's pushSubscription info in Rails database?
            Asked 2020-Jan-10 at 07:52

            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:43

            If 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

            Source https://stackoverflow.com/questions/59655877

            QUESTION

            How to solve CORS issue for Google Cloud CDN & Compute Engine
            Asked 2019-May-13 at 21:47

            I have created a Compute Engine - VM and have several websites installed. Also, I have created Network services - Load balancing - Backend configuration: Created Backend services and join the instance group with the same VM above. - Created Cloud CDN and config SSL certificate also done.

            The website is https://united-athle.hk/ The CDN domain is https://cdn.ua.sugarproject.com

            When I visit the website, the following CORS issue occurred Access to resource at 'https://cdn.ua.sugarproject.com/wp-content/plugins/onesignal-free-web-push-notifications/sdk_files/manifest.json.php?gcm_sender_id=' from origin 'https://united-athle.hk' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

            I have read Cross-origin resource sharing (CORS), https://cloud.google.com/storage/docs/cross-origin but not really sure how-to config. My storage is in VM engine.

            Does anyone have an idea?

            ...

            ANSWER

            Answered 2019-May-13 at 21:47

            One option is to configure the web server software running on your VM to include an Access-Control-Allow-Origin header in its responses. For example, including an Access-Control-Allow-Origin: https://united-athle.hk/ header would allow cross-origin requests from https://united-athle.hk/. https://enable-cors.org/server.html has information on how to do this for a variety of web server software.

            Alternatively, you could serve both portions of your website from a single domain name, eliminating the need for cross-origin requests.

            Source https://stackoverflow.com/questions/56096374

            QUESTION

            http-server net serving the fresh js file
            Asked 2019-Apr-15 at 23:58

            I haven't used http-server npm module before!

            i was just getting starting with using service worker by creating an example app using this blog as a source

            In this the author have used http-server to demonstrate service worker!

            From the blog, I copied the code snippet to check if chrome is supported

            ...

            ANSWER

            Answered 2019-Apr-15 at 23:58

            Looks like http-server tells the browser to cache pages for an hour by default:

            -c Set cache time (in seconds) for cache-control max-age header, e.g. -c10 for 10 seconds (defaults to '3600'). To disable caching, use -c-1.

            Restart the server with http-server -c-1, then do a hard refresh in the browser (Ctrl/Cmd+Shift+R in Firefox or Chrome).

            Source https://stackoverflow.com/questions/55698628

            QUESTION

            How to make your own push notification service for your website
            Asked 2018-Aug-18 at 00:46

            I am working on a website, where I want to make a feature of notifications, when a user visits my website, they are asked for notifications permission and when they allow it, they will get notifications from my website, and whatever product I want them to get notified by.

            Like for example when I visit some websites, they ask me for notifications permissions and when I allow the, I get notified through notifications then. That's all I want for now.

            How can I achieve this functionality, I have follow this tutorial, but still confused how the users who allowed the notifications get detected and how all of them are notified then ?

            ...

            ANSWER

            Answered 2018-Aug-18 at 00:46

            Web Push library for node.js is just a sender.

            You should obtain a subscription JSON object from the browser using Notification API and Service Worker API and then send it to your server, where put it in the database of your choise.

            When you will need broadcast notifications, you can retrieve subscription and use a web-push library (for php is also available :)

            Note that is a right flow looks following as: 1) Retrieve subscription from the browser 2) Send and store it on your web-server 3) Create notification prototype (just object) 4) Broadcast notification prototype ID you have created to the users 5) Service Worker receive one and fetch notification prototype from your server by ID 6) Show notification using browser API in service worker

            For more see here links

            https://developers.google.com/web/fundamentals/codelabs/push-notifications/ https://developers.google.com/web/ilt/pwa/introduction-to-push-notifications/

            Source https://stackoverflow.com/questions/51463287

            QUESTION

            Identify web push notification device from endpoint url
            Asked 2018-Jun-28 at 11:02

            Is there a way to identify the browser based on web-push-notification endpoint url?

            I would like to add a list of endpoints to the user settings page, so he could see what devices are connected and remove the ones that he does not need, but all I have is the endpoint (and auth data) in format like this one:

            https://fcm.googleapis.com/fcm/send/fIoxgVbEb3Q:APA91bHN_ryToq_Oe6QQa-pO__uKoLjv2LJSI_8YxvqSN2j8UUHUxH8wTnOOHJdBq252baM3bkIXqRBp529GctrxLqF_A_K9R-5pnIL0jFw6f4p7yQq_Lp2AbNyPRyidU3JHwdmuI11p

            I would like to convert it to something like:

            • Chrome on Samsung Galaxy 8
            • Firefox on Windows 7
            • Internet Explorer on IPhone 6

            Is there any way I could do it, or do I need to collect this data in advance? I know I can get the browser form domain, but is there any list that contains all of the possibilities?

            ...

            ANSWER

            Answered 2018-Jun-19 at 11:58

            I think there's no way to do this without collecting information in advance.

            The domain will be the same for the same browser on different platforms.

            Source https://stackoverflow.com/questions/50854163

            QUESTION

            Problems with OneSignal wordpress plugin after moving website to https
            Asked 2017-Sep-21 at 08:20

            I moved a website to Https and got a problem with OneSignal push notification. I read the documentation of OneSignal but it doesn't help me. The website based on Wordpress and use OneSignal plugin. I received next error in Google dev tools:

            Uncaught (in promise) DOMException: Failed to register a ServiceWorker: The path of the provided scope ('/') is not under the max scope allowed ('/wp-content/plugins/onesignal-free-web-push-notifications/sdk_files/'). Adjust the scope, move the Service Worker script, or use the Service-Worker-Allowed HTTP header to allow the scope.

            Does anyone have any ideas what the problem with it?

            ...

            ANSWER

            Answered 2017-Sep-21 at 08:20

            I looked to a lot of information and resources and found a problem. I use Incapsula as caching tool. This service blocked "Service-Worker-Allowed" header and that's why I got an error.

            Source https://stackoverflow.com/questions/46295335

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install web-push-notification

            You can download it from GitHub.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/anuraggautam77/web-push-notification.git

          • CLI

            gh repo clone anuraggautam77/web-push-notification

          • sshUrl

            git@github.com:anuraggautam77/web-push-notification.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Notification Libraries

            push.js

            by Nickersoft

            server

            by gotify

            fsnotify

            by fsnotify

            noty

            by needim

            gorush

            by appleboy

            Try Top Libraries by anuraggautam77

            MERN-socketio-chat-example

            by anuraggautam77JavaScript

            pwa-neo4j

            by anuraggautam77JavaScript

            git-repo-issue

            by anuraggautam77JavaScript

            myshop_graphql_reactjs

            by anuraggautam77JavaScript

            webpack4-demo

            by anuraggautam77JavaScript