mxp100/pusher
最新稳定版本:2.1
Composer 安装命令:
composer require mxp100/pusher
包简介
PHP push notifications to APNS, FCM
关键字:
README 文档
README
Compatable: PHP 7+
Installation
Composer
composer require mxp100/pusher
APNS certicates generate
Please see Wiki: https://github.com/mxp100/Pusher/wiki/Generating-the-Apple-Push-Notification-SSL-certificate-on-Mac
Examples
Example for FCM:
$serverKey = '[server key]'; $deviceId = '[device token]'; $devices = new DeviceCollection([new Device($deviceId)]); $message = new Message('This is a test message'); $adapter = new Fcm($serverKey); $pusher = new Pusher([new Push($adapter, $devices, $message)]); $pusher->push();
Example for GCM:
$serverKey = '[path to certification]'; $deviceId = '[device token]'; $devices = new DeviceCollection([new Device($deviceId)]); $message = new Message('This is a test message'); $adapter = new Gcm($serverKey, AdapterInterface::ENVIRONMENT_DEVELOPMENT); $pusher = new Pusher([new Push($adapter, $devices, $message)]); $pusher->push();
Example for APNS:
$serverKey = '[path to certification]'; $deviceId = '[device token]'; $devices = new DeviceCollection([new Device($deviceId)]); $message = new Message('This is a test message'); $adapter = new Apns($serverKey, AdapterInterface::ENVIRONMENT_DEVELOPMENT); $pusher = new Pusher([new Push($adapter, $devices, $message)]); $pusher->push();
统计信息
- 总下载量: 14.57k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2017-03-21