PHPackages                             brdevelopers/laravel-apn-notification-channel - 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. brdevelopers/laravel-apn-notification-channel

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

brdevelopers/laravel-apn-notification-channel
=============================================

Apple Push Notification Service (APNs) notifications channel for Laravel 6 using the new APNs HTTP/2 protocol with token-based (JWT with p8 private key)

3.0.0(4mo ago)0238MITPHPPHP ^8.1|^8.2

Since May 17Pushed 4mo agoCompare

[ Source](https://github.com/Bold-and-Reeves/laravel-apn-notification-channel)[ Packagist](https://packagist.org/packages/brdevelopers/laravel-apn-notification-channel)[ Docs](https://github.com/brdevelopers/laravel-apn-notification-channel)[ RSS](/packages/brdevelopers-laravel-apn-notification-channel/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (1)Dependencies (7)Versions (6)Used By (0)

APNs notifications channel for Laravel 6
========================================

[](#apns-notifications-channel-for-laravel-6)

[![Latest Version on Packagist](https://camo.githubusercontent.com/ed763b7e08d5a49d3a06d647c14ef9cdb4d39831888a377baa54d4473cba9dad/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6272646576656c6f706572732f6c61726176656c2d61706e2d6e6f74696669636174696f6e2d6368616e6e656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/brdevelopers/laravel-apn-notification-channel)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/ec6e8135dd3ea42f7b10e1ac670ed540b8017a132ea5954e3889ccff36f36b17/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6272646576656c6f706572732f6c61726176656c2d61706e2d6e6f74696669636174696f6e2d6368616e6e656c2f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/brdevelopers/laravel-apn-notification-channel)[![StyleCI](https://camo.githubusercontent.com/7a2a3cdb07c1b1f483a2ea1e5e08468a507a89b7fb220a4a2d1ee8491f097b4a/68747470733a2f2f7374796c6563692e696f2f7265706f732f3136313730333836362f736869656c64)](https://styleci.io/repos/161703866)[![Quality Score](https://camo.githubusercontent.com/97a38ea5bb506f571dbe22dd1f7e69b34edd814ebbd3fd8aee90402b17bf4f6d/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6272646576656c6f706572732f6c61726176656c2d61706e2d6e6f74696669636174696f6e2d6368616e6e656c2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/brdevelopers/laravel-apn-notification-channel)[![Code Coverage](https://camo.githubusercontent.com/73a386f57c90a6cffbe2a2e099acae611510ee9cc25a22fa494c73b1e3e319e1/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f6272646576656c6f706572732f6c61726176656c2d61706e2d6e6f74696669636174696f6e2d6368616e6e656c2f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/brdevelopers/laravel-apn-notification-channel/?branch=master)[![Total Downloads](https://camo.githubusercontent.com/65c88686f437eb8befb1e93cd86490e1dedc9a88a4d3ff4aa72006bb037973b1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6272646576656c6f706572732f6c61726176656c2d61706e2d6e6f74696669636174696f6e2d6368616e6e656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/brdevelopers/laravel-apn-notification-channel)

This package makes it easy to send notifications with Laravel 6 to iOS using the new APNs HTTP/2 protocol with token-based (JWT with p8 private key).

Contents
--------

[](#contents)

- [Features](#features)
- [Requirements](#requirements)
- [Installation](#installation)
    - [Setting up the APN service](#setting-up-the-apn-service)
- [Usage](#usage)
    - [Available Message methods](#available-message-methods)
- [TODO](#todo)
- [Changelog](#changelog)
- [Testing](#testing)
- [Security](#security)
- [Contributing](#contributing)
- [Credits](#credits)
- [License](#license)

Features
--------

[](#features)

- Uses new Apple APNs HTTP/2 connection
- Supports JWT-based authentication
- Supports Certificate-based authentication
- Supports new iOS 10 features such as Collapse IDs, Subtitles and Mutable Notifications
- Uses concurrent requests to APNs
- Tested and working in APNs production environment

Requirements
------------

[](#requirements)

- PHP &gt;= 7.2
- lib-curl &gt;= 7.46.0 (with http/2 support enabled)
- lib-openssl &gt;= 1.0.2e

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

[](#installation)

Install this package with Composer:

```
composer require brdevelopers/laravel-apn-notification-channel
```

If you're installing the package in Laravel 5.4 or lower, you must import the service provider:

```
// config/app.php
'providers' => [
    // ...
    BRDevelopers\ApnNotificationChannel\ApnServiceProvider::class,
],
```

### Setting up the APN service

[](#setting-up-the-apn-service)

Add the credentials to your `config/broadcasting.php`:

If you are using JWT-based authentication:

```
// config/broadcasting.php
'connections' => [
    ...
    'apn' => [
        'driver' => 'jwt',
        'is_production' => env('APP_ENV') === 'production',
        'key_id' => env('APN_KEY_ID'), // The Key ID of the p8 file (available at https://developer.apple.com/account/ios/authkey/)
        'team_id' => env('APN_TEAM_ID'), // The Team ID of your Apple Developer Account (available at https://developer.apple.com/account/#/membership/)
        'app_bundle_id' => env('APN_APP_BUNDLE_ID'), // The Bundle ID of your application. For example, "com.company.application"
        'private_key_path' => env('APN_PRIVATE_KEY', storage_path('apns-private-key.p8')),
        'private_key_secret' => env('APN_PRIVATE_KEY_SECRET'),
    ],
    ...
],
```

If you are using Certificate-based authentication:

```
// config/broadcasting.php
'connections' => [
    ...
    'apn' => [
        'driver' => 'certificate',
        'is_production' => env('APP_ENV') === 'production',
        'certificate_path' => env('APN_CERTIFICATE_PATH', storage_path('apns-certificate.pem')),
        'certificate_secret' => env('APN_CERTIFICATE_SECRET'),
    ],
    ...
],
```

Usage
-----

[](#usage)

Now you can use the channel in your `via()` method inside the notification:

```
use Illuminate\Notifications\Notification;
use BRDevelopers\ApnNotificationChannel\ApnMessage;

class AccountApproved extends Notification
{
    /**
     * Get the notification's delivery channels.
     *
     * @param  mixed  $notifiable
     * @return array
     */
    public function via($notifiable)
    {
        return ['apn'];
    }

    /**
     * Get the APN representation of the notification.
     *
     * @param  mixed  $notifiable
     * @return ApnMessage
     */
    public function toApn($notifiable)
    {
        return ApnMessage::create()
            ->badge(1)
            ->title('Account approved')
            ->body("Your {$notifiable->service} account was approved!");
    }
}
```

In your `notifiable` model, make sure to include a `routeNotificationForApn()` method, which return one or an array of device tokens.

```
/**
 * Route notifications for the APN channel.
 *
 * @return string|array
 */
public function routeNotificationForApn()
{
    return $this->apn_token;
}
```

### Available Message methods

[](#available-message-methods)

- `title($str)`
- `subtitle($str)`
- `body($str)`
- `badge($int)`
- `sound($str)`
- `category($str)`
- `custom($key, $value)`
- `setCustom($array)`
- `titleLocKey($str)`
- `titleLocArgs($array)`
- `actionLocKey($str)`
- `setLocKey($str)`
- `setLocArgs($array)`
- `launchImage($str)`
- `contentAvailability($bool)`
- `mutableContent($bool)`
- `threadId($str)`

TODO
----

[](#todo)

- Fix Travis CI
- Fix Scrutinizer CI Code Coverage
- Add tests

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Testing
-------

[](#testing)

```
$ composer test
```

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Credits
-------

[](#credits)

- [Semyon Chetvertnyh](https://github.com/brdevelopers)
- [Arthur Edamov](https://github.com/edamov)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

42

—

FairBetter than 89% of packages

Maintenance74

Regular maintenance activity

Popularity13

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 97.4% 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

Every ~248 days

Total

5

Last Release

144d ago

Major Versions

1.0.2 → 2.0.02023-08-10

2.0.0 → 3.0.02026-02-02

PHP version history (2 changes)1.0.0PHP ^7.2

2.0.0PHP ^8.1|^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/8ca64f62bbe48be29bbb00c4f800683446e3ce8be46153e1af988e69014fb2a1?d=identicon)[Artem-Shmorgilo](/maintainers/Artem-Shmorgilo)

---

Top Contributors

[![semyonchetvertnyh](https://avatars.githubusercontent.com/u/2598761?v=4)](https://github.com/semyonchetvertnyh "semyonchetvertnyh (38 commits)")[![jkudish](https://avatars.githubusercontent.com/u/260253?v=4)](https://github.com/jkudish "jkudish (1 commits)")

---

Tags

apnspush notificationsp8php apnslaravel apnslaravel p8

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/brdevelopers-laravel-apn-notification-channel/health.svg)

```
[![Health](https://phpackages.com/badges/brdevelopers-laravel-apn-notification-channel/health.svg)](https://phpackages.com/packages/brdevelopers-laravel-apn-notification-channel)
```

###  Alternatives

[laravel-notification-channels/apn

Apple APN Push Notification Channel

2022.1M6](/packages/laravel-notification-channels-apn)[semyonchetvertnyh/laravel-apn-notification-channel

Apple Push Notification Service (APNs) notifications channel for Laravel 6 using the new APNs HTTP/2 protocol with token-based (JWT with p8 private key)

298.1k](/packages/semyonchetvertnyh-laravel-apn-notification-channel)[propaganistas/laravel-disposable-email

Disposable email validator

6012.9M7](/packages/propaganistas-laravel-disposable-email)[edamov/pushok

PHP client for Apple Push Notification Service (APNs) - Send push notifications to iOS using the new APNs HTTP/2 protocol with token-based (JWT with p8 private key) or certificate-based authentication

4103.4M17](/packages/edamov-pushok)[laravel-notification-channels/webpush

Web Push Notifications driver for Laravel.

8945.1M25](/packages/laravel-notification-channels-webpush)

PHPackages © 2026

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