feat: Use cache endpoint and round values to use server cache
Resolves: https://gitlab.steamware.net/eqn/eqn.ios/-/issues/90
This commit is contained in:
@@ -49,7 +49,7 @@ static NSString * const EQNServerUrlCalibration = @"https://srv.earthquakenetwor
|
||||
// download rete smartphone
|
||||
static NSString * const EQNServerUrlDownloadSmartphoneNetwork = @"https://cache.earthquakenetwork.it/distquake_count_redis3.php";
|
||||
// download area check
|
||||
static NSString * const EQNServerUrlDownloadAreaCheck = @"https://srv.earthquakenetwork.it/distquake_download_areacheck.php";
|
||||
static NSString * const EQNServerUrlDownloadAreaCheck = @"https://cache.earthquakenetwork.it/distquake_download_areacheck.php";
|
||||
// download pastquakes
|
||||
static NSString * const EQNServerUrlDownloadPastQuakes = @"https://srv.earthquakenetwork.it/distquake_download_pastquakes.php";
|
||||
// download segnalazioni
|
||||
|
||||
@@ -78,7 +78,12 @@
|
||||
|
||||
- (void)scaricaAreaCheck
|
||||
{
|
||||
[[ServerRequest defaultServerConnectionSingleton] inviaInformazioniAlServerWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@?lat=%f&lon=%f", EQNServerUrlDownloadAreaCheck, [EQNUser defaultUser].lastPosition.coordinate.latitude, [EQNUser defaultUser].lastPosition.coordinate.longitude]] richiesta:EQNTipoChiamataAreaCheck success:^(id result) {
|
||||
// Quantizziamo le coordinate, in modo che venga sfruttata la cache lato server
|
||||
CLLocation *lastPosition = [EQNUser defaultUser].lastPosition;
|
||||
double latitude = round(lastPosition.coordinate.latitude * 5.0) / 5.0;
|
||||
double longitude = round(lastPosition.coordinate.longitude * 5.0) / 5.0;
|
||||
|
||||
[[ServerRequest defaultServerConnectionSingleton] inviaInformazioniAlServerWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@?lat=%f&lon=%f", EQNServerUrlDownloadAreaCheck, latitude, longitude]] richiesta:EQNTipoChiamataAreaCheck success:^(id result) {
|
||||
|
||||
self.area_check = [[EQNAreaCheck alloc] initWithInfo:result];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user