andrewscofield / parse.com-php-library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

subscription always shows as 0 when send notification to android using reset api

senthilcse opened this issue · comments

Hi,
We are new to Parse. We are try to send push notification from REST API but we get subscription always shows as 0 when send notification to android using reset api. But when we try from parse.com it will reached to mobile. Where we are make a mistake. Kindly help us to resolve the issue.

Here with am mentioned the code:

$data = array(
'channel' => '',
'type' => 'android',
'installationId'=>$d_device_token,
'data' => $pushmessage,
'action'=>'FA'
);
$_data = json_encode($data);

                        $headers = array(
                            'X-Parse-Application-Id: ' . $APPLICATION_ID,
                            'X-Parse-REST-API-Key: ' . $REST_API_KEY,
                            'Content-Type: application/json',
                            'Content-Length: ' . strlen($_data),
                        );

                        $curl = curl_init($url);
                        curl_setopt($curl,CURLOPT_RETURNTRANSFER, true);
                        curl_setopt($curl, CURLOPT_POST, 1);
                        curl_setopt($curl, CURLOPT_POSTFIELDS, $_data);
                        curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
                        $chk=curl_exec($curl);  
                        curl_close($curl);  

Notification does not send to android app. Kindly explain me what is going wrong?