Hi, i have a problame with send nothifiction from php
the function is:
function send_notification($message)
{
Code: Select all
// Set POST variables
$url = '[url=https://api.appery.io/rest/push/msg/key]https://api.appery.io/rest/push/msg/key[/url]';
$fields = array(
'channels' = 0000,
'message' = $message,
'badge' = 0,
'deviceID' = ''
);
$headers = array(
'X-Appery-Push-Master-Key: MYMASTERKEY',
'Content-Type: application/json'
);
// Open connection
$ch = curl_init();
// Set the url, number of POST vars, POST data
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// Disabling SSL Certificate support temporarly
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($fields));
// Execute post
$result = curl_exec($ch);
if ($result === FALSE) {
die('Curl failed: ' . curl_error($ch));
}
// Close connection
curl_close($ch);
echo $result;
} the eror is:
{"code":"PNMM007","description":"Serialization error"}
some one can help me please?
thank you,
-Meni