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

ActiveYii2-extension

apalych/yii2-apns-gcm
=====================

Yii 2 Apns and Gcm together

1.0.5(5y ago)06MITPHP

Since Feb 19Pushed 5y agoCompare

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

READMEChangelog (1)Dependencies (2)Versions (9)Used By (0)

Yii 2 Apns Gcm
==============

[](#yii-2-apns-gcm)

Yii 2 use Apns and Gcm together with common methods like `send()` and `sendMulti()`

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

[](#installation)

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

Either run

```
php composer.phar require --prefer-dist apalych/yii2-apns-gcm "1.0.4.1"

```

or add

```
"apalych/yii2-apns-gcm": "1.0.4.1"

```

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

---

in your main.php your configuration would look like this

```
'components' => [
	'apns' => [
		'class' => 'bryglen\apnsgcm\Apns',
		'environment' => \bryglen\apnsgcm\Apns::ENVIRONMENT_SANDBOX,
		'pemFile' => dirname(__FILE__).'/apnssert/apns-dev.pem',
		// 'retryTimes' => 3,
		'options' => [
			'sendRetryTimes' => 5
		]
	],
	'gcm' => [
		'class' => 'bryglen\apnsgcm\Gcm',
		'apiKey' => 'your_api_key',
	],
	// using both gcm and apns, make sure you have 'gcm' and 'apns' in your component
	'apnsGcm' => [
		'class' => 'bryglen\apnsgcm\ApnsGcm',
		// custom name for the component, by default we will use 'gcm' and 'apns'
		//'gcm' => 'gcm',
		//'apns' => 'apns',
	]
]
```

Online Tester
-------------

[](#online-tester)

Please visit the link for online tester

Usage
-----

[](#usage)

**Usage using APNS only**

```
/* @var $apnsGcm \bryglen\apnsgcm\Apns */
$apns = Yii::$app->apns;
$apns->send($push_tokens, $message,
  [
    'customProperty_1' => 'Hello',
    'customProperty_2' => 'World'
  ],
  [
    'sound' => 'default',
    'badge' => 1
  ]
);
```

**Usage using GCM only**

```
/* @var $apnsGcm \bryglen\apnsgcm\Gcm */
$gcm = Yii::$app->gcm;
$gcm->send($push_tokens, $message,
  [
    'customerProperty' => 1,
  ],
  [
    'timeToLive' => 3
  ],
);
```

### Usage using APNS and GCM Together

[](#usage-using-apns-and-gcm-together)

**Send using Google Cloud Messaging**

```
/* @var $apnsGcm \bryglen\apnsgcm\ApnsGcm */
$apnsGcm = Yii::$app->apnsGcm;
$apnsGcm->send(\bryglen\apnsgcm\ApnsGcm::TYPE_GCM, $push_tokens, $message,
  [
    'customerProperty' => 1
  ],
  [
    'timeToLive' => 3
  ],
)
```

**Send using Apple push notification service**

```
/* @var $apnsGcm \bryglen\apnsgcm\ApnsGcm */
$apnsGcm = Yii::$app->apnsGcm;
$apnsGcm->send(\bryglen\apnsgcm\ApnsGcm::TYPE_APNS, $push_tokens, $message,
  [
    'customerProperty' => 1
  ],
  [
    'sound' => 'default',
  	'badge' => 1
  ],
)
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 58.3% 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 ~368 days

Recently: every ~511 days

Total

7

Last Release

1889d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6ef0cf59ee131fa6f4c2b930b9e2c2db0621e27509716b4b2a110d18b31e994b?d=identicon)[apalych](/maintainers/apalych)

---

Top Contributors

[![bryglen](https://avatars.githubusercontent.com/u/875604?v=4)](https://github.com/bryglen "bryglen (21 commits)")[![apalych](https://avatars.githubusercontent.com/u/60067867?v=4)](https://github.com/apalych "apalych (9 commits)")[![Valentinlazy](https://avatars.githubusercontent.com/u/1050995?v=4)](https://github.com/Valentinlazy "Valentinlazy (4 commits)")[![drqwaso](https://avatars.githubusercontent.com/u/16756065?v=4)](https://github.com/drqwaso "drqwaso (1 commits)")[![g-mirgorod-md](https://avatars.githubusercontent.com/u/45852111?v=4)](https://github.com/g-mirgorod-md "g-mirgorod-md (1 commits)")

---

Tags

gcmyii2extensionapns

### Embed Badge

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

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

###  Alternatives

[bryglen/yii2-apns-gcm

Yii 2 Apns and Gcm together

54277.8k1](/packages/bryglen-yii2-apns-gcm)[richardfan1126/yii2-js-register

Yii2 widget to register JS into view

1357.2k7](/packages/richardfan1126-yii2-js-register)[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)
