pigeonboys/fastpush 问题修复 & 功能扩展

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

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

pigeonboys/fastpush

Composer 安装命令:

composer require pigeonboys/fastpush

包简介

Fastpush is a lightweight PHP package for sending push notifications via an API, offering easy setup with channel and topic management.

README 文档

README

Introduction

Fastpush is a simple and efficient PHP package designed for sending push notifications. It allows you to easily configure and send notifications to users through channels and topics.

Installation

To install the package, run the following command:

composer require pigeonboys/fastpush

Usage

Configuration

Before calling the PushClient class for the first time, the PushConfiguration class must be initialized:

use PigeonBoys\Fastpush\Client\PushConfiguration;

PushConfiguration::initialize(
    host: 'https://example.com/api/push',
    token: '<bearer-token>'
);

Send Notifications

Use the PushClient::send method to send notifications to specific recipients through a defined channel and topic:

use Fastpush\Client\PushClient;
use Fastpush\Entity\Channel;
use Fastpush\Entity\Message;
use Fastpush\Entity\Topic;

$channel = new Channel(
    externalId: 'channel.test',
    name: 'Test Channel',
    imageUrl: 'https://example.com/images/test.png'
);

$topic = new Topic(
    externalId: 'topic.test',
    name: 'Test Topic',
    category: 0
);

$messages = [
    new Message(
        recipients: [100100, 100200],
        content: 'Hey Folks! That is a test message for 100100 and 100200.',
        attachments: [
            'https://cdn.example.com/100100.pdf',
            'https://cdn.example.com/100200.pdf'
        ],
    ),
    new Message(
        recipients: [100300, 100400],
        content: 'Hey Folks! That is a test message for 100300 and 100400.',
        attachments: [
            'https://cdn.example.com/100300.pdf',
            'https://cdn.example.com/100400.pdf'
        ],
    )
];

$res = PushClient::send(
    channel: $channel,
    topic: $topic,
    messages: $messages
);

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-02-13

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固