PHP code example of moskalyovd / fcm-bundle

1. Go to this page and download the library: Download moskalyovd/fcm-bundle library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

moskalyovd / fcm-bundle example snippets

 php

// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
            new Moskalyovd\FCMBundle\MoskalyovdFCMBundle(),
    );
}
  
  
 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);
  }