With the new update, FCM is now going to be used.
I tried the sample app from git and it\'s working all fine. I can send notifications from the console.
But
Try this below code this will give push notication for Android from php server side and you can get the device token from android you need pass dynamically to get push notication for more android device.
array($devicetoken));//get the device token from Android
$headers = array( 'Authorization: key=' . $api_key,'Content-Type: application/json');
$ch = curl_init();
curl_setopt( $ch, CURLOPT_URL, $url );
curl_setopt( $ch, CURLOPT_POST, true );
curl_setopt( $ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt( $ch, CURLOPT_POSTFIELDS, json_encode($fields) );
$result = curl_exec($ch);
if(curl_errno($ch)){
return 'Curl error: ' . curl_error($ch);
}
curl_close($ch);
$cur_message=json_decode($result);
if($cur_message->success==1)
return true;
else
return false;
}
?>