2017 © Pedro Peláez
 

library php-gcm

A PHP library for sending GCM messages

image

php-gcm/php-gcm

A PHP library for sending GCM messages

  • Friday, June 24, 2016
  • by lkorth
  • Repository
  • 15 Watchers
  • 183 Stars
  • 116,748 Installations
  • PHP
  • 7 Dependents
  • 0 Suggesters
  • 48 Forks
  • 11 Open issues
  • 6 Versions
  • 6 % Grown

The README.md

php-gcm

Build Status Total Downloads, (*1)

Why

Google Cloud Messaging for Android 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., (*2)

Support

php-gcm supports the HTTP server protocol for GCM. There is not currently support for XMPP, but implementations and pull requests for XMPP are welcome. See #3 for more details., (*3)

php-gcm supports PHP versions >= 5.3.10. php-gcm may work on older versions of PHP, but has not been tested on them., (*4)

Install

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

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

And run Composer to install php-gcm:, (*6)

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

Latest

php-gcm follows SEMVER. If you would like to try out the latest, possibly unstable or incorrect code, the dependency can be pointed to dev-master., (*7)

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

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

php-gcm is licensed under the Apache 2.0 License. See the LICENSE file for more details., (*8)

The Versions

24/06 2016

dev-master

9999999-dev https://github.com/lkorth/php-gcm

A PHP library for sending GCM messages

  Sources   Download

Apache-2.0

The Requires

  • ext-curl *
  • php >=5.3.10

 

The Development Requires

by Luke Korth

php library gcm android

06/05 2015

1.1.1

1.1.1.0 https://github.com/lkorth/php-gcm

A PHP library for sending GCM messages

  Sources   Download

Apache-2.0

The Requires

  • php >=5.3.10
  • ext-curl *

 

by Luke Korth

php library gcm android

10/03 2015

1.1.0

1.1.0.0 https://github.com/lkorth/php-gcm

A PHP library for sending GCM messages

  Sources   Download

Apache-2.0

The Requires

  • php >=5.3.29
  • ext-curl *

 

by Luke Korth

php library gcm android

20/12 2013

1.0.2

1.0.2.0 https://github.com/lkorth/php-gcm

A PHP library for sending GCM messages

  Sources   Download

Apache-2.0

by Luke Korth

php library gcm android

26/07 2013

1.0.1

1.0.1.0 https://github.com/lkorth/php-gcm

A PHP library for sending GCM messages

  Sources   Download

Apache-2.0

by Luke Korth

php library gcm

13/06 2013

1.0.0

1.0.0.0 https://github.com/lkorth/php-gcm

A PHP library for sending GCM messages

  Sources   Download

Apache-2.0

by Luke Korth

php library gcm