how to send push notifications to iphone using fcm(firebase console) in PHP?
<p>While sending the notification from firebase console Notification is working fine. </p>

<p><a href="https://i.stack.imgur.com/K7b0w.png" rel="noreferrer"><img src="https://i.stack.imgur.com/K7b0w.png" alt="firebase console"></a></p>

<p>I am getting push notifications on ios device.</p>

<p>Here is the code that I am using to send push notifications to iphone in php using FCM..</p>

<pre><code>&lt;?php  $ch = curl_init("https://fcm.googleapis.com/fcm/send");

    //The device token.
    $token = "";

    //Title of the Notification.
    $title = "Carbon";

    //Body of the Notification.
    $body = "Bear island knows no king but the king in the north, whose name is stark.";

    //Creating the notification array.
    $notification = array('title' =&gt;$title , 'text' =&gt; $body);

    //This array contains, the token and the notification. The 'to' attribute stores the token.
    $arrayToSend = array('to' =&gt; $token, 'notification' =&gt; $notification);
    //Generating JSON encoded string form the above array.
    $json = json_encode($arrayToSend);

    //Setup headers:
    $headers = array();
    $headers[] = 'Content-Type: application/json';
    $headers[] = 'Authorization: key= abcdgfdk'; //server key here

    //Setup curl, add headers and post parameters.
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");                                                                     
    curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
    curl_setopt($ch, CURLOPT_HTTPHEADER,$headers);       

    //Send the request
    $response = curl_exec($ch);

    //Close request
    curl_close($ch);
    return $response; ?&gt;
</code></pre>

<p>And it returns the following response:</p>

<pre><code>{"multicast_id":7847791275395796141,"success":1,"failure":0,"canonical_ids":0,"results":[{"message_id":"0:1473926169782959%51b989d251b989d2"}]}
</code></pre>

<p>Please suggest me what I am doing wrong? I use same code for android too with its server key and device token and it is working fine...</p>