albaraam/php-gcm
Composer 安装命令:
composer require albaraam/php-gcm
包简介
A PHP library for sending messages to devices registered through Google Cloud Messaging
README 文档
README
A PHP library for sending messages to devices registered through Google Cloud Messaging.
Installation
The preferred way to install this extension is through composer.
Either run
composer require albaraam/php-gcm "~1.0.0"
or add
"albaraam/php-gcm": "~1.0.0"
to the require section of your composer.json.
Usage
use albaraam\gcm\GCMNotification; use albaraam\gcm\GCMMessage; use albaraam\gcm\GCMClient; $notification = new GCMNotification("Title","Body"); $notification ->setIcon("noti") ->setSound("water.mp3"); ..... $message = new GCMMessage($notification, "ids"); // "ids" parameter can contain a array/single registration token or a topic key $message ->setData(['foo'=>'bar', 'baz'=>[1,2,3]]) ->setCollapseKey("collapse-key-1"); ..... $gcm = new GCMClient("YOUR_API_KEY"); $response = $gcm->send($message); var_dump($response);
统计信息
- 总下载量: 3.72k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-12-02