can you determine what is the problem is my code. I am trying to send notification via parse from PHP code on my localhost but did not show result at all in my parse dashboard. Thank you in advance.
my php version : 5.5.28
<?php
require "connect.php";
require "parsePHP/autoload.php";
$app_id = "xxxxxxxxxxxxxxxxxxxxxxxxx";
$rest_key = "xxxxxxxxxxxxxxxxxxxxxxxxxx";
$master_key="xxxxxxxxxxxxxxxxxxxxxxxxxxxx";
$MESSAGE = "HI.. Testing";
use Parse\ParseClient;
use Parse\ParsePush;
ParseClient::initialize( $app_id, $rest_key, $master_key );
$url = 'https://api.parse.com/1/push';
$data = array(
'channel' => 'Android',
'type' => 'android',
'data' => array(
'alert' => $MESSAGE,
),
);
$_data = json_encode($data);
$headers = array(
'X-Parse-Application-Id: ' . $app_id,
'X-Parse-REST-API-Key: ' . $rest_key,
'Content-Type: application/json',
'Content-Length: ' . strlen($_data),
);
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, $_data);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_exec($curl);
?>