PHPackages                             lakshanjs/simple-apns-notifications - 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. lakshanjs/simple-apns-notifications

ActiveLibrary

lakshanjs/simple-apns-notifications
===================================

A simple yet powerful PHP class for sending APNs notifications.

v1.0(1y ago)2106MITPHPPHP &gt;=7.4

Since Jul 27Pushed 1y ago1 watchersCompare

[ Source](https://github.com/lakshanjs/simple-apns-notifications)[ Packagist](https://packagist.org/packages/lakshanjs/simple-apns-notifications)[ RSS](/packages/lakshanjs-simple-apns-notifications/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

Simple APNs Notifications
=========================

[](#simple-apns-notifications)

A simple yet powerful PHP class for sending APNs notifications.

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

[](#installation)

You can install this package via Composer:

```
composer require lakshanjs/simple-apns-notifications
```

Usage
-----

[](#usage)

```
require 'vendor/autoload.php';

use SimpleAPNsNotifications\APNsNotification;

$keyId = 'YOUR_KEY_ID'; // Your Key ID
$teamId = 'YOUR_TEAM_ID'; // Your Team ID
$bundleId = 'com.example.yourapp'; // Your Bundle ID
$privateKeyPath = 'path/to/AuthKey_YOUR_KEY_ID.p8'; // Path to your .p8 file
$deviceToken = 'YOUR_DEVICE_TOKEN'; // Device Token

$notification = new APNsNotification($keyId, $teamId, $bundleId, $privateKeyPath);
$notification->setDeviceToken($deviceToken);
$notification->setAlert('Incoming Call', 'You have an incoming call');
$notification->setCustomValue('customKey', 'customValue');
$notification->setPushType('voip'); // Set the push type to 'voip' for VoIP notifications
$notification->setProduction(false); // Set to true for production environment
$notification->setPriority(10); // Set the priority (10 for high, 5 for low)
$notification->setExpiration(time() + 3600); // Set the expiration time to 1 hour from now
$notification->setCollapseId('collapse-id'); // Set the collapse ID

list($httpcode, $response) = $notification->send();

if ($httpcode == 200) {
    echo "Notification sent successfully!\n";
} else {
    echo "Error sending notification: HTTP $httpcode\n";
    echo "Response: $response\n";
}
```

License
-------

[](#license)

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

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance35

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity39

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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

654d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7646f42a475b03098fb92e7dbec224cfabc712ac70950ee0b7337b361036d994?d=identicon)[lakshanjs](/maintainers/lakshanjs)

---

Top Contributors

[![lakshanjs](https://avatars.githubusercontent.com/u/7899504?v=4)](https://github.com/lakshanjs "lakshanjs (2 commits)")

### Embed Badge

![Health badge](/badges/lakshanjs-simple-apns-notifications/health.svg)

```
[![Health](https://phpackages.com/badges/lakshanjs-simple-apns-notifications/health.svg)](https://phpackages.com/packages/lakshanjs-simple-apns-notifications)
```

PHPackages © 2026

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