PHPackages                             intersvyaz/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. [API Development](/categories/api)
4. /
5. intersvyaz/yii2-apns-gcm

ActiveYii2-extension[API Development](/categories/api)

intersvyaz/yii2-apns-gcm
========================

Yii 2 Apns and Gcm together

1.0.7(3y ago)110.3k1MITPHP

Since Feb 19Pushed 3y ago6 watchersCompare

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

READMEChangelog (5)Dependencies (2)Versions (11)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 intersvyaz/yii2-apns-gcm "1.0.5"

```

or add

```
"intersvyaz/yii2-apns-gcm": "1.0.5"

```

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',
	]
]
```

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

34

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 80.8% 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 ~389 days

Recently: every ~593 days

Total

8

Last Release

1421d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/03f36c54791162f622dde8344f3008eeb39d52d2eca72f2a4af5516da92579a3?d=identicon)[intersvyaz-it](/maintainers/intersvyaz-it)

---

Top Contributors

[![bryglen](https://avatars.githubusercontent.com/u/875604?v=4)](https://github.com/bryglen "bryglen (21 commits)")[![intersvyaz-it](https://avatars.githubusercontent.com/u/4456658?v=4)](https://github.com/intersvyaz-it "intersvyaz-it (2 commits)")[![apalych](https://avatars.githubusercontent.com/u/60067867?v=4)](https://github.com/apalych "apalych (1 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/intersvyaz-yii2-apns-gcm/health.svg)

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

###  Alternatives

[bryglen/yii2-apns-gcm

Yii 2 Apns and Gcm together

54282.3k2](/packages/bryglen-yii2-apns-gcm)

PHPackages © 2026

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