<?php

use paragraph1\phpFCM\Client;
use paragraph1\phpFCM\Message;
use paragraph1\phpFCM\Recipient\Device;
use paragraph1\phpFCM\Notification;

require_once './vendor2/autoload.php';

$apiKey = 'AAAAUIPuo9U:APA91bEtj0DSWetgVYZ-T9oPGmvtvINdrwsEAipQr2pprFUCb-9HTMUFBb6BOQH6p76CNbu7MpX5lhVBiVsDhPIgayMvjHzwDQBfcrmmTVilvGDPoNFEFWXPFUST5f0vcL6llnpPPbbk';
$client = new Client();
$client->setApiKey($apiKey);
$client->injectHttpClient(new \GuzzleHttp\Client());

$note = new Notification('test tsitle', 'testings body');
$note->setIcon('notification_icon_resource_name')
    ->setColor('#ffffff')
    ->setBadge(1);

$message = new Message();
$message->addRecipient(new Device('fsKYBO97Rw-ecSutXrEJ0S:APA91bEWmQAXIMRLYeIyG5IEo8ToHkXpYMicXcqn-LOWrHGlFgFppft6e0oo9zFvHhh9RM_7Qjn_lin5_dLv-bqckvDXSPp8hu9-pBEmb24SiyhLTMiAA9_w_gf3HQrAW7uuEKnaRiQg'));
$message->setNotification($note)
    ->setData(array('somedId' => 1112));

$response = $client->send($message);
var_dump($response->getStatusCode());
?>