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

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

php-gcm/php-gcm
===============

A PHP library for sending GCM messages

1.1.1(11y ago)180415.3k↓29.5%44[10 issues](https://github.com/lkorth/php-gcm/issues)[2 PRs](https://github.com/lkorth/php-gcm/pulls)6Apache-2.0PHPPHP &gt;=5.3.10

Since Jun 13Pushed 7y ago14 watchersCompare

[ Source](https://github.com/lkorth/php-gcm)[ Packagist](https://packagist.org/packages/php-gcm/php-gcm)[ Docs](https://github.com/lkorth/php-gcm)[ RSS](/packages/php-gcm-php-gcm/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (6)Used By (6)

php-gcm
=======

[](#php-gcm)

[![Build Status](https://camo.githubusercontent.com/b0850a805a5d082e7e8a03852514aa3c914b6c4e89471f6e516c2a29afcaa03a/68747470733a2f2f7472617669732d63692e6f72672f6c6b6f7274682f7068702d67636d2e7376673f6272616e63683d747261766973)](https://travis-ci.org/lkorth/php-gcm)[![Total Downloads](https://camo.githubusercontent.com/83c2e43719431935f80f7766f47b6c430824092cf47b83a64063d33c7ebadab4/68747470733a2f2f706f7365722e707567782e6f72672f7068702d67636d2f7068702d67636d2f646f776e6c6f616473)](https://packagist.org/packages/php-gcm/php-gcm)

Why
---

[](#why)

[Google Cloud Messaging for Android](http://developer.android.com/google/gcm/index.html) is very powerful, but there are a lot of details to handle. This library takes care of the details and makes GCM very easy to use with PHP.

Support
-------

[](#support)

php-gcm supports the [HTTP server protocol](https://developers.google.com/cloud-messaging/server) for GCM. There is not currently support for XMPP, but implementations and pull requests for XMPP are welcome. See [\#3](https://github.com/lkorth/php-gcm/issues/3) for more details.

php-gcm supports PHP versions &gt;= 5.3.10. php-gcm may work on older versions of PHP, but has not been tested on them.

Install
-------

[](#install)

Composer is the easiest way to manage dependencies in your project. Create a file named composer.json with the following:

```
{
    "require": {
        "php-gcm/php-gcm": "^1.1.1"
    }
}
```

And run Composer to install php-gcm:

```
$ curl -s http://getcomposer.org/installer | php
$ composer.phar install
```

### Latest

[](#latest)

php-gcm follows [SEMVER](http://semver.org/). If you would like to try out the latest, possibly unstable or incorrect code, the dependency can be pointed to `dev-master`.

```
{
    "require": {
        "php-gcm/php-gcm": "dev-master"
    }
}
```

Usage
-----

[](#usage)

```
$sender = new Sender($gcmApiKey);
$message = new Message($collapseKey, $payloadData);

try {
    $result = $sender->send($message, $deviceRegistrationId, $numberOfRetryAttempts);
} catch (\InvalidArgumentException $e) {
    // $deviceRegistrationId was null
} catch (PHP_GCM\InvalidRequestException $e) {
    // server returned HTTP code other than 200 or 503
} catch (\Exception $e) {
    // message could not be sent
}
```

License
-------

[](#license)

php-gcm is licensed under the Apache 2.0 License. See the [LICENSE](LICENSE) file for more details.

###  Health Score

43

—

FairBetter than 91% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity53

Moderate usage in the ecosystem

Community28

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 93.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 ~173 days

Total

5

Last Release

4030d ago

PHP version history (2 changes)1.1.0PHP &gt;=5.3.29

1.1.1PHP &gt;=5.3.10

### Community

Maintainers

![](https://www.gravatar.com/avatar/586e1e86c77aca12d6cd466728073ec4f6e2040463b3381ca48f3cd2d12ec469?d=identicon)[lkorth](/maintainers/lkorth)

---

Top Contributors

[![lkorth](https://avatars.githubusercontent.com/u/1163999?v=4)](https://github.com/lkorth "lkorth (70 commits)")[![chancezeus](https://avatars.githubusercontent.com/u/2089196?v=4)](https://github.com/chancezeus "chancezeus (2 commits)")[![Charl13](https://avatars.githubusercontent.com/u/2190306?v=4)](https://github.com/Charl13 "Charl13 (2 commits)")[![cainmi](https://avatars.githubusercontent.com/u/78037272?v=4)](https://github.com/cainmi "cainmi (1 commits)")

---

Tags

phplibrarygcmandroid

### Embed Badge

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

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

###  Alternatives

[sly/notification-pusher

Standalone PHP library for easy devices notifications push.

1.2k2.8M15](/packages/sly-notification-pusher)[paragraph1/php-fcm

PHP application server for google firebase cloud messaging (FCM)

1991.2M10](/packages/paragraph1-php-fcm)[kedniko/firebase-cloud-messaging-http-v1-php

Firebase cloud messaging http v1 php

124.8k](/packages/kedniko-firebase-cloud-messaging-http-v1-php)

PHPackages © 2026

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