2017 © Pedro Peláez
 

yii2-extension yii2-fcm

Yii2 Firebase Cloud Messaging adapter

image

understeam/yii2-fcm

Yii2 Firebase Cloud Messaging adapter

  • Friday, November 11, 2016
  • by AnatolyRugalev
  • Repository
  • 2 Watchers
  • 7 Stars
  • 7,331 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 4 Forks
  • 3 Open issues
  • 3 Versions
  • 16 % Grown

The README.md

Yii2 Firebase Cloud Messaging

This component wraps paragraph1/php-fcm library., (*1)

Installation

Preferred way to install is through Composer:, (*2)

$ composer require understeam/yii2-fcm:~0.1 --prefer-dist 

Configuration

Add component to your application config:, (*3)

...
'components' => [
    'fcm' => [
        'class' => 'understeam\fcm\Client',
        'apiKey' => 'your API key', // Server API Key (you can get it here: https://firebase.google.com/docs/server/setup#prerequisites) 
    ],
],
...

Usage

You can find more usage examples here., (*4)

$note = Yii::$app->fcm->createNotification("test title", "testing body");
$note->setIcon('notification_icon_resource_name')
    ->setColor('#ffffff')
    ->setBadge(1);

$message = Yii::$app->fcm->createMessage();
$message->addRecipient(new Device('your-device-token'));
$message->setNotification($note)
    ->setData(['someId' => 111]);

$response = Yii::$app->fcm->send($message);
var_dump($response->getStatusCode());

The Versions

11/11 2016

dev-master

9999999-dev

Yii2 Firebase Cloud Messaging adapter

  Sources   Download

MIT

The Requires

 

by Anatoly Rugalev

11/11 2016

v0.2.0

0.2.0.0

Yii2 Firebase Cloud Messaging adapter

  Sources   Download

MIT

The Requires

 

by Anatoly Rugalev

11/11 2016

v0.1

0.1.0.0

Yii2 Firebase Cloud Messaging adapter

  Sources   Download

MIT

The Requires

 

by Anatoly Rugalev