GitXplorerGitXplorer
M

web-push-bundle

public
45 stars
10 forks
2 issues

Commits

List of commits on branch master.
Verified
6c97336f4fd189e29900cd7d40be55dae9b73c17

Add return type declaration of load method (#30)

ffranciscosantamaria committed 13 days ago
Verified
dbb27a24de3a04363e85ba8d13d61dd5abe4424f

Add new alias to 'minishlink_web_push' service to be used with autowiring (#29)

ffranciscosantamaria committed 13 days ago
Verified
299871aae0d229ecd619059ce83270fb9cad0af9

Allow web-push v8 (#26)

sstephanvierkant committed 8 months ago
Verified
5febbf00ad4d06c06ba924af6cc193050efaafb8

Add return type to getConfigTreeBuilder method (#27)

ffranciscosantamaria committed a year ago
Verified
686cbe73f43ecdf1b1b006f68598710e17b062f6

Allow web-push 7.0 (#24)

sstephanvierkant committed 3 years ago
Verified
b5aa38436050b18db9ef0881b990de9f661961cb

Support PHP 8 (#22)

sstephanvierkant committed 4 years ago

README

The README file for this repository.

MinishlinkWebPushBundle

This bundle provides a simple integration of the WebPush library.

SensioLabsInsight

Usage

Web Push sends notifications to endpoints which server delivers web push notifications as described in the Web Push API specification.

<?php
/** @var \Minishlink\WebPush\WebPush */
$webPush = $this->container->get('minishlink_web_push');

The bundle provides a new minishlink_web_push service that returns an instance of Minishlink\WebPush\WebPush.

For more info on what you can do with $webPush, check Minishlink/web-push.

Installation

  1. composer require minishlink/web-push-bundle
  2. Enable the bundle in your app/AppKernel.php.
<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Minishlink\Bundle\WebPushBundle\MinishlinkWebPushBundle(),
        // ...
    );
}

Configuration

Here is the default configuration, you may change it in your app/config/config.yml.

minishlink_web_push:
  VAPID:
    subject: https://yoursite.com # can be an URL or a mailto:
    publicKey: ~88 chars          # uncompressed public key P-256 encoded in Base64-URL
    privateKey: ~44 chars         # the secret multiplier of the private key encoded in Base64-URL
    pemFile: path/to/pem          # if you have a PEM file and can link to it on your filesystem
    pem: pemFileContent           # if you have a PEM file and want to hardcode its content
  ttl: 2419200                    # Time to Live of notifications in seconds
  urgency: ~                      # can be very-low / low / normal / high
  topic: ~                        # default identifier for your notifications
  timeout: 30                     # Timeout of each request in seconds
  automatic_padding: true         # pad messages automatically for better security (against more bandwith usage)