Skip to content

Latest commit

 

History

History
31 lines (23 loc) · 971 Bytes

03 - Configuration.md

File metadata and controls

31 lines (23 loc) · 971 Bytes

Configuration

Configure the bundle:

# app/config/config.yml (SF3)
# config/packages/bentools_webpush.yaml (SF4) 
bentools_webpush:
    settings:
        public_key: 'your_public_key'
        private_key: 'your_private_key'

Update your router:

# app/config/routing.yml (SF3)
# config/routing.yaml (SF4)
bentools_webpush:
    resource: '@WebPushBundle/Resources/config/routing.xml'
    prefix: /webpush

You will have a new route called bentools_webpush which will be the Ajax endpoint for handling subscriptions (POST requests) / unsubscriptions (DELETE requests).

Your VAPID public key is now exposed through Twig's bentools_webpush.server_key global variable.

To handle subscriptions/unsubscriptions on the front-end side, have a look at webpush-client.

Previous: The UserSubscription Manager

Next: Usage