EdwinHoksberg Php Fcm Save

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

Project README

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.

Installation

Installation with composer:

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.

Tests

Run the unit tests with PHPUnit:

composer test

Before the first time you run them, you may need to run:

composer install

License

MIT

Open Source Agenda is not affiliated with "EdwinHoksberg Php Fcm" Project. README Source: EdwinHoksberg/php-fcm
Stars
66
Open Issues
23
Last Commit
7 months ago
License
MIT

Open Source Agenda Badge

Open Source Agenda Rating