Git Product home page Git Product logo

webpush-bundle's Introduction

Webpush Bundle

This bundle leverages minishlink/web-push library to associate your Symfony users with Webpush subscriptions.

This way you can integrate push messages into your app to send notifications.

We assume you have a minimum knowledge of how Push Notifications work, otherwise we highly recommend you to read Matt Gaunt's Web Push Book.

Use cases

  • You have a todolist app - notify users they're assigned a task
  • You have an eCommerce app:
    • Notify your customer their order has been shipped
    • Notify your category manager they sell a product

Summary

  1. Installation
  2. The UserSubscription entity
  3. The UserSubscription manager
  4. Configure the bundle
  5. Enjoy!
  6. F.A.Q.

Getting started

Because there can be different User implementations, and that some front-end is implied, there are several steps to follow to get started:

  1. Install the bundle and its assets
  2. Create your own UserSubscription class and its associated manager
  3. Update your config.yml and routing.yml
  4. Insert a JS snippet in your twig views.

Let's go!


Composer is your friend:

PHP7.1+ is required.

composer require bentools/webpush-bundle 0.3.*

We aren't on stable version yet - expect some changes.

Add the bundle to your kernel:

# app/AppKernel.php

class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = [
            // ...
            new BenTools\WebPushBundle\WebPushBundle(),
        ];

        return $bundles;
    }
}

Install assets:

php bin/console assets:install --symlink

We provide a service worker and a JS client.

Generate your VAPID keys:

php bin/console webpush:generate:keys

Next: Create your UserSubscription class

Tests

We mostly need functionnal tests. Contributions are very welcome!

License

MIT

webpush-bundle's People

Contributors

adriwankenoby avatar bpolaszek avatar wrlss avatar

Watchers

 avatar  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.