dreibein / contao-push-bundle
Add Push Notifications to your Contao installation
Installs: 118
Dependents: 1
Suggesters: 0
Security: 0
Stars: 2
Watchers: 4
Forks: 1
Open Issues: 2
Type:contao-bundle
Requires
- php: ^7.4 || ^8.0
- ext-json: *
- contao/core-bundle: ^4.9
- contao/news-bundle: ^4.9
- minishlink/web-push-bundle: ^6.0
Requires (Dev)
- contao/manager-plugin: ^2.0
- friendsofphp/php-cs-fixer: ^2.18
- phpunit/phpunit: ^9.5
Conflicts
- contao/manager-plugin: <2.0 || >=3.0
README
Send Push Notifications with Contao.
This bundle uses the official PHP implementation for Web Push.
Useful links
Usage
- Configure your VAPID keys. Use the link above to see how to generate them with
openssl
. The minimal configuration is:
minishlink_web_push: VAPID: subject: https://yoursite.com publicKey: ~88 chars privateKey: ~44 chars
- Create the front end module and insert it on a page. This is a button to subscribe to push notifications. Nobody wants to allow them on the initial page load :-)
- There will be a new Javascript file in your public directory. This is a file that registers a service worker so you can receive push notifications. It is added automatically with the module.
- Use the button to subscribe.
- In the back end there is a new button in the news list to trigger a notification. It should be the last icon in a row with the green "up" arrow.
In the future we will add more features, e.g. a form to modify the content, custom icons or custom vibration support. Feel free to contribute!