I am trying to send a push notification using my own API using below code. I am sure curl was enabled in my server. I am getting below as a response.
$url = "http://efpushtest.meteor.com/api/push";
# Our new data
$data = json_encode(array(
'message' => "this is venkat test push message",
'device' => "12345"
));
$ch = curl_init($url);
# Setting our options
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
# Get the response
$result = curl_exec($ch);
curl_close($ch);
Response:
{"success":false,"message":"Unexpected token u"}
I am not getting where i am going wrong with this code.