2017 © Pedro Peláez
 

library php-firebase-cloud-messaging

PHP API for Firebase Cloud Messaging from Google

image

redjanym/php-firebase-cloud-messaging

PHP API for Firebase Cloud Messaging from Google

  • Monday, July 16, 2018
  • by redjanym
  • Repository
  • 3 Watchers
  • 16 Stars
  • 41,888 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 73 Forks
  • 0 Open issues
  • 8 Versions
  • 29 % Grown

The README.md

PHP Firebase Cloud Messaging

Buy Me a Coffee at ko-fi.com, (*1)

PHP SDK for Firebase Cloud Messaging from Google, supporting HTTP V1., (*2)

See original Firebase docs: https://firebase.google.com/docs/, (*3)

Setup

Install via Composer:, (*4)

composer require redjanym/php-firebase-cloud-messaging

Or add this to your composer.json and run "composer update":, (*5)

"require": {
    "redjanym/php-firebase-cloud-messaging": "2.*"
}

Send message to a Device

use RedjanYm\FCM\Client;
use RedjanYm\FCM\Notification;
use RedjanYm\FCM\Recipient\Device;

$serviceAccountPath = '/path/to/service-account.json';
$testToken = 'this-is-a-token';

$client = new Client($serviceAccountPath);
$recipient = new Device($testToken);
$notification = new Notification($recipient, 'Title', 'Body', ['key' => 'value']);

$client->send($notification);

Topic Support

The current version does not have support for Topics. We are going to add it on v2.1., (*6)

Migrating from V1.

Unfortunately V2 of this package introduces breaking changes. But the new structure of the SDK is still simple and very similar to the previous one. We are sure the migration is going to be very fast and easy., (*7)

Interpreting responses

Responses given on the HTTP requests are standard according to the FCM documentations. You may find detailed specifications in this links: * https://firebase.google.com/docs/cloud-messaging/http-server-ref#interpret-downstream * https://firebase.google.com/docs/cloud-messaging/http-server-ref#error-codes, (*8)

The Versions

16/07 2018

dev-master

9999999-dev https://github.com/sngrl/php-firebase-cloud-messaging

PHP API for Firebase Cloud Messaging from Google

  Sources   Download

MIT

The Requires

 

The Development Requires

by Redjan Ymeraj
by Avatar Sngrl

php cloud google ios android firebase chrome notifications fcm

21/04 2018

v1.1.4

1.1.4.0 https://github.com/sngrl/php-firebase-cloud-messaging

PHP API for Firebase Cloud Messaging from Google

  Sources   Download

MIT

The Requires

 

The Development Requires

by Redjan Ymeraj
by Avatar Sngrl

php cloud google ios android firebase chrome notifications fcm

21/04 2018

dev-develop

dev-develop https://github.com/sngrl/php-firebase-cloud-messaging

PHP API for Firebase Cloud Messaging from Google

  Sources   Download

MIT

The Requires

 

The Development Requires

by Redjan Ymeraj
by Avatar Sngrl

php cloud google ios android firebase chrome notifications fcm

18/09 2017

v1.1.3

1.1.3.0 https://github.com/sngrl/php-firebase-cloud-messaging

PHP API for Firebase Cloud Messaging from Google

  Sources   Download

MIT

The Requires

 

The Development Requires

by Redjan Ymeraj
by Avatar Sngrl

php cloud google ios android firebase chrome notifications fcm

21/08 2017

v1.1.2

1.1.2.0 https://github.com/sngrl/php-firebase-cloud-messaging

PHP API for Firebase Cloud Messaging from Google

  Sources   Download

MIT

The Requires

 

The Development Requires

by Redjan Ymeraj
by Avatar Sngrl

php cloud google ios android firebase chrome notifications fcm

04/05 2017

v1.1.1

1.1.1.0 https://github.com/sngrl/php-firebase-cloud-messaging

PHP API for Firebase Cloud Messaging from Google

  Sources   Download

MIT

The Requires

 

The Development Requires

by Redjan Ymeraj
by Avatar Sngrl

php cloud google ios android firebase chrome notifications fcm

13/03 2017

v1.1

1.1.0.0 https://github.com/sngrl/php-firebase-cloud-messaging

PHP API for Firebase Cloud Messaging from Google

  Sources   Download

MIT

The Requires

 

The Development Requires

by Redjan Ymeraj
by Avatar Sngrl

php cloud google ios android firebase chrome notifications fcm

25/02 2017

v1.0

1.0.0.0 https://github.com/sngrl/php-firebase-cloud-messaging

PHP API for Firebase Cloud Messaging from Google

  Sources   Download

MIT

The Requires

 

The Development Requires

by Redjan Ymeraj
by Avatar Sngrl

php cloud google ios android firebase chrome notifications fcm