rezzza/processone-bundle

ProcessOne bundle for Symfony2 projects

Installs: 11 527

Dependents: 0

Stars: 4

Watchers: 3

Forks: 2

Language: PHP

1.1.0 2015-02-25 08:46 UTC

README

Build Status

Installation

"require": {
    'rezzza/processone-bundle': '*',
}

Enable Bundle

In AppKernel:

$bundles = array(
    //....
    new Rezzza\ProcessOneBundle\RezzzaProcessOneBundle(),
    //....
);

Configuration

rezzza_process_one:
    connections:
        default:
            transport:  guzzle
            host:       https://subdomain.process-one.net
            publish:
                key:    MY_KEY
                secret: MY_SECRET
                expire: 10

Usage

use Rezzza\ProcessOneBundle\Recipient;
use Rezzza\ProcessOneBundle\Message;

$conn = $this->get('rezzza.process_one.default.connection');

// recipients
$recipients = new Recipient\TagRecipient(array('@registered'));
$recipients = new Recipient\AliasRecipient(array('user@domain.tld'));
$recipients = new Recipient\DeviceTokenRecipient(array('device-token'));


// message

$message = new Message\ApsMessage();
$message->setApsData('alert', '..');
$message->setApsData('badge', 1337);
$message->setData('custom_element', 'value');

$conn->setRecipient($recipients)
     ->setMessage($message)
     ->send();

Customisation

You can easily add new messages, recipients, transport

Wishlist

  • Tests
  • Standalone library