below is my code which i use to execute Push to Chrome Users , now I want to notification to firefox Users , and i know that it will be now targetted via url "https://updates.push.services.mozilla.com/push"
But I don't know what I have to do.
My Code working for Chrome is Provided below .
<?php
include('header.php');
define( 'API_ACCESS_KEY', '[API-KEY comes here]' );
$sql="SELECT * FROM user_data";
$result = mysqli_query($conn, $sql) or die ('Error'.mysqli_error($conn));
$registrationIds=array();
while($row=mysqli_fetch_assoc($result)){
$registrationIds[] = $row['allow'];
}
$ids=json_encode($registrationIds);
$fields = array
(
'registration_ids' => $registrationIds
);
$headers = array
(
'Authorization: key=' . API_ACCESS_KEY,
'Content-Type: application/json'
);
$ch = curl_init();
curl_setopt( $ch,CURLOPT_URL, 'https://android.googleapis.com/gcm/send' );
curl_setopt( $ch,CURLOPT_POST, true );
curl_setopt( $ch,CURLOPT_HTTPHEADER, $headers );
curl_setopt( $ch,CURLOPT_RETURNTRANSFER, true );
curl_setopt( $ch,CURLOPT_SSL_VERIFYPEER, false );
curl_setopt( $ch,CURLOPT_POSTFIELDS, json_encode( $fields ) );
$result = curl_exec($ch );
curl_close( $ch );
echo $result;
?>