echo $sql= "SELECT * from status WHERE name = '$name' AND leavefrom = '$leavefrom' AND leaveto = '$leaveto'";$result = mysqli_query($con,$sql);
while($row = mysqli_fetch_assoc($result)) { echo $registrationIds = $row['token_id'];
$msg = array
(
'body' => $_POST['body'],
'title' => $_POST['title'],
'icon' => '',/*Default Icon*/
'sound' => 'mySound'/*Default sound*/
);
$fields = array
(
'to' => $registrationIds,
'notification' => $msg
);
$headers = array
(
'Authorization: key=' . API_ACCESS_KEY,
'Content-Type: application/json'
);
}
我无法使用上述代码向多个用户发送通知,它仅发送第一个用户通知。