2017 © Pedro Peláez
 

library php-fcm

PHP application server for google firebase cloud messaging (FCM)

image

lutskanu/php-fcm

PHP application server for google firebase cloud messaging (FCM)

  • Tuesday, August 2, 2016
  • by lutskanu
  • Repository
  • 1 Watchers
  • 0 Stars
  • 22 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 43 Forks
  • 0 Open issues
  • 11 Versions
  • 0 % Grown

The README.md

phpFCM

Build Status Coverage Status Latest Stable Version Total Downloads License, (*1)

PHP application server implementation for Firebase Cloud Messaging. - supports device and topic messages - currently this app server library only supports sending Messages/Notifications via HTTP. - thanks to guzzle our library answers in PSR7 compatible response objects - see the full docs on firebase cloud messaging here : https://firebase.google.com/docs/cloud-messaging/ - Firebase Cloud Messaging HTTP Protocol: https://firebase.google.com/docs/cloud-messaging/http-server-ref#send-downstream for in-depth description, (*2)

Setup

The recommended way of installing is using Composer., (*3)

command line, (*4)

composer require paragraph1/php-fcm

composer.json, (*5)

"require": {
    "paragraph1/php-fcm": "*"
}

Send to Device

also see https://firebase.google.com/docs/cloud-messaging/downstream, (*6)

use paragraph1\phpFCM\Client;
use paragraph1\phpFCM\Message;
use paragraph1\phpFCM\Recipient\Device;
use paragraph1\phpFCM\Notification;

require_once 'vendor/autoload.php';

$apiKey = 'YOUR SERVER KEY';
$client = new Client();
$client->setApiKey($apiKey);
$client->injectHttpClient(new \GuzzleHttp\Client());

$note = new Notification('test title', 'testing body');
$note->setIcon('notification_icon_resource_name')
    ->setColor('#ffffff')
    ->setBadge(1);

$message = new Message();
$message->addRecipient(new Device('your-device-token'));
$message->setNotification($note)
    ->setData(array('someId' => 111));

$response = $client->send($message);
var_dump($response->getStatusCode());

Send to topic

also see https://firebase.google.com/docs/cloud-messaging/topic-messaging, (*7)

use paragraph1\phpFCM\Client;
use paragraph1\phpFCM\Message;
use paragraph1\phpFCM\Recipient\Topic;
use paragraph1\phpFCM\Notification;

require_once 'vendor/autoload.php';


$apiKey = 'YOUR SERVER KEY';
$client = new Client();
$client->setApiKey($apiKey);
$client->injectHttpClient(new \GuzzleHttp\Client());

$message = new Message();
$message->addRecipient(new Topic('your-topic'));
$message->setNotification(new Notification('test title', 'testing body'))
    ->setData(array('someId' => 111));

$response = $client->send($message);
var_dump($response->getStatusCode());

The Versions

02/08 2016

dev-master

9999999-dev https://github.com/Paragraph1/phpFCM

PHP application server for google firebase cloud messaging (FCM)

  Sources   Download

MIT

The Requires

 

The Development Requires

by Patrick Albertini
by Kai Bielenberg

php google ios gcm android firebase notifications fcm firebase cloud messaging

02/08 2016

0.6.3

0.6.3.0 https://github.com/Paragraph1/phpFCM

PHP application server for google firebase cloud messaging (FCM)

  Sources   Download

MIT

The Requires

 

The Development Requires

by Patrick Albertini
by Kai Bielenberg

php google ios gcm android firebase notifications fcm firebase cloud messaging

02/08 2016

0.6.2

0.6.2.0 https://github.com/Paragraph1/phpFCM

PHP application server for google firebase cloud messaging (FCM)

  Sources   Download

MIT

The Requires

 

The Development Requires

by Patrick Albertini
by Kai Bielenberg

php google ios gcm android firebase notifications fcm firebase cloud messaging

02/08 2016

0.6.1

0.6.1.0 https://github.com/Paragraph1/phpFCM

PHP application server for google firebase cloud messaging (FCM)

  Sources   Download

MIT

The Requires

 

The Development Requires

by Patrick Albertini
by Kai Bielenberg

php google ios gcm android firebase notifications fcm firebase cloud messaging

02/08 2016

dev-feature/data-encryption

dev-feature/data-encryption https://github.com/Paragraph1/phpFCM

PHP application server for google firebase cloud messaging (FCM)

  Sources   Download

MIT

The Requires

 

The Development Requires

by Patrick Albertini
by Kai Bielenberg

php google ios gcm android firebase notifications fcm firebase cloud messaging

02/08 2016

0.6

0.6.0.0 https://github.com/Paragraph1/phpFCM

PHP application server for google firebase cloud messaging (FCM)

  Sources   Download

MIT

The Requires

 

The Development Requires

by Patrick Albertini
by Kai Bielenberg

php google ios gcm android firebase notifications fcm firebase cloud messaging

15/06 2016

0.5

0.5.0.0 https://github.com/Paragraph1/phpFCM

PHP application server for google firebase cloud messaging (FCM)

  Sources   Download

MIT

The Requires

 

The Development Requires

by Patrick Albertini
by Kai Bielenberg

php google ios gcm android firebase notifications fcm firebase cloud messaging

02/06 2016

0.4

0.4.0.0 https://github.com/Paragraph1/phpFCM

PHP application server for google firebase cloud messaging (FCM)

  Sources   Download

MIT

The Requires

 

The Development Requires

by Patrick Albertini
by Kai Bielenberg

php google ios android firebase notifications fcm

02/06 2016

0.3

0.3.0.0 https://github.com/Paragraph1/phpFCM

PHP application server for google firebase cloud messaging (FCM)

  Sources   Download

MIT

The Requires

 

The Development Requires

by Patrick Albertini
by Kai Bielenberg

php google ios android firebase notifications fcm

02/06 2016

0.2

0.2.0.0 https://github.com/Paragraph1/phpFCM

PHP application server for google firebase cloud messaging (FCM)

  Sources   Download

MIT

The Requires

 

The Development Requires

by Patrick Albertini
by Kai Bielenberg

php google ios android firebase notifications fcm

02/06 2016

0.1

0.1.0.0 https://github.com/Paragraph1/phpFCM

PHP application server for google firebase cloud messaging (FCM)

  Sources   Download

MIT

The Requires

 

The Development Requires

by Patrick Albertini
by Kai Bielenberg

php google ios android firebase notifications fcm