legomolina/fcm-push-notification

基本类,用于通过 Google Firebase 发送推送通知

2.0.0 2018-12-18 20:30 UTC

This package is not auto-updated.

Last update: 2024-09-28 20:03:38 UTC


README

基本类,用于使用 google firebase 发送推送通知。

安装

请注意!此库需要 PHP 的 curl 模块才能工作。

FMC Push Notifications 存放在 Packagist 中,因此您可以从 Composer 获取。

composer require legomolina/fcm-push-notification

使用方法

在您的 index 中引入 Composer 自动加载。

<?php
    require 'vendor/autoload.php';

设置您的 Firebase API 密钥。

FCMPushNotifications::API_KEY = "my_api_key";

创建一个通知对象。

$notification = new FCMNotification("Title", "Message");

并发送通知。

FCMPushNotifications::send("mobile_token_or_topic", $notification, [ "custom" => "data" ]);

许可证

FMC Push Notifications 在 GPL v3 许可证下授权。有关更多信息,请参阅许可证文件。