PHPackages                             yjx/easy-apns - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Mail &amp; Notifications](/categories/mail)
4. /
5. yjx/easy-apns

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

yjx/easy-apns
=============

基于HTTP/2的APNs Provider, 应用多路复用, 实现高性能的苹果消息推送.

514PHP

Since Apr 9Pushed 7y agoCompare

[ Source](https://github.com/youjiaxing/EasyAPNs)[ Packagist](https://packagist.org/packages/yjx/easy-apns)[ RSS](/packages/yjx-easy-apns/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (1)Used By (0)

这是一个基于HTTP/2的APNs Provider, 应用多路复用, 实现高性能的苹果消息推送.

环境要求
====

[](#环境要求)

使用 [city-fan](https://mirror.city-fan.org/ftp/contrib/yum-repo/?C=M;O=A) 的yum源对curl进行更新(为支持 HTTP/2 multiplexing, 版本需至少 7.43.0)

```
# centos 6
rpm -Uvh http://mirror.city-fan.org/ftp/contrib/yum-repo/city-fan.org-release-2-1.rhel6.noarch.rpm
# centos 7
rpm -Uvh http://mirror.city-fan.org/ftp/contrib/yum-repo/city-fan.org-release-2-1.rhel7.noarch.rpm

yum list libnghttp2  --disablerepo="*"  --enablerepo="epel"
yum list curl --disablerepo="*" --enablerepo="city*"

yum install libnghttp2  --disablerepo="*"  --enablerepo="epel" -y
yum install curl --disablerepo="*" --enablerepo="city*" -y
```

确认curl支持 HTTP/2:

```
# HTTP/1.1
curl -I https://nghttp2.org/

# HTTP/2, 不支持时会报错
curl --http2 -I https://nghttp2.org/
```

Packagist
=========

[](#packagist)

示例
==

[](#示例)

- [简单的消息推送](https://github.com/youjiaxing/EasyAPNs/blob/HEAD/samples/simple_push.php)
- [从 redis 读取消息列表的推送服务](https://github.com/youjiaxing/EasyAPNs/blob/HEAD/samples/server.php)

安装
==

[](#安装)

```
composer require yjx/easy-apns:dev-master
```

简单使用
====

[](#简单使用)

```
$config = [
	'sslCert' => "APNs客户端证书绝对路径",
	'sslCertPwd' => "APNs客户端证书密码",
	'maxHostConn' => "与苹果推送服务器保持的连接数量, 默认1",
	'concurrentRequest' => "单个连接最大并发请求数",
];

// $logger 需实现Psr\Log\LoggerInterface
$logger = new Monolog\Monolog("apns");

$client = (new \EasyAPNs\Client($config['sslCert'], $config['sslCertPwd'], $config['maxHostConn']))
                ->setConcurrentMaxRequest($config['concurrentRequest'])
                ->setConcurrentMaxRequest(1)
                ->setLogger($logger)
;

$msg = (new \EasyAPNs\Message())
    ->setSandbox(true)
    ->setDeviceToken("devicetoken")
    ->setAlert("text body", "text title")
    ->setApnsTopic("***********") // bundle id
;
$client->add($msg);

$client->send();
```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/d88903546a67008b116b78c326f5ff16ce977b0de9ab21086a8b1b9e6080076c?d=identicon)[youjiaxing](/maintainers/youjiaxing)

---

Top Contributors

[![youjiaxing](https://avatars.githubusercontent.com/u/38421510?v=4)](https://github.com/youjiaxing "youjiaxing (3 commits)")

---

Tags

apnsapns-http2

### Embed Badge

![Health badge](/badges/yjx-easy-apns/health.svg)

```
[![Health](https://phpackages.com/badges/yjx-easy-apns/health.svg)](https://phpackages.com/packages/yjx-easy-apns)
```

###  Alternatives

[tijsverkoyen/css-to-inline-styles

CssToInlineStyles is a class that enables you to convert HTML-pages/files into HTML-pages/files with inline styles. This is very useful when you're sending emails.

5.8k505.3M227](/packages/tijsverkoyen-css-to-inline-styles)[minishlink/web-push

Web Push library for PHP

1.9k12.0M53](/packages/minishlink-web-push)[laravel-notification-channels/twilio

Provides Twilio notification channel for Laravel

2587.7M12](/packages/laravel-notification-channels-twilio)[spatie/url-signer

Generate a url with an expiration date and signature to prevent unauthorized access

4422.3M16](/packages/spatie-url-signer)[mattketmo/email-checker

Throwaway email detection library

2742.0M5](/packages/mattketmo-email-checker)[laravel-notification-channels/discord

Laravel notification driver for Discord.

2371.3M11](/packages/laravel-notification-channels-discord)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
