GitXplorerGitXplorer
M

web-push-bundle

public
45 stars
10 forks
2 issues

Commits

List of commits on branch master.
Verified
7f50c8af4a6b91358826f9810417e64966fd6711

Fix #19 (#20)

sstephanvierkant committed 4 years ago
Unverified
e6d2dd8496d2f41e1e86f4e299f50eb5dad788f2

Upgrade web-push-php to v6

MMinishlink committed 4 years ago
Unverified
6277d97a626495ff6da5df22cccc81da64938cee

Raise version of minishlink/web-push to ^5.0 (#16)

jjuliusstoerrle committed 5 years ago
Unverified
c6018b4f037785ed5f54358a2289cd6b4912f92c

Make bundle compatible with Symfony 5 (#14)

jjuliusstoerrle committed 5 years ago
Unverified
0c3b1fe4156dee7491bc75cdfbbe25c1fd74c0a6

upgrade dependencies and add first test

GGenieTim committed 7 years ago
Unverified
66cadccdc830ca8ec4e7ae6761ec35f913222324

Upgrade web-push-php to 2.0

MMinishlink committed 7 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)