web-push-php-example | sending Web Push notifications , using web | Notification library

 by   Minishlink JavaScript Version: v3.0.0 License: MIT

kandi X-RAY | web-push-php-example Summary

kandi X-RAY | web-push-php-example Summary

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

An example for sending Web Push notifications, using web-push-php
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              web-push-php-example has a low active ecosystem.
              It has 226 star(s) with 83 fork(s). There are 13 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 3 open issues and 23 have been closed. On average issues are closed in 55 days. There are 2 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of web-push-php-example is v3.0.0

            kandi-Quality Quality

              web-push-php-example has 0 bugs and 0 code smells.

            kandi-Security Security

              web-push-php-example has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              web-push-php-example code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              web-push-php-example 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-php-example releases are available to install and integrate.
              Installation instructions, examples and code snippets are available.
              web-push-php-example saves you 28 person hours of effort in developing the same functionality from scratch.
              It has 76 lines of code, 0 functions and 6 files.
              It has low code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed web-push-php-example and discovered the below as its top functions. This is intended to give you an instant insight into web-push-php-example implemented functionality, and help decide if they suit your requirements.
            • Subscribe to the user
            • Unsubscribe from the server
            • Change the current push button state
            • Checks the notification for notification permissions .
            • Updates the subscription to the server
            • Send a subscription to the server .
            • Convert a UInt8Array to a Uint8Array .
            Get all kandi verified functions for this library.

            web-push-php-example Key Features

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

            web-push-php-example Examples and Code Snippets

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

            Community Discussions

            QUESTION

            POST https://kayaindia.in/kaya/sendNotificationB.php 500 (Internal Server Error)
            Asked 2019-Jul-16 at 08:00

            I an creating a PWA app and its working fine, but when I tried to upload on server I stuck on error. On windows local server, everything is fine even notifications, and I dont know much putty/linux commands.

            check here my phpinfo file.

            I am tring to upload to amazon ec2 server. I installed apache, php, ssl and other required things. And its working file except notifications.

            When I call my notification file, I got 503 response. I installed composer, installed everything. I used this github library.

            As I understand, I stuck on gmp extension, When I open phpinfo() I didnt see gmp over there. I installed gmp using sudo yum install php-gmp and also I see a file in php.d named as 20-gmp.ini and it included extension=gmp. Also restarted apache server using sudo apachectl stop, sudo apachectl start.

            But still I am getting error. And I coudnt see gmp in phpinfo().

            notificationb.php

            ...

            ANSWER

            Answered 2019-Apr-27 at 09:38

            I know I am commenting my own question, As I was searching this answer for 3-4 days I think I should share this info with everyone.

            The issue is, In linux, PHP have different-different configuration files. The main configuration file is php.ini. And it include other extensions after loading this file and override mail file. These additional configuration are located in /etc/php.d/ (in my case, which is common for mostly).

            So just restarting apache server in not enough. We need to also restart php-fpm.

            To restart php-fpm: sudo service php-fpm restart And then restart apache: sudo apachectn restart

            You can check more here

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

            QUESTION

            Web-Push notification script working on Firefox but not on Chrome
            Asked 2018-Dec-29 at 07:53

            I am building a web push notification system and I am using the concept used in this example:

            https://github.com/Minishlink/web-push-php-example

            I have the following code in my JS file. It checks for API support, checks if notifications are not disabled, registers the service worker, asks for permission to display notifications, if allowed subscribes the user and sends the details to the server. If the user is already subscribed, it updates the endpoint value in the DB.

            When I run this on Firefox 61, it works fine, but when I run it on Chrome 67 I get this error:

            ...

            ANSWER

            Answered 2018-Jul-13 at 09:08
                    if(subscription){
            const key = subscription.getKey('p256dh');
                        const token = subscription.getKey('auth');
                        const contentEncoding = (PushManager.supportedContentEncodings || ['aesgcm'])[0];
            
                        return fetch('/scripts/notification-subscribe.php', {
                            method: 'POST',
                            body: JSON.stringify({
                                endpoint: subscription.endpoint,
                                publicKey: key ? btoa(String.fromCharCode.apply(null, new Uint8Array(key))) : null,
                                authToken: token ? btoa(String.fromCharCode.apply(null, new Uint8Array(token))) : null,
                                contentEncoding,
                                user: 1,
                            }),
                        }).then(() => subscription);
                    }
            }
            
            Just modify this function hope pushSubscription with if block it works
            

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

            QUESTION

            Web Push php libriary : Throws internal error
            Asked 2018-Sep-21 at 12:25

            I used the web push library to send push notifications https://github.com/web-push-libs/web-push-php

            I getting an internal error while trying to sen push notification

            I checked in both PHP version:7.1.22,7.2.9-1
            Apache error log throws :

            [:error][client ::1:33302] PHP Parse error: syntax error, unexpected '?', expecting variable (T_VARIABLE) in /PWA/web-push-php-example/vendor/minishlink/web-push/src/Subscription.php on line 41, referer: http://localhost/PWA/web-push-php-example/src/

            And i also tried in Ngnix / error log :

            17:22:36 [error] 20232#20232: *46 FastCGI sent in stderr: "PHP message: PHP Notice: Undefined index: endpoint in /var/www/html/PWA/web-push-php-example/vendor/minishlink/web-push/src/Subscription.php on line 69 PHP message: PHP Fatal error: Uncaught TypeError: Argument 1 passed to Minishlink\WebPush\Subscription::__construct() must be of the type string, null given, called in /var/www/html/PWA/web-push-php-example/vendor/minishlink/web-push/src/Subscription.php on line 72 and defined in /var/www/html/PWA/web-push-php-example/vendor/minishlink/web-push/src/Subscription.php:39 Stack trace: thrown in /var/www/html/PWA/web-push-php-example/vendor/minishlink/web-push/src/Subscription.php on line 39" while reading response header from upstream, client: 127.0.0.1, server: local.pwa.com, request: "POST /PWA/web-push-php-example/src/send_push_notification.php HTTP/2.0", upstream: "fastcgi://unix:/run/php/php7.2-fpm.sock:", host: "localhost", referrer: "https://localhost/PWA/web-push-php-example/src/"

            PHP code :

            ...

            ANSWER

            Answered 2018-Sep-21 at 11:13

            Are you absolutely sure you are actually running PHP 7.21 or 7.2? The problem is the question marks in the constructor here:

            https://github.com/web-push-libs/web-push-php/blob/master/src/Subscription.php#L41-L43

            As you can see from this 3v4l code, it works on all versions over 7.1:

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

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

            Vulnerabilities

            No vulnerabilities reported

            Install web-push-php-example

            You can change the VAPID keys in the keys folder with this guide. Don't forget to update the public key in app.js too.

            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/Minishlink/web-push-php-example.git

          • CLI

            gh repo clone Minishlink/web-push-php-example

          • sshUrl

            git@github.com:Minishlink/web-push-php-example.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 Minishlink

            pwa-qr-code-scanner

            by MinishlinkJavaScript

            web-push-bundle

            by MinishlinkPHP

            DailyScrum

            by MinishlinkJavaScript

            physbook

            by MinishlinkPHP

            TrelloScrumPoints

            by MinishlinkJavaScript