Hello ,
I am not getting a wright solution for my problem. Again i am explaining my problem below:
I just want to call a notification message in a xcart backend page on clicking a button on that page for
Mozila FireFox browser, And for that purpose i am using the curl request and the code for which i am using for the function is as below.
PHP Code:
public function sendPushMozila($sub_ids){
$url = 'https://updates.push.services.mozilla.com/wpush/v1/';
$headers = array(
'Content-Type: application/json',
'TTL: 600000'
);
foreach ($sub_ids as $key => $value) {
$final_url=$url.$value;
$ch = curl_init();
// Set the url, number of POST vars, POST data
curl_setopt($ch, CURLOPT_URL, $final_url);
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);
//var_dump($result); die;
curl_close($ch);
}
}
In the above code the
$sub_ids is the subscription ids of more then one user.
So please help me.
Thanks in Advance.