2017 © Pedro Peláez
 

library php-fcm

A library for sending Firebase cloud messages and managing user topic subscriptions, device groups and devices.

image

edwinhoksberg/php-fcm

A library for sending Firebase cloud messages and managing user topic subscriptions, device groups and devices.

  • Tuesday, April 17, 2018
  • by EdwinHoksberg
  • Repository
  • 1 Watchers
  • 3 Stars
  • 31 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 244 % Grown

The README.md

PHP-FCM Build Status Coverage Status Packagist Documentation

A PHP library for sending Firebase Cloud Messages and managing user topic subscriptions, device groups and devices., (*1)

Installation

Installation with composer:, (*2)

composer require edwinhoksberg/php-fcm

Quickstart

<?php

// Load composer
require 'vendor/autoload.php';

// Instantiate the client with the project api_token and sender_id.
$client = new \Fcm\FcmClient($apiToken, $senderId);

// Instantiate the push notification request object.
$notification = new \Fcm\Push\Notification();

// Enhance the notification object with our custom options.
$notification
    ->addRecipient($deviceId)
    ->setTitle('Hello from php-fcm!')
    ->setBody('Notification body')
    ->addData('key', 'value');

// Send the notification to the Firebase servers for further handling.
$client->send($notification);

Full documentation

Read the documentation here or look in the docs directory., (*3)

Tests

Run the unit tests with PHPUnit:, (*4)

composer test

Before the first time you run them, you may need to run:, (*5)

composer install

Windows TESTING

For local Windows Testing, you will need to install xdebug and add ```php.ini zend_extension=xdebug xdebug.mode=coverage, (*6)


and set composer.json scripts line to:
"scripts": {
    "test": ["vendor/bin/phpunit -c phpunit.dist.xml"]
},

## xUX TESTING: For local xUX or online github/codeforce testing, in composer.json set scripts line to:
"scripts": {
    "test": ["XDEBUG_MODE=coverage vendor/bin/phpunit -c phpunit.dist.xml"]
},

```, (*7)

License

MIT, (*8)

The Versions

17/04 2018

dev-master

9999999-dev https://github.com/EdwinHoksberg/php-fcm

A library for sending Firebase cloud messages and managing user topic subscriptions, device groups and devices.

  Sources   Download

MIT

The Requires

 

The Development Requires

google firebase notifications fcm firebase cloud messaging

09/04 2018

1.0.0

1.0.0.0 https://github.com/EdwinHoksberg/php-fcm

A library for sending Firebase cloud messages and managing user topic subscriptions, device groups and devices.

  Sources   Download

MIT

The Requires

 

The Development Requires

google firebase notifications fcm firebase cloud messaging