redjanym/php-firebase-cloud-messaging 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

redjanym/php-firebase-cloud-messaging

最新稳定版本:v2.0.2

Composer 安装命令:

composer require redjanym/php-firebase-cloud-messaging

包简介

PHP SDK for Firebase Cloud Messaging from Google

README 文档

README

Buy Me a Coffee at ko-fi.com

PHP SDK for Firebase Cloud Messaging from Google, supporting HTTP V1.

See original Firebase docs: https://firebase.google.com/docs/

#Setup Install via Composer:

composer require redjanym/php-firebase-cloud-messaging

Or add this to your composer.json and run "composer update":

"require": {
    "redjanym/php-firebase-cloud-messaging": "2.*"
}

Send message to a Device

use RedjanYm\FCM\Client;
use RedjanYm\FCM\Notification;
use RedjanYm\FCM\Recipient\Device;

$serviceAccountPath = '/path/to/service-account.json';
$testToken = 'this-is-a-token';

$client = new Client($serviceAccountPath);
$recipient = new Device($testToken);
$notification = new Notification($recipient, 'Title', 'Body', ['key' => 'value']);

$client->send($notification);

Topic Support

The current version does not have support for Topics. We are going to add it on v2.1.

Migrating from V1.

Unfortunately V2 of this package introduces breaking changes. But the new structure of the SDK is still simple and very similar to the previous one. We are sure the migration is going to be very fast and easy.

Interpreting responses

Responses given on the HTTP requests are standard according to the FCM documentations. You may find detailed specifications in this links:

统计信息

  • 总下载量: 834.42k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 39
  • 点击次数: 1
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 37
  • Watchers: 3
  • Forks: 120
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-02-25