moskalyovd/fcm-bundle

There is no license information available for the latest version (v0.3) of this package.

Symfony bundle for Firebase Cloud Messaging

v0.3 2018-01-23 09:09 UTC

This package is not auto-updated.

Last update: 2024-05-15 02:48:58 UTC


README

Symfony bundle for Firebase Cloud Messaging

Installation

To use this bundle in your project add following lines to your composer.json:

  "require": {
      "moskalyovd/fcm-bundle": "^0.2"
  }

and enable it in your AppKernel.php:

<?php
// app/AppKernel.php

public function registerBundles()
{
  $bundles = array(
          new Moskalyovd\FCMBundle\MoskalyovdFCMBundle(),
  );
}

Configuration

moskalyovd_fcm:
    server_key: 'your_server_key'

Usage

<?php
public function testAction()
{
      $client = $this->get('moskalyovd_fcm.client');

      $message = new Message();
      $message->addRecipient(new Device('token'));
      $message->setNotification(new Notification('Title', 'Body'));

      $response = $client->send($message);
}

For more information please reffer to php-fcm library