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

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

smileythane/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)

v1.2.0(4y ago)010MITPHPPHP ^7.2

Since Dec 14Pushed 4y agoCompare

[ Source](https://github.com/SmileyThane/laravel-apn-notification-channel)[ Packagist](https://packagist.org/packages/smileythane/laravel-apn-notification-channel)[ Docs](https://github.com/smileythane/laravel-apn-notification-channel)[ RSS](/packages/smileythane-laravel-apn-notification-channel/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (2)Dependencies (6)Versions (13)Used By (0)

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

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

[![Latest Version on Packagist](https://camo.githubusercontent.com/e329fa2f605c0f043f190e054ac262413e8d5e6727c18e7e0e6369e577f16984/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f536d696c65795468616e652f6c61726176656c2d61706e2d6e6f74696669636174696f6e2d6368616e6e656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/SmileyThane/laravel-apn-notification-channel)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/94728a374853a43959a7fc7c226078e37c6377695924ccc85587e0d117057367/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f536d696c65795468616e652f6c61726176656c2d61706e2d6e6f74696669636174696f6e2d6368616e6e656c2f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/SmileyThane/laravel-apn-notification-channel)[![StyleCI](https://camo.githubusercontent.com/7a2a3cdb07c1b1f483a2ea1e5e08468a507a89b7fb220a4a2d1ee8491f097b4a/68747470733a2f2f7374796c6563692e696f2f7265706f732f3136313730333836362f736869656c64)](https://styleci.io/repos/161703866)[![Quality Score](https://camo.githubusercontent.com/f9f90e53bf16e7d5aa35c17fb1bc99bd3196845e40de212a05bbd53a435b823e/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f536d696c65795468616e652f6c61726176656c2d61706e2d6e6f74696669636174696f6e2d6368616e6e656c2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/SmileyThane/laravel-apn-notification-channel)[![Code Coverage](https://camo.githubusercontent.com/e01995c517a4aa9bd2d7e1deaef774f2c24061fe42bb436c794ca85ef66ef936/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f536d696c65795468616e652f6c61726176656c2d61706e2d6e6f74696669636174696f6e2d6368616e6e656c2f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/SmileyThane/laravel-apn-notification-channel/?branch=master)[![Total Downloads](https://camo.githubusercontent.com/f8ced43de25f710f270e6ebd6b07df3747a0c310c198e5834f6563b39158f9cf/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f536d696c65795468616e652f6c61726176656c2d61706e2d6e6f74696669636174696f6e2d6368616e6e656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/SmileyThane/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 SmileyThane/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' => [
    // ...
    SmileyThane\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',
        'app_bundle_id' => env('APN_APP_BUNDLE_ID'), // The Bundle ID of your application. For example, "com.company.application"
        '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 SmileyThane\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)`
- `launchImage($str)`
- `threadId($str)`

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)

- [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

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 90.5% 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 ~121 days

Recently: every ~232 days

Total

9

Last Release

1738d ago

Major Versions

v0.1.5 → v1.0.02020-02-23

PHP version history (2 changes)v0.1.0PHP ^7.0

v1.0.0PHP ^7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/65e00bc1f3ec456f5cb3186b344be53b8e67f20fad6ba92d9c72941c422453df?d=identicon)[smileythane](/maintainers/smileythane)

---

Top Contributors

[![semyonchetvertnyh](https://avatars.githubusercontent.com/u/2598761?v=4)](https://github.com/semyonchetvertnyh "semyonchetvertnyh (38 commits)")[![SmileyThane](https://avatars.githubusercontent.com/u/5662239?v=4)](https://github.com/SmileyThane "SmileyThane (3 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/smileythane-laravel-apn-notification-channel/health.svg)

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

###  Alternatives

[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)[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

4093.0M16](/packages/edamov-pushok)[laravel-notification-channels/apn

Apple APN Push Notification Channel

2021.9M4](/packages/laravel-notification-channels-apn)[s-ichikawa/laravel-sendgrid-driver

This library adds a 'sendgrid' mail driver to Laravel.

4139.3M1](/packages/s-ichikawa-laravel-sendgrid-driver)[laravel-notification-channels/microsoft-teams

A Laravel Notification Channel for Microsoft Teams

1603.0M7](/packages/laravel-notification-channels-microsoft-teams)[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)
