消息已发送,但是我的徽标没有出现,没有文本或标题。 出现默认徽标和消息。 问题是我没有出现在数组中,而是一切都作为证据。 我做错了什么?
while($news = mysqli_fetch_assoc($resultz2)){
$results[$i++] = $news['id_firebase'];
}
$curl = curl_init();
$arrNotificationMessage = array(
"title" => "Azzzxxccc",
"body" => "El usuario ".$nombre." ".$apelido." A terminado jornada sin pausa de comida. En nuestra sistema aparece que tiene la jornada partida. Es posible que a olvidado o se trata de un error.",
'priority'=>"high",
"icon" => "Logo.jpg",
"click_action" => "https://www.zzz.ccc",
"sound" => "default"
);
curl_setopt_array($curl, array(
CURLOPT_URL => "https://fcm.googleapis.com/fcm/send",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\"registration_ids\":".json_encode($results).", \"notification\": ".json_encode($notificationMessage).",}",
CURLOPT_HTTPHEADER => array(
"authorization: key=AAAAVyWZFJw:.......",
"content-type: application/json",
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}