<?php

$path_to_fcm = "https://fcm.googleapis.com/fcm/send";
$SERVER_KEY="AAAAKo6Vwqs:APA91bGXONjUl98bNWudbb6qkRBC0LS-F33H02PcPJKoCijd7frVhicURCOQUAkgtx1J2quOG6emBsL233XT2ZtT5rTy5JbTGvRHYgTSN00dWlrhluWCEuun0lshPCjzegp9ymnjqGgN";

$headers = array('Authorization:key='.$SERVER_KEY,
	'content-Type:application/json');

$fields = array('to'=>$key,'data'=>array('title'=>$title,'body'=>$message),'priority'=>'high');
$payload = json_encode($fields);
$curl_session = curl_init();
curl_setopt($curl_session, CURLOPT_URL, $path_to_fcm);
curl_setopt($curl_session, CURLOPT_POST, true);
curl_setopt($curl_session, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl_session, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl_session, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl_session, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
curl_setopt($curl_session, CURLOPT_POSTFIELDS, $payload);
$resp = curl_exec($curl_session);
?>