<?php

$tokens = file("tokens.txt", FILE_IGNORE_NEW_LINES);

$message = [
    "to" => $tokens,
    "sound" => "default",
    "title" => "Hello 👋",
    "body" => "This is a test notification",
    "data" => ["screen" => "home"]
];

$ch = curl_init("https://exp.host/--/api/v2/push/send");

curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "Content-Type: application/json"
]);

curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($message));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
curl_close($ch);

echo $response;