composer-update-patch
This commit is contained in:
@@ -22,7 +22,7 @@ use Sly\NotificationPusher\PushManager,
|
||||
// First, instantiate the manager.
|
||||
//
|
||||
// Example for production environment:
|
||||
// $pushManager = new PushManager(PushManager::ENVIRONMENT_PRODUCTION);
|
||||
// $pushManager = new PushManager(PushManager::ENVIRONMENT_PROD);
|
||||
//
|
||||
// Development one by default (without argument).
|
||||
$pushManager = new PushManager(PushManager::ENVIRONMENT_DEV);
|
||||
@@ -65,7 +65,7 @@ use Sly\NotificationPusher\PushManager,
|
||||
// First, instantiate the manager.
|
||||
//
|
||||
// Example for production environment:
|
||||
// $pushManager = new PushManager(PushManager::ENVIRONMENT_PRODUCTION);
|
||||
// $pushManager = new PushManager(PushManager::ENVIRONMENT_PROD);
|
||||
//
|
||||
// Development one by default (without argument).
|
||||
$pushManager = new PushManager(PushManager::ENVIRONMENT_DEV);
|
||||
@@ -124,7 +124,7 @@ use Sly\NotificationPusher\PushManager,
|
||||
// First, instantiate the manager.
|
||||
//
|
||||
// Example for production environment:
|
||||
// $pushManager = new PushManager(PushManager::ENVIRONMENT_PRODUCTION);
|
||||
// $pushManager = new PushManager(PushManager::ENVIRONMENT_PROD);
|
||||
//
|
||||
// Development one by default (without argument).
|
||||
$pushManager = new PushManager(PushManager::ENVIRONMENT_DEV);
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
## Create an adapter
|
||||
|
||||
To create your own adapter, just create a class with taking care to extends `\Sly\NotificationPusher\Adapter\BaseAdapter`
|
||||
and implements `\Sly\NotificationPusher\Adapter\AdapterInterface` which contains some required methods:
|
||||
To create your own adapter, just create a class with taking care to extends `\Sly\NotificationPusher\Adapter\BaseAdapter`,
|
||||
which implicitly implements `\Sly\NotificationPusher\Adapter\AdapterInterface` which contains some required methods:
|
||||
|
||||
* `push`: contains the adapter logic to push notifications
|
||||
* `supports`: return the token condition for using the adapter
|
||||
|
||||
@@ -20,10 +20,10 @@ use Sly\NotificationPusher\PushManager,
|
||||
;
|
||||
|
||||
// First, instantiate the manager.
|
||||
//
|
||||
//
|
||||
// Example for production environment:
|
||||
// $pushManager = new PushManager(PushManager::ENVIRONMENT_PRODUCTION);
|
||||
//
|
||||
// $pushManager = new PushManager(PushManager::ENVIRONMENT_PROD);
|
||||
//
|
||||
// Development one by default (without argument).
|
||||
$pushManager = new PushManager(PushManager::ENVIRONMENT_DEV);
|
||||
|
||||
|
||||
@@ -20,22 +20,22 @@ Here is how to translate this with code (just a little not-working example):
|
||||
<?php
|
||||
|
||||
// First, instantiate the manager and declare an adapter.
|
||||
$pushManager = new PushManager();
|
||||
$exampleAdapter = new ApnsAdapter();
|
||||
$pushManager = new Sly\NotificationPusher\PushManager();
|
||||
$exampleAdapter = new Sly\NotificationPusher\Adapter\Apns();
|
||||
|
||||
// Set the device(s) to push the notification to.
|
||||
$devices = new DeviceCollection(array(
|
||||
new Device('Token1'),
|
||||
new Device('Token2'),
|
||||
new Device('Token3'),
|
||||
$devices = new Sly\NotificationPusher\Collection\DeviceCollection(array(
|
||||
new Sly\NotificationPusher\Model\Device('Token1'),
|
||||
new Sly\NotificationPusher\Model\Device('Token2'),
|
||||
new Sly\NotificationPusher\Model\Device('Token3'),
|
||||
// ...
|
||||
));
|
||||
|
||||
// Then, create the push skel.
|
||||
$message = new Message('This is an example.');
|
||||
$message = new Sly\NotificationPusher\Model\Message('This is an example.');
|
||||
|
||||
// Finally, create and add the push to the manager, and push it!
|
||||
$push = new Push($exampleAdapter, $devices, $message);
|
||||
$push = new Sly\NotificationPusher\Model\Push($exampleAdapter, $devices, $message);
|
||||
$pushManager->add($push);
|
||||
$pushManager->push();
|
||||
```
|
||||
@@ -49,7 +49,7 @@ instance constructor second argument:
|
||||
``` php
|
||||
<?php
|
||||
|
||||
$message = new Message('This is an example.', array(
|
||||
$message = new Sly\NotificationPusher\Model\Message('This is an example.', array(
|
||||
'badge' => 1,
|
||||
'sound' => 'example.aiff',
|
||||
// ...
|
||||
@@ -66,13 +66,13 @@ Here is an example of this:
|
||||
``` php
|
||||
<?php
|
||||
|
||||
$message = new Message('This is an example.', array(
|
||||
$message = new Sly\NotificationPusher\Model\Message('This is an example.', array(
|
||||
'badge' => 1,
|
||||
// ...
|
||||
));
|
||||
|
||||
$devices = new DeviceCollection(array(
|
||||
new Device('Token1', array('badge' => 5)),
|
||||
$devices = new Sly\NotificationPusher\Collection\DeviceCollection(array(
|
||||
new Sly\NotificationPusher\Model\Device('Token1', array('badge' => 5)),
|
||||
// ...
|
||||
));
|
||||
```
|
||||
|
||||
@@ -4,13 +4,7 @@
|
||||
|
||||
Use [Composer](http://getcomposer.org) to install this library.
|
||||
|
||||
Into your `composer.json` file, just include this library with adding:
|
||||
|
||||
```
|
||||
"sly/notification-pusher": "2.x"
|
||||
```
|
||||
|
||||
Then, run `composer update sly/notification-pusher` and enjoy.
|
||||
Run `composer require sly/notification-pusher` to install the latest version.
|
||||
|
||||
## Documentation index
|
||||
|
||||
@@ -20,4 +14,3 @@ Then, run `composer update sly/notification-pusher` and enjoy.
|
||||
* [GCM adapter](https://github.com/Ph3nol/NotificationPusher/blob/master/doc/gcm-adapter.md)
|
||||
* [Create an adapter](https://github.com/Ph3nol/NotificationPusher/blob/master/doc/create-an-adapter.md)
|
||||
* [Push from CLI](https://github.com/Ph3nol/NotificationPusher/blob/master/doc/push-from-cli.md)
|
||||
* [Push from CLI](https://github.com/Ph3nol/NotificationPusher/blob/master/doc/push-from-cli.md)
|
||||
|
||||
Reference in New Issue
Block a user