post https://cp.pushwoosh.com/json/1.3/getNearestZone
Called internally from the SDK. Gets the parameters of the nearest geozone and a distance to it.
Also records the device location for geo push notifications.
<?php
//see http://gomoob.github.io/php-pushwoosh/get-nearest-zone.html
use Gomoob\Pushwoosh\Model\Request\GetNearestZoneRequest;
// Creates the request instance
$request = GetNearestZoneRequest::create()
->setHwid('HWID')
->setLat(10.12345)
->setLng(28.12345);
// Call the '/getNearestZone' Web Service
$response = $pushwoosh->getNearestZone($request);
if($response->isOk()) {
print 'Zone name : ' . $response->getResponse()->getName();
print 'Latitude : ' . $response->getResponse()->getLat();
print 'Longitude : ' . $response->getResponse()->getLng();
print 'Range : ' . $response->getResponse()->getRange();
print 'Distance : ' . $response->getResponse()->getDistance();
} else {
print 'Oups, the operation failed :-(';
print 'Status code : ' . $response->getStatusCode();
print 'Status message : ' . $response->getStatusMessage();
}