GithubHelp home page GithubHelp logo

franciscosantamaria / web-push-bundle Goto Github PK

View Code? Open in Web Editor NEW

This project forked from minishlink/web-push-bundle

0.0 0.0 0.0 22 KB

Bundle around the WebPush library

License: MIT License

PHP 100.00%

web-push-bundle's Introduction

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)

web-push-bundle's People

Contributors

franciscosantamaria avatar gab3sz avatar genietim avatar juliusstoerrle avatar minishlink avatar stephanvierkant avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.