fabiorf/ionic-push-php

ionic 推送通知 PHP SDK v2

0.2.0 2016-05-18 14:40 UTC

This package is auto-updated.

Last update: 2024-09-10 09:49:05 UTC


README

此包可能有助于发送ionic推送通知,基于v2 ionic.io的分支版本 https://github.com/dmitrovskiy/ionic-push-php

安装

通过 Composer

$ composer require fabiorf/ionic-push-php

使用方法

新特性 -- v2 ionic.io 推送

$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!"
    }
  }
}

许可证

MIT 许可证 (MIT)。请参阅 许可证文件 以获取更多信息。