I am sending pushnotification to android devices from a php server,but some devices didn't get the pushnotification.
Here is the status from server
{"multicast_id":4893937277293136804,"success":4,"failure":10,"canonical_ids":0,"results":[{"error":"NotRegistered"},{"error":"NotRegistered"},{"error":"NotRegistered"},{"error":"NotRegistered"},{"message_id":"0:1452592669440333%c40440a4f9fd7ecd"},{"error":"NotRegistered"},{"error":"NotRegistered"},{"message_id":"0:1452592669442897%c40440a4f9fd7ecd"},{"error":"NotRegistered"},{"error":"NotRegistered"},{"message_id":"0:1452592669442899%c40440a4f9fd7ecd"},{"error":"NotRegistered"},{"error":"NotRegistered"},{"message_id":"0:1452592669442901%c40440a4f9fd7ecd"}]}
PHP
$key="XXXXXX";
$url = 'https://android.googleapis.com/gcm/send';
$fields = array(
'registration_ids' =>$result,
'data' => array( "message" =>$msg,"title"=>$title,"soundname"=>"beep.wav" ),
);
$headers = array(
'Authorization: key=' . $key,
'Content-Type: application/json'
);
try{
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt( $ch, CURLOPT_URL, $url );
curl_setopt( $ch, CURLOPT_POST, true );
curl_setopt( $ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
curl_setopt( $ch, CURLOPT_POSTFIELDS, json_encode( $fields ) );
$res = curl_exec($ch);
print_r($res)
}
From the response only 4 devices successfully get the response,but 10 failures is occurred.
Whats is the problem?