代わりにタグを使用してください。メッセージを送信する相手の場合は、{email:[email protected]}のようにタグを設定します。
あなたの通知送信コードで、タグに基づいて人に送信してください。例えば
$content = array(
"en" => "hello jimmy"
);
$fields = array(
'app_id' => <your_ID_here> ,
'filters' => array(array("field" => "tag", "key" => "email", "relation" => "=", "value" => "[email protected]")),
'data' => array("foo" => "bar"),
'contents' => $content
);
$fields = json_encode($fields);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://onesignal.com/api/v1/notifications");
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=utf-8','Authorization: Basic '.$_SESSION['global_rest_id']));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HEADER, FALSE);
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
$response = curl_exec($ch);
curl_close($ch);