On the OneSignal list of “All Users”, users who have not received notifications have “location points” with expected latitude and long coordinates set, and subscribe to users. I have received no location delivery Notifications, so the process of sending and receiving notifications is valid.
I have added this line to my AndroidManifest.xml file:
There is also this line in my .run function:
window.plugins. OneSignal.promptLocation();
My php sends the request to OneSignal:
$content = $_GET['content'];
$lat = $_GET['lat'];
$long = $_GET['long'];
$radius = $_GET['radius'];
$response = sendMessage($content, $lat, $long, $radius);
function sendMessage($message, $lat, $long, $radius){
$content = array (
"en" => $message
);
$fields = array(
'app_id' => "aaaaaa-eeee-yyyyy-xxxx-zzzz ",
'filters' => array(array("field" => "location", "radius" => $radius, "lat" => $lat, "long" => $long)),
//'filters' => array(array("field" => "location", "radius" => "1000", "lat" => "55.81 9329", "long" => "-4.1696119")),
'included_segments' => array('All'),
'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 FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HEADER, br /> 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);
return $response;
}
Request:
< p>
{content: "test" , lat: "55.8653169", long: "-4.1696119", radius: "1000"}
Response:
{allresponses: "{"id ":"","recipients":0,"errors":["All included players are not subscribed"]}"}
>Make sure you have set the correct app_id.
>You There are no subscribed users.
>You have not set the platform for your device on the “App Settings” page of the OneSignal dashboard.
>There are no users in the filter.
In your case Down, the location may exceed 1000 meters. Try to increase the radius and confirm that you see the “Location Point” on the “All Users” page on the OneSignal Dashboard.
Trying to use OneSignal to set up location-based push notifications, but I am not receiving notifications. I am getting an error. All included players are not subscribed. I don’t know what the problem is, any ideas?
On the OneSignal list of “All Users”, users who have not received notifications have “location points” with expected latitude and long coordinates set, and subscribe to users. I have received no location delivery Notifications, so the process of sending and receiving notifications is valid.
I have added this line to my AndroidManifest.xml file:
There is also this line in my .run function:
window.plugins. OneSignal.promptLocation();
My php sends the request to OneSignal:
$content = $_GET['content'];
$lat = $_GET['lat'];
$long = $_GET['long'];
$radius = $_GET['radius'];
$response = sendMessage($content, $lat, $long, $radius);
function sendMessage($message, $lat, $long, $radius){
$content = array (
"en" => $message
);
$fields = array(
'app_id' => "aaaaaa-eeee-yyyyy-xxxx-zzzz ",
'filters' => array(array("field" => "location", "radius" => $radius, "lat" => $lat, "long" => $long)),
//'filters' => array(array("field" => "location", "radius" => "1000", "lat" => "55.819329", "lo ng" => "-4.1696119")),
'included_segments' => array('All'),
'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 FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HEADoptER, FALSE_setopt);
curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
$response = curl_exec ($ch);
curl_close($ch);
return $response;
}
Request:
p>
{content: "test", lat: "55.86 53169", long: "-4.1696119", radius: "1000"}
Response:
{allresponses: "{"id":"" ,"recipients":0,"errors":["All included players are not subscribed"]}"}
“All included players are not subscribed” The message may mean any of the following.
>Make sure you have set the correct app_id.
>You have no subscribed users.
>You are not yet in the ” Set the platform for your device on the Application Settings page.
>There are no users in the filter.
In your case, the location may exceed 1000 meters. Try increasing the radius and confirm that you are on OneSignal You see “Location Point” on the “All Users” page on the dashboard.