PHPackages                             albaraam/php-gcm-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. [Mail &amp; Notifications](/categories/mail)
4. /
5. albaraam/php-gcm-apns

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

albaraam/php-gcm-apns
=====================

A PHP Library for sending messages to devices (Android &amp; IOS) through GCM and Apns (respectively).

v1.0.0(10y ago)133.6k[3 issues](https://github.com/albaraam/php-gcm-apns/issues)1MIT LicensePHPPHP &gt;=5.3.0

Since Dec 10Pushed 9y ago2 watchersCompare

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

READMEChangelogDependencies (2)Versions (2)Used By (1)

albaraam/php-gcm-apns
=====================

[](#albaraamphp-gcm-apns)

A PHP Library for sending messages to devices (Android &amp; IOS) through GCM and Apns (respectively).

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

[](#installation)

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

Either run

```
composer require albaraam/php-gcm-apns "~1.0.0"
```

or add

```
"albaraam/php-gcm-apns": "~1.0.0"
```

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

Usage
-----

[](#usage)

```
use albaraam\gcmapns\Message;
use albaraam\gcmapns\Client;

// Message creation
$message = new Message("Title","Body");

// Common attributes for both ios and android
$message
	->setTitle("Title")
	->setBody("Body")
	->setSound("sound.mp3")
	->setData(['foo'=>'bar']);

// Android specific attributes
$message->android
	->setTo("ids")
	->setIcon("icon")
	->setCollapseKey("collapse_key")
	->setColor("#333");

// IOS specific attributes
$message->ios
	->setTo("ids")
	->setSound("sound_ios.mp3") // custom sound for ios
	->setBadge(3);

// Client
$client = new Client("google_api_key","path/to/pem/file",Client::IOS_ENVIRONMENT_SANDBOX);

// configure client
$client->setIosPassphrase("passphrase");
...

// Send message
$client->send($message);
```

Usage: Advanced Example
-----------------------

[](#usage-advanced-example)

```
use albaraam\gcmapns\Message;
use albaraam\gcmapns\Client;

$message = new Message("Title","Body");

$message
	->setTitle("Title")
	->setBody("Body")
	->setPriority(5) // 5 or 10
	->setContentAvailable(true)
	->setDryRun(false)
	->setClickAction("") // same as Category
	->setCategory("") // same as ClickAction
	->setTitleLocKey("")
	->setTitleLocArgs("")
	->setBodyLocKey("")
	->setBodyLocArgs("")
	->setSound("sound.mp3")
	->setData(['foo'=>'bar']);

$message->android
	->setTo("ids")
	->setIcon("icon")
	->setCollapseKey(true)
	->setDelayWhileIdle(true)
	->setTimeToLive(3600)
	->setRestrictedPackageName("")
	->setTag("")
	->setColor("#333");

$message->ios
	->setTo("ids")
	->setLaunchImage("")
	->setBadge(3)
	->setActionLocKey("");

$client = new Client("google_api_key","path/to/pem/file",Client::IOS_ENVIRONMENT_SANDBOX);
$client->setIosPassphrase("passphrase");

$client->sendAndroid($message)) // send for android devices only
$client->sendIOS($message)) // send for ios devices only
// $client->send($message)) // send for both ios & android devices
```

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance15

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

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

3855d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2038883?v=4)[Albaraa Mishlawi](/maintainers/albaraam)[@albaraam](https://github.com/albaraam)

---

Tags

apnsgcmphpphp-gcm-apnsphp-libraryphppushgcmapnsphp-gcm-apns

### Embed Badge

![Health badge](/badges/albaraam-php-gcm-apns/health.svg)

```
[![Health](https://phpackages.com/badges/albaraam-php-gcm-apns/health.svg)](https://phpackages.com/packages/albaraam-php-gcm-apns)
```

###  Alternatives

[sly/notification-pusher

Standalone PHP library for easy devices notifications push.

1.2k2.8M16](/packages/sly-notification-pusher)[mcfedr/awspushbundle

A set of services to simplify using Aws to send push notifications

40382.7k1](/packages/mcfedr-awspushbundle)

PHPackages © 2026

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