|Last Updated|| ||Ratings|| ||Unique User Downloads|| ||Download Rankings|
|2020-05-05 (2 months ago) ||Not enough user ratings||Total: 406 This week: 3||All time: 6,408 This week: 71|
This package can queue and push notifications to Web users.
It can register the interest of users to receive notifications from the server by creating user subscriptions.
The package provides means to queue notification messages to be sent to users of an application by storing them in a database.
The package can also automatically delete expired messages and no longer valid subscriptions.
|Web based push notifications are useful to let users of a site know about anything new that happens on a site that may be of the interest of those users.
This package provides a complete solution to register users interested to subscribe to get notifications from a site, queue notifications to be pushed to the users when they come to the site, and even perform maintenance on the notifications and subscriptions created by the users.
PNServer - Web Push Notifications for your Homepage
With this package, web push notifications can be created, encrypted and sent via HTTP request. The subscriptions can be saved and managed. Optionally, the package automatically deletes expired or no longer valid subscriptions.
there are no dependencies to other external libraries!
PHP >= 7.1 is required to be able to generate the necessary encryption keys - The curve_name configarg was added to openssl_pkey_new() in this version to make it possible to create EC keys!
required PHP Libraries
- cURL (curl)
- Multibyte String (mbstring)
- OpenSSL (openssl)
- GNU Multiple Precision (gmp)
- BC Math (bcmath)
You can download the Latest release version from PHPClasses.org
required adaptions for your own project (in PNServiceworker.js):
// VAPID appPublic key
const strAppPublicKey = 'create your own VAPID key pair and insert public key here';
// URL to save subscription on server via Fetch API
const strSubscriberURL = 'https://www.your-domain.org/PNSubscriber.php';
// default Notification Title if not pushed by server
const strDefTitle = 'Your company or product';
// default Notification Icon if not pushed by server
const strDefIcon = './elephpant.png';
you can generate your own VAPID key on https://tools.reactpwa.com/vapid.
A tutorial describing the individual steps for using the package is available at PHPclasses.org.
PnTestClient.html shows a simple Page to subscribe the push notifications.
PNTestServer.php demonstrates, how the Notification Server can be implemented:
insert your own VAPID key at following lines:
// set the VAPID key
$oVapid = new PNVapid(
"insert your own VAPID public-key here",
"insert your own VAPID private-key here"
||Applications that use this package
No pages of applications that use this class were specified.
If you know an application of this package, send a message to the author to add a link here.