deigon/firebase

此包的最新版本(0.0.1)没有提供许可证信息。

Firebase SDK PHP

0.0.1 2021-10-16 19:50 UTC

This package is auto-updated.

Last update: 2024-09-22 08:18:30 UTC


README

用于Firebase集成的简单脚本

要求

  • [FCM_TOKEN] 控制台 Firebase > 项目 > 配置项目 > 云消息 > 服务器密钥。

安装

composer require deigon/firebase

发送云消息

require __DIR__ . '/vendor/autoload.php';
use Deigon\SDK\Firebase;

$fcm ='zNJqWVtVhWqaDwJc0uWofYYt5brlx5M86-AQnQ7KJWBqb7wQLk1iYmpA8ZirylKDL';

$device_token = 'Y4b2dXWWA-OJqke9wLQNmHrPAQnQ7KJWBqb7wQLk1iYmpA8ZirylKDL_PBOJKmajpHZrVsUdsSrgoCcJOs971x6F7v6gAlJ3yiGJ9tU7FD5dnsep_oBVzLu';
$title = 'Hello';
$message = 'Example message Lorem';

$firebase = new Firebase($fcm);
$firebase->sendCloudMessage($device_token, $title, $message);

发送各种云消息

require __DIR__ . '/vendor/autoload.php';
use Deigon\SDK\Firebase;

$fcm ='zNJqWVtVhWqaDwJc0uWofYYt5brlx5M86-AQnQ7KJWBqb7wQLk1iYmpA8ZirylKDL';

$devices_token = [
'Y4b2dXWWA-OJqke9wLQNmHrPAQnQ7KJWBqb7wQLk1iYmpA8ZirylKDL_PBOJKmajpHZrVsUdsSrgoCcJOs971x6F7v6gAlJ3yiGJ9tU7FD5dnsep_oBVzLu',
'OJqke9wLQNmHrPAQY4b2dXWWA-nQ7KJWBqb7wQLk1iYmpA8ZirylKDL_PBOJKmajpF7v6gAlJ3yiGJ9tU7FD5dnsep_oBVzLHZrVsUdsSrgoCcJOs971x6u',
'rPAQnQ7KJWBqb7wQLLQNmHrPAQY4b2dXWWA-nQ7KJWBqb7wQLpA8ZirylKDL_PBOJKmajpF7v6gAlJ3yiGJ9tU7FD5dnsep_oBVzLHZrVsUdsSrgoCcJOs9',
];
$title = 'Hello';
$message = 'Example message Lorem';

$firebase = new Firebase($fcm);
$firebase->sendMultipleCloudMessage($devices_token, $title, $message);

安全漏洞

如果您在此中发现安全漏洞,请通过 deigonprates@gmail.com 发送电子邮件给Deigon Prates。所有安全漏洞都将得到及时处理。

许可证

是开源软件,采用MIT许可证