PHPackages                             steveeakin/apn - 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. steveeakin/apn

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

steveeakin/apn
==============

Apple APN Push Notification Channel

v3.4.0(5y ago)09.2kMITPHPPHP ^7.3|^8.0

Since Oct 12Pushed 5y agoCompare

[ Source](https://github.com/steveeakin/apn)[ Packagist](https://packagist.org/packages/steveeakin/apn)[ Docs](https://github.com/laravel-notification-channels/apn)[ RSS](/packages/steveeakin-apn/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (9)Versions (33)Used By (0)

Laravel APN (Apple Push) Notification Channel
---------------------------------------------

[](#laravel-apn-apple-push-notification-channel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/af3ed5653c3146a98a734ee0174511d291e626bc843e96ed2ab25dd256013457/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c61726176656c2d6e6f74696669636174696f6e2d6368616e6e656c732f61706e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/laravel-notification-channels/apn)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/b9155eebb1d62a6ef6fd9b84cbff825241dc925c5f4e7657ec93f0e01b279424/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6c61726176656c2d6e6f74696669636174696f6e2d6368616e6e656c732f61706e2f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/laravel-notification-channels/apn)[![StyleCI](https://camo.githubusercontent.com/8e76b0446ad1bedb70093b583370eb03809399745094a690db9bc6aff3c46512/68747470733a2f2f7374796c6563692e696f2f7265706f732f36363434393439392f736869656c64)](https://github.styleci.io/repos/66449499)[![Quality Score](https://camo.githubusercontent.com/5fc45020d2586f69e46f06194ba73b56e33585f701838fa53cbe5fb15a7ac3cf/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6c61726176656c2d6e6f74696669636174696f6e2d6368616e6e656c732f61706e2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/laravel-notification-channels/apn)[![Code Coverage](https://camo.githubusercontent.com/04f82df8584fa7c80b78b3f97de307d171e8d129bc836ad83304cecff360b1ac/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f6c61726176656c2d6e6f74696669636174696f6e2d6368616e6e656c732f61706e2f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/laravel-notification-channels/apn/?branch=master)[![Total Downloads](https://camo.githubusercontent.com/78b2ecceb3e4cae913ae0d7f400187dfc91019ea78018eb7dfc371343770c2fe/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c61726176656c2d6e6f74696669636174696f6e2d6368616e6e656c732f61706e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/laravel-notification-channels/apn)

This package makes it easy to send notifications using Apple Push (APN) with Laravel.

Contents
--------

[](#contents)

- [Installation](#installation)
- [Usage](#usage)
- [Changelog](#changelog)
- [Testing](#testing)
- [Security](#security)
- [Contributing](#contributing)
- [Credits](#credits)
- [License](#license)

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

[](#installation)

Install this package with Composer:

```
composer require laravel-notification-channels/apn

```

### Setting up the APN service

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

Before using the APN Service, [enable Push Notifications in your app](https://help.apple.com/xcode/mac/current/#/devdfd3d04a1). Then [create a APNS key under Certificates, Identifiers &amp; Profiles](https://developer.apple.com/account/resources/authkeys/list) to generate a Key ID and .p8 file.

Collect your Key ID, as well as your Team ID (displayed at the top right of the Apple Developer page) and app bundle ID and configure as necessary in `config/broadcasting.php`.

```
'connections' => [
    'apn' => [
        'key_id' => env('APN_KEY_ID'),
        'team_id' => env('APN_TEAM_ID'),
        'app_bundle_id' => env('APN_BUNDLE_ID'),
        'private_key_content' => env('APN_PRIVATE_KEY'),
        'production' => env('APN_PRODUCTION', true),
    ],
],
```

See the [`pushok` docs](https://github.com/edamov/pushok) for more information about what arguments can be supplied to the client - for example you can also use `private_key_path` and `private_key_secret`.

Usage
-----

[](#usage)

You can now send messages to APN by creating a ApnMessage:

```
use NotificationChannels\Apn\ApnChannel;
use NotificationChannels\Apn\ApnMessage;
use Illuminate\Notifications\Notification;

class AccountApproved extends Notification
{
    public function via($notifiable)
    {
        return [ApnChannel::class];
    }

    public function toApn($notifiable)
    {
        return ApnMessage::create()
            ->badge(1)
            ->title('Account approved')
            ->body("Your {$notifiable->service} account was approved!");
    }
}
```

To see more of the methods available to you when creating a message please see the [`ApnMessage` source](https://github.com/laravel-notification-channels/apn/blob/master/src/ApnMessage.php).

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

```
public function routeNotificationForApn()
{
    return $this->apn_token;
}
```

### Per-message configuration

[](#per-message-configuration)

If you need to provide a custom configuration for a message you can provide an instance of a [Pushok](https://github.com/edamov/pushok) client and it will be used instead of the default one.

```
$customClient = new Pushok\Client(Pushok\AuthProvider\Token::create($options));

return ApnMessage::create()
    ->title('Account approved')
    ->body("Your {$notifiable->service} account was approved!")
    ->via($customClient)
```

### VoIP push notifications

[](#voip-push-notifications)

Sending VoIP push notifications is very similar. You just need to use the `ApnVoipChannel` channel with `ApnVoipMessage` (which has the same API as a regular `ApnMessage`).

```
use NotificationChannels\Apn\ApnVoipChannel;
use NotificationChannels\Apn\ApnVoipMessage;
use Illuminate\Notifications\Notification;

class AccountApproved extends Notification
{
    public function via($notifiable)
    {
        return [ApnVoipChannel::class];
    }

    public function toApnVoip($notifiable)
    {
        return ApnVoipMessage::create()
            ->badge(1);
    }
}
```

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

```
public function routeNotificationForApnVoip()
{
    return $this->apn_voip_token;
}
```

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)

- [Fruitcake](https://github.com/fruitcake)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity79

Established project with proven stability

 Bus Factor1

Top contributor holds 62.1% 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 ~56 days

Recently: every ~42 days

Total

30

Last Release

1875d ago

Major Versions

v0.5.0 → v1.0.02020-02-18

v1.3.0 → v2.0.02020-03-03

0.x-dev → v2.1.02020-03-22

v2.3.0 → v3.0.02020-09-08

PHP version history (6 changes)v0.1.0PHP &gt;=5.5

v0.2.0PHP &gt;=7.0.0

v0.5.0PHP ^7.2

v2.0.0PHP ^7.2.5

v3.0.0PHP ^7.3

v3.2.0PHP ^7.3|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/6329c756d889e4f3eda204a4755a7092ef8d845af8663bf874e2a8f71ea43868?d=identicon)[steveeakin](/maintainers/steveeakin)

---

Top Contributors

[![dwightwatson](https://avatars.githubusercontent.com/u/1100408?v=4)](https://github.com/dwightwatson "dwightwatson (131 commits)")[![SaundersB](https://avatars.githubusercontent.com/u/4874111?v=4)](https://github.com/SaundersB "SaundersB (10 commits)")[![TechGuard](https://avatars.githubusercontent.com/u/677174?v=4)](https://github.com/TechGuard "TechGuard (10 commits)")[![barryvdh](https://avatars.githubusercontent.com/u/973269?v=4)](https://github.com/barryvdh "barryvdh (8 commits)")[![KoIIIeY](https://avatars.githubusercontent.com/u/1047297?v=4)](https://github.com/KoIIIeY "KoIIIeY (7 commits)")[![chimit](https://avatars.githubusercontent.com/u/839349?v=4)](https://github.com/chimit "chimit (7 commits)")[![devsaider](https://avatars.githubusercontent.com/u/5224397?v=4)](https://github.com/devsaider "devsaider (5 commits)")[![freekmurze](https://avatars.githubusercontent.com/u/483853?v=4)](https://github.com/freekmurze "freekmurze (4 commits)")[![PauRevo](https://avatars.githubusercontent.com/u/35812841?v=4)](https://github.com/PauRevo "PauRevo (4 commits)")[![steveeakin](https://avatars.githubusercontent.com/u/4388590?v=4)](https://github.com/steveeakin "steveeakin (4 commits)")[![infostreams](https://avatars.githubusercontent.com/u/1132744?v=4)](https://github.com/infostreams "infostreams (3 commits)")[![killtw](https://avatars.githubusercontent.com/u/1076225?v=4)](https://github.com/killtw "killtw (3 commits)")[![marcroberts](https://avatars.githubusercontent.com/u/43874?v=4)](https://github.com/marcroberts "marcroberts (2 commits)")[![koenhoeijmakers](https://avatars.githubusercontent.com/u/2232776?v=4)](https://github.com/koenhoeijmakers "koenhoeijmakers (2 commits)")[![ReactiveXYZ-Dev](https://avatars.githubusercontent.com/u/11804055?v=4)](https://github.com/ReactiveXYZ-Dev "ReactiveXYZ-Dev (2 commits)")[![ElfSundae](https://avatars.githubusercontent.com/u/526008?v=4)](https://github.com/ElfSundae "ElfSundae (2 commits)")[![joelennon](https://avatars.githubusercontent.com/u/167845?v=4)](https://github.com/joelennon "joelennon (1 commits)")[![DaanGeurts](https://avatars.githubusercontent.com/u/2170399?v=4)](https://github.com/DaanGeurts "DaanGeurts (1 commits)")[![ertogs](https://avatars.githubusercontent.com/u/1944530?v=4)](https://github.com/ertogs "ertogs (1 commits)")[![hansnn](https://avatars.githubusercontent.com/u/4686949?v=4)](https://github.com/hansnn "hansnn (1 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/steveeakin-apn/health.svg)

```
[![Health](https://phpackages.com/badges/steveeakin-apn/health.svg)](https://phpackages.com/packages/steveeakin-apn)
```

###  Alternatives

[laravel-notification-channels/apn

Apple APN Push Notification Channel

2021.9M4](/packages/laravel-notification-channels-apn)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k12.1M99](/packages/laravel-pulse)[propaganistas/laravel-disposable-email

Disposable email validator

5762.6M6](/packages/propaganistas-laravel-disposable-email)[laravel-notification-channels/twilio

Provides Twilio notification channel for Laravel

2587.7M12](/packages/laravel-notification-channels-twilio)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[laravel-notification-channels/telegram

Telegram Notifications Channel for Laravel

1.1k3.4M35](/packages/laravel-notification-channels-telegram)

PHPackages © 2026

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