{
"to": "ExComponentPushToken[******] *********]",
"title": "Тестовое уведомление",
"body": "Это тестовое сообщение.",
"channelId": «по умолчанию»
когда я отправляю уведомление из POSTMAN, используя идентификатор канала по умолчанию
я получаю только значение по умолчанию
Код: Выделить всё
foreach ($tokens as $tokenRow) {
$deviceToken = $tokenRow['device_token'];
$message = [
'to' => $deviceToken,
'title' => 'NEW DOMESTIC ORDER',
'body' => 'You have new orders waiting to be accepted.',
'channelId' => 'default'
];
// Send the notification
$ch = curl_init("https://exp.host/--/api/v2/push/send");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Accept: application/json',
'Content-Type: application/json',
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($message));
$response = curl_exec($ch);
if ($response === false) {
error_log('Curl error: ' . curl_error($ch));
}
curl_close($ch);
}
=
он отправляется в раздел «Разное»
Подробнее здесь: https://stackoverflow.com/questions/787 ... id-from-ph