定制 bibi4k0/apple-pusher 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

bibi4k0/apple-pusher

Composer 安装命令:

composer require bibi4k0/apple-pusher

包简介

A simple library for creating and sending push-notifications to apple devices via APNs using HTTP/2.

README 文档

README

A simple library for creating and sending push-notifications to apple devices via APNs. Supports sending over http/2 protocol preferred by Apple and both of authentication types: token-based and via ssl-cert.

Installation

# for PHP 8.* only
composer require bibi4k0/apple-pusher 

# for PHP 7.4+ or PHP 8.*
composer require bibi4k0/apple-pusher:^1.1

# for PHP 7.2+
composer require bibi4k0/apple-pusher:^1.0

Usage

use bIbI4k0\ApplePusher\BaseConfig;
use bIbI4k0\ApplePusher\Curl\CurlWrapper;
use bIbI4k0\ApplePusher\Sender;
use bIbI4k0\ApplePusher\Payload;

$auth = new TokenAuth(
    'your apns id', 
    'your team id', 
    'content from .p8 cert file or file path with prefix file://'
);

$isSandbox = false;

$sender = new Sender(
    $auth,
    new CachedCurlWrapper(),
    new BaseConfig($isSandbox)
);

$payload = new AlertPayload('Hello dude');
$push = new Push('device token', $payload);
$push->setTopic('bundle id of your app');

$resp = $sender->send($push);
if ($resp->isOk()) {
    echo 'push was sent successfully';
}

See also example/cmd.php.

Documentation

It's simple library and hardly needs any separate documentation. Nevertheless, I tried to describe the code documentation well enough. See the source code for the more knowledges.

Tests

Some unit tests are included. Still not enough, but I'm working on it :)

Can run it by command:

composer run unit

统计信息

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

GitHub 信息

  • Stars: 5
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-09-14

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固