PHPackages                             spitalia/push-notification-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. spitalia/push-notification-gcm

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

spitalia/push-notification-gcm
==============================

PushNotificationGCM is small PHP library for send push notification to Android and iOS mobile devices.

26161PHP

Since Jul 16Pushed 10y ago3 watchersCompare

[ Source](https://github.com/Qwince/google-gcm-push-notification)[ Packagist](https://packagist.org/packages/spitalia/push-notification-gcm)[ RSS](/packages/spitalia-push-notification-gcm/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Push Notification GCM
=====================

[](#push-notification-gcm)

Google GCM Push Notification is small PHP library for send push notification to Android and iOS mobile devices.

Install
-------

[](#install)

Please follow the guide [Google GCM](https://developers.google.com/cloud-messaging/) for configure the API Key.

- [iOS guide](https://developers.google.com/cloud-messaging/ios/client)
- [Android guide](https://developers.google.com/cloud-messaging/android/client)

### Composer

[](#composer)

The preferred way to install Push Notification GCM is via [composer](http://getcomposer.org/).

Add in your `composer.json`:

```
"require": {
	...
	"spitalia/push-notification-gcm": "dev-master"

}

```

then update your dependencies with `composer update`.

Start usage
-----------

[](#start-usage)

```
    $pushNotificationGCM = new PushNotificationGCM($google_api_key);
    $devices = array($devicetoken);
    $message = ['data' => ['message' => 'hello', 'reason' => 'new_event']];

    try {
        foreach($devices as $devicetoken){
            $pushNotificationGCM->addDevice($devicetoken);
        }
        // set this for send silent push notification
        $pushNotificationGCM->silent_notification = true;

        // set the title of badge
        $pushNotificationGCM->default_title_notification = APP_TITLE;

        // set this for set verbose the variable $pushNotificationGCM->reponseGCM
        $pushNotificationGCM->debug = true;

        $pushNotificationGCM->addMessage($message);
        $pushNotificationGCM->push();

        // The array $pushNotificationGCM->reponseGCM contains array('success'=>array(),'failure'=>array()); if debug is true return other keys

    }catch (PushNotificationGCMException $e){
        echo 'Error code: '.$e->getPushNotificationCode()." - ".$e->getMessage();
    } catch(Exception $e){
        echo $e->getMessage();
    }

```

Creators
--------

[](#creators)

**Securproject.it Team**

Licence
-------

[](#licence)

Free for commercial and non-commercial use ([Apache License](http://www.apache.org/licenses/LICENSE-2.0.html) or [GPL](http://www.gnu.org/licenses/gpl-2.0.html)).

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/179a2a84b2ba68087b19fd0a3089bca740e4e0a68cf285134f4ae71a9bea0a36?d=identicon)[spitalia](/maintainers/spitalia)

![](https://www.gravatar.com/avatar/ae1fda17cc5f96f0976583f107d1960b1de32c681af44b2d25f6ece20d967abe?d=identicon)[stefanotodaro](/maintainers/stefanotodaro)

---

Top Contributors

[![spitalia](https://avatars.githubusercontent.com/u/8568720?v=4)](https://github.com/spitalia "spitalia (11 commits)")

### Embed Badge

![Health badge](/badges/spitalia-push-notification-gcm/health.svg)

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

###  Alternatives

[minishlink/web-push

Web Push library for PHP

1.9k12.0M53](/packages/minishlink-web-push)[laravel-notification-channels/twilio

Provides Twilio notification channel for Laravel

2587.7M12](/packages/laravel-notification-channels-twilio)[spatie/url-signer

Generate a url with an expiration date and signature to prevent unauthorized access

4422.3M16](/packages/spatie-url-signer)[mattketmo/email-checker

Throwaway email detection library

2742.0M5](/packages/mattketmo-email-checker)[laravel-notification-channels/discord

Laravel notification driver for Discord.

2371.3M11](/packages/laravel-notification-channels-discord)[eduardokum/laravel-mail-auto-embed

Library for embed images in emails automatically

1702.0M5](/packages/eduardokum-laravel-mail-auto-embed)

PHPackages © 2026

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