Example implementation of web notifications using Service Worker, Push API and PHP.
> git clone https://github.com/maximegelinas/browser-notifications-php-demo.git
> composer install
In the project directory run the following command:
> composer start
Then navigate to http://localhost:8080/.
Please note that a notification may take a few minutes to appear.
If the demo is not working properly in your environment, open the Development Tools console, note the error message and see the section above that corresponds to your error. If there is no section for your error, please open an issue.
- Set
always_populate_raw_post_data
to-1
in in yourphp.ini
. - Restart your web server.
- Download cacert.pem.
- Put it here
<path to PHP>/extras/ssl/cacert.pem
. - Add
curl.cainfo = <path to PHP>/extras/ssl/cacert.pem
after the[curl]
section in yourphp.ini
.
MIT