2017 © Pedro Peláez
 

symfony-bundle push-bundle

Symfony Bundle for cmnty/push

image

cmnty/push-bundle

Symfony Bundle for cmnty/push

  • Thursday, January 12, 2017
  • by peternijssen
  • Repository
  • 6 Watchers
  • 1 Stars
  • 8,287 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 3 Versions
  • 3 % Grown

The README.md

CmntyPushBundle

Latest Version on Packagist ![Software License][ico-license] Total Downloads, (*1)

Symfony Bundle for cmnty/push., (*2)

Instalation

Require the bundle with composer:, (*3)

composer require cmnty/push-bundle

Register the bundle in app/AppKernel.php:, (*4)

public function registerBundles()
{
    $bundles = [
        // ...
        new Cmnty\PushBundle\CmntyPushBundle(),
        // ...
    ];

    return $bundles;
}

Configuration

cmnty_push:
    push_services:
        google:
            enabled: true # Default false, automatically true when api_key is supplied.
            api_key: "%gcm_sender_id%" # Required value.
        mozilla:
            enabled: true # Default true

If you plan on storing the push subscriptions using doctrine, you can use the provided mappings by this bundle., (*5)

# Doctrine Configuration
doctrine:
    dbal:
        types:
            binary_string: Cmnty\PushBundle\Doctrine\Type\BinaryStringType
    orm:
        mappings:
            PushSubscription:
                type: xml
                prefix: Cmnty\Push
                dir: "%kernel.root_dir%/../vendor/cmnty/push-bundle/src/Resources/config/embeddable"
                is_bundle: false

Usage

<?php

use Cmnty\Push\Crypto\AuthenticationSecret;
use Cmnty\Push\Crypto\PublicKey;
use Cmnty\Push\EndPoint;
use Cmnty\Push\Notification;
use Cmnty\Push\Subscription;

$notification = new Notification('Hello', 'Symfony!');
$subscription = new Subscription(
    new Endpoint('...'),
    new PublicKey::createFromBase64UrlEncodedString('...'),
    new AuthenticationSecret::createFromBase64UrlEncodedString('...')
);

$client = $this->get('cmnty_push.client');
$client->pushNotification($notification, $subscription);

Credits

License

The MIT License (MIT). Please see License File for more information., (*6)

The Versions

12/01 2017

dev-master

9999999-dev

Symfony Bundle for cmnty/push

  Sources   Download

MIT

The Requires

 

The Development Requires

push notifications push notifications push messages push api web push web push api

07/09 2016

0.0.2

0.0.2.0

Symfony Bundle for cmnty/push

  Sources   Download

MIT

The Requires

 

07/09 2016

0.0.1

0.0.1.0

Symfony Bundle for cmnty/push

  Sources   Download

MIT

The Requires