fcorz/hyperf-firebase 问题修复 & 功能扩展

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

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

fcorz/hyperf-firebase

最新稳定版本:v2.0.0

Composer 安装命令:

composer require fcorz/hyperf-firebase

包简介

A Hyperf package for the Firebase PHP Admin SDK

README 文档

README

A Hyperf package for the Firebase PHP Admin SDK.

Installation

composer require fcorz/hyperf-firebase

Publish

php bin/hyperf.php vendor:publish fcorz/hyperf-firebase

Configuration

Credentials with JSON files

FIREBASE_CREDENTIALS=config/certificates/service-account-file.json

Usage

Facades

use Fcorz\Hyperf\Firebase\Facades\Firebase;

// Return an instance of the Messaging component for the default Firebase project
$defaultMessaging = Firebase::messaging();

// Return an instance of the Auth component for a specific Firebase project
$appMessaging = Firebase::project('app')->messaging();

$anotherAppMessaging = Firebase::project('another-app')->messaging();

// send message
$message = [
    'token' => $deviceToken,
    'notification' => [/* Notification data as array */], // optional
    'data' => [/* data array */], // optional
];

Firebase::messaging()->send($message);

Dependency Injection

use Fcorz\Hyperf\Firebase\ApplicationProxy;

class yourProjectFirebase extends ApplicationProxy
{
    protected string $name = 'project_name';

}

// send message
class yourClass
{
    public function __construct(yourProjectFirebase $firebase)
    {
        $firebase->messaging()->send($message);
    }
}

The future of the Firebase Admin PHP SDK

Please read about the future of the Firebase Admin PHP SDK on the SDK's GitHub Repository.

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-02-01