2017 © Pedro Peláez
 

library gcm-message

A PHP library to send messages to devices registered through Google Cloud Messaging

image

bigbank/gcm-message

A PHP library to send messages to devices registered through Google Cloud Messaging

  • Tuesday, June 28, 2016
  • by bigbank
  • Repository
  • 9 Watchers
  • 0 Stars
  • 87 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Google Cloud Messaging (GCM)

A PHP library to send messages to devices registered through Google Cloud Messaging, (*1)

See GCM documentation: http://developer.android.com/guide/google/gcm/index.html, (*2)

Example usage

``` php, (*3)

use Bigbank\Gcm\Sender; use Bigbank\Gcm\Message;, (*4)

$sender = new Sender("YOUR GOOGLE API KEY", $GcmEndpoint);, (*5)

$message = new Message( ["device_registration_id1", "device_registration_id2"], ["data1" => "123", "data2" => "string"] );, (*6)

$message ->notification(["title" => "foo", "body" => "bar"]) ->setCollapseKey("collapse_key") ->setDelayWhileIdle(true) ->setTtl(123) ->setRestrictedPackageName("com.example") ->setDryRun(true) ;, (*7)

try { $response = $sender->send($message); } catch (\Exception $exception) { throw new \Exception($exception->getMessage()); }, (*8)


Note about cURL SSL verify peer option ----------------------- Library has turned off CURLOPT_SSL_VERIFYPEER by default, but you can enable it by passing third parameter into constructor of Sender class. You need to [download](http://curl.haxx.se/docs/caextract.html) root certificates and add them somewhere into your project directory. Then construct Sender object like this: ``` php use Bigbank\Gcm\Sender; $sender = new Sender("YOUR GOOGLE API KEY", $GcmEndpoint, "/path/to/cacert.crt");

Contributing

Please see CONTRIBUTING and CONDUCT for details., (*9)

Credits

  • [Bigbank's developers][link-bb-developers]
  • [All Contributors][link-contributors]

License

The Apache 2 License. Please see License File for more information., (*10)

The Versions

28/06 2016

dev-master

9999999-dev

A PHP library to send messages to devices registered through Google Cloud Messaging

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Aivar Somelar

gcm android iphone push message

28/06 2016

dev-develop

dev-develop

A PHP library to send messages to devices registered through Google Cloud Messaging

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Aivar Somelar

gcm android iphone push message

28/06 2016

1.0.1

1.0.1.0

A PHP library to send messages to devices registered through Google Cloud Messaging

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Aivar Somelar

gcm android iphone push message

02/06 2016

1.0.0

1.0.0.0

A PHP library to send messages to devices registered through Google Cloud Messaging

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Aivar Somelar

gcm android iphone push message