fabiorf / ionic-push-php
ionic push notifications php sdk v2
0.2.0
2016-05-18 14:40 UTC
Requires
- php: >=5.3.0
- guzzlehttp/guzzle: 6.0.*
Requires (Dev)
- phpunit/phpunit: 4.*
This package is auto-updated.
Last update: 2024-09-10 09:49:05 UTC
README
This package may be helpful for sending ionic push notifications, the fork version v2 ionic.io the https://github.com/dmitrovskiy/ionic-push-php
Install
Via Composer
$ composer require fabiorf/ionic-push-php
Usage
New feature -- v2 ionic.io push
$pusher = new Dmitrovskiy\IonicPush\PushProcessor(
'APP_ID',
'API_TOKEN',
'API_PROFILE'
);
$devices = array(
//...
);
$notification = [
'message'=>"Hello world!",
'title'=>'Hi',
'android'=>['message'=>"Hello world!",
'title'=>'Hi']
];
$pusher->notify($devices, $notification);
JSON Exemple
{
"tokens": ["DEV-49e60667-a91f-40ee-b3b0-e11d8bc55384"],
## "profile": "fake_push_profile",
"notification": {
"title": "Hi",
## "message": "Hello world!",
"android": {
"title": "Hey",
"message": "Hello Android!"
}
}
}
License
The MIT License (MIT). Please see License File for more information.