承接 vyconsulting-group/push-notification 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

vyconsulting-group/push-notification

Composer 安装命令:

composer require vyconsulting-group/push-notification

包简介

PHP wrapper FCM

README 文档

README

wetillix/push-notification is a simple and efficient PHP package for sending notifications via Firebase Cloud Messaging (FCM).

Installation

Install the package via Composer:

composer require wetillix/push-notification

Configuration

After installation, prepare your firebase_credentials.json file containing your FCM credentials. Store this file securely in your project.

Usage

Initialization

Import and initialize the service in your project, providing the path to the FCM credentials file in the constructor:

use Wetillix\PushNotification\PushNotification;

$pushNotification = new PushNotification('/path/to/firebase_credentials.json');

Sending a Notification to a Specific Device

Use the sendPushNotificationToDevice method to send a notification to a user:

$response = $pushNotification->sendPushNotificationToDevice(
    token: 'device_token',
    data: [
        'title' => 'value1',
        'description' => 'value2'
    ]
);

Sending a Notification to a Topic

Use the sendPushNotificationToTopic method to send a notification to all users subscribed to a topic:

$response = $pushNotification->sendPushNotificationToTopic(
    topic: 'topic_name',
    data: [
        'title' => 'value1',
        'description' => 'value2'
    ]
);

Contribution

Contributions are welcome! Follow these steps:

  1. Fork the project.
  2. Create a new branch: git checkout -b my-branch.
  3. Make your changes.
  4. Submit a Pull Request.

License

This project is licensed under the MIT license.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: GPL-3.0-or-later
  • 更新时间: 2019-03-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固