Skip to content

Instantly share code, notes, and snippets.

@jirawatee
Last active October 17, 2017 09:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jirawatee/32db29270801b6d1026013b9e0afdb9d to your computer and use it in GitHub Desktop.
Save jirawatee/32db29270801b6d1026013b9e0afdb9d to your computer and use it in GitHub Desktop.
FCM - fcm-request.php
<?php
include_once 'FCM.php';
/*
$token = array('TOKEN1', 'TOKEN2');
*/
$token = array();
$notification = array(
'title' => 'Google I/O 2016',
'body' => 'Firebase Cloud Messaging (Server)', // Required for iOS
'sound' => 'default',
'badge' => 1,
'click_action' => 'OPEN_ACTIVITY_1'
);
$data = array(
'picture_url' => 'http://opsbug.com/static/google-io.jpg'
);
$fcm = new FCM();
$fcm->send_notification($token, $notification, $data);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment