maximerenou/php-fcm
Composer 安装命令:
composer require maximerenou/php-fcm
包简介
A library for sending Firebase cloud messages and managing user topic subscriptions, device groups and devices.
README 文档
README
A PHP library for sending Firebase Cloud Messages and managing user topic subscriptions, device groups and devices.
Installation
Installation with composer:
composer require maximerenou/php-fcm
About this fork
Sound support.
Quickstart
// Instantiate the client with the project api_token and sender_id. $client = new \Fcm\FcmClient($apiToken, $senderId); // Instantiate the push notification request object. $notification = new \Fcm\Push\Notification(); // Enhance the notification object with our custom options. $notification ->addRecipient($deviceId) ->setTitle('Hello from php-fcm!') ->setBody('Notification body') ->setSound('custom_sound') ->addData('key', 'value'); // Send the notification to the Firebase servers for further handling. $client->send($notification);
Full documentation
Read the documentation here or look in the docs directory.
Tests
Run the unit tests with PHPUnit:
vendor/bin/phpunit -c phpunit.dist.xml
License
统计信息
- 总下载量: 15
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-05-16