PHPackages                             autoxloo/yii2-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. autoxloo/yii2-apns

ActiveYii2-extension

autoxloo/yii2-apns
==================

Yii2 wrap on autoxloo/apns

1.0.0(6y ago)078BSD-3-ClausePHPPHP &gt;=5.5.0

Since Dec 10Pushed 4y ago2 watchersCompare

[ Source](https://github.com/autoxloo/yii2-apns)[ Packagist](https://packagist.org/packages/autoxloo/yii2-apns)[ RSS](/packages/autoxloo-yii2-apns/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

Yii2 wrap of [autoxloo/apns](https://github.com/VasylDmytruk/apns)
==================================================================

[](#yii2-wrap-of-autoxlooapns)

Yii2 wrap of autoxloo/apns

> Note: This package is not supported properly

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist autoxloo/yii2-apns "*"

```

or

```
composer require --prefer-dist autoxloo/yii2-apns "*"

```

or add

```
"autoxloo/yii2-apns": "*"

```

to the require section of your `composer.json` file.

Config
------

[](#config)

To send push notification you should have apple .pem certificate.

In your application config add:

```
// ...
'components' => [
        // ...
        'apnsNotification' => [
            'class' => \autoxloo\yii2\apns\APNSNotification::class,
            'appleCertPath' => __DIR__ . '/wxv_cert.pem',
            'apiUrl' => 'https://api.push.apple.com/3/device',                  // default
            'apiUrlDev' => 'https://api.development.push.apple.com/3/device',   // default
            'apnsPort' => 443,                                                  // default
            'pushTimeOut' => 10,                                                // default
        ],
],

```

`AppleNotificationServer` sends push notification first on `$apiUrl` () if not success (not status code `200`), then sends on `$apiUrlDev` (). If you don't want to send push notification on $apiUrlDev set it value to `false`:

```
// ...
'components' => [
        // ...
        'apnsNotification' => [
            'class' => \autoxloo\yii2\apns\APNSNotification::class,
            'appleCertPath' => __DIR__ . '/wxv_cert.pem',
            'apiUrl' => 'https://api.push.apple.com/3/device',                  // default
            'apiUrlDev' => false,
            'apnsPort' => 443,                                                  // default
            'pushTimeOut' => 10,                                                // default
        ],
],
```

Also if you want to send push notification only on dev url, you can do so by setting `apiUrl` with dev url:

```
// ...
'components' => [
        // ...
        'apnsNotification' => [
            'class' => \autoxloo\yii2\apns\APNSNotification::class,
            'appleCertPath' => __DIR__ . '/wxv_cert.pem',
            'apiUrl' => 'https://api.development.push.apple.com/3/device',
            'apiUrlDev' => false,
            'apnsPort' => 443,                                                  // default
            'pushTimeOut' => 10,                                                // default
        ],
],
```

You have to install curl with http2 support:
--------------------------------------------

[](#you-have-to-install-curl-with-http2-support)

```
cd ~
sudo apt-get install build-essential nghttp2 libnghttp2-dev libssl-dev
wget https://curl.haxx.se/download/curl-7.58.0.tar.gz
tar -xvf curl-7.58.0.tar.gz
cd curl-7.58.0
./configure --with-nghttp2 --prefix=/usr/local --with-ssl=/usr/local/ssl
make
sudo make install
sudo ldconfig
sudo reboot

```

Info from

If not helped, try

Usage
-----

[](#usage)

Sending push notification:

```
$token = 'some device token';
$payload = [
    'some key1' => 'some value1',
    'some key2' => 'some value2',
];

$response = \Yii::$app->apnsNotification->send($token, $payload);
```

or if you want to send to many tokens:

```
$tokens = [
    'some device token',
    'some other device token',
];
$payload = [
    'some key1' => 'some value1',
    'some key2' => 'some value2',
];

$response = \Yii::$app->apnsNotification->sendToMany($tokens, $payload);
```

See [autoxloo/apns](https://github.com/VasylDmytruk/apns) for more details.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2344d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1e0af05c82328c2e95f5808024281b4f3779bed0a7abb450943973f1f6388472?d=identicon)[autoxloo](/maintainers/autoxloo)

---

Top Contributors

[![VasylDmytruk](https://avatars.githubusercontent.com/u/32508794?v=4)](https://github.com/VasylDmytruk "VasylDmytruk (22 commits)")

---

Tags

FCMyii2Firebase Cloud Messaging

### Embed Badge

![Health badge](/badges/autoxloo-yii2-apns/health.svg)

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

###  Alternatives

[aksafan/yii2-fcm-both-api

Yii2 Extension for sending push notification with both Firebase Cloud Messaging (FCM) HTTP Server Protocols (APIs).

1552.4k1](/packages/aksafan-yii2-fcm-both-api)[edwinhoksberg/php-fcm

A library for sending Firebase cloud messages and managing user topic subscriptions, device groups and devices.

68328.5k1](/packages/edwinhoksberg-php-fcm)

PHPackages © 2026

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