Приведенный ниже код также отправляет всем пользователям, зарегистрировавшим свой токен, и одновременно отправляет множество уведомлений, хотя токен предназначен для конкретного устройства. но он продолжает рассылать уведомления всем
Код: Выделить всё
$key = "ExponentPushToken[0GAEokJazChx21MOxeC1l2]";
$title = "title";
$interestDetails = ['https://exp.host/--/api/v2/push/send',$key];
try{
$expo = \ExponentPhpSDK\Expo::normalSetup();
// Subscribe the recipient to the server
$expo->subscribe($interestDetails[0], $interestDetails[1]);
// Build the notification data
$notification = ['title' => $title,'body' => $msg];
// Notify an interest with a notification
$expo->notify($notification);
$status = 'success';
}catch(Exception $e){
}
?>
Код: Выделить всё
Подробнее здесь: https://stackoverflow.com/questions/529 ... n-with-php
Мобильная версия