PHPackages                             albaraam/yii2-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/yii2-gcm-apns

ActiveYii2-extension[Mail &amp; Notifications](/categories/mail)

albaraam/yii2-gcm-apns
======================

Yii2 component as wrapper of the "albaraam/php-gcm-apns" library to handle mobile push notifications.

v1.0.0(10y ago)01.4k1MIT LicensePHPPHP &gt;=5.4.0

Since Dec 10Pushed 9y ago1 watchersCompare

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

READMEChangelogDependencies (2)Versions (2)Used By (0)

albaraam/yii2-gcm-apns
======================

[](#albaraamyii2-gcm-apns)

Yii2 component as wrapper of the ["albaraam/php-gcm-apns"](https://github.com/albaraam/php-gcm-apns) library to handle mobile push notifications.

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

[](#installation)

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

Either run

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

or add

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

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

Usage
-----

[](#usage)

Add &amp; configure the component in your config file:

```
'components' => [
    'gcmApns' => [
        'class' => 'albaraam\yii2_gcm_apns\GcmApns',
        'google_api_key'=>'your_google_api_key',
        'environment'=>\albaraam\yii2_gcm_apns\GcmApns::ENVIRONMENT_SANDBOX,
        'pem_file'=>'path/to/pem/file'
    ],
]
```

Access it anywhere in your application like the following:

```
// Message creation through the message builder.
$message = Yii::$app()->gcmApns->messageBuilder("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);

// Send message
Yii::$app->gcmApns->send($message);
```

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community5

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

3856d ago

### Community

Maintainers

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

---

Tags

pushgcmyii2apnsyii2-gcm-apns

### Embed Badge

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

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

###  Alternatives

[mcfedr/awspushbundle

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

40382.7k1](/packages/mcfedr-awspushbundle)[albaraam/php-gcm-apns

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

133.6k1](/packages/albaraam-php-gcm-apns)

PHPackages © 2026

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