refactor: Use new endpoint to save settings value and remove no longer needed settings
Resolves: https://gitlab.steamware.net/eqn/eqn.ios/-/issues/20
This commit is contained in:
@@ -63,7 +63,6 @@
|
||||
8CCE165121E7BAEC00173CD9 /* EQNNotificheReteSismiche.m in Sources */ = {isa = PBXBuildFile; fileRef = 8CCE165021E7BAEC00173CD9 /* EQNNotificheReteSismiche.m */; };
|
||||
8CCE165521EA378800173CD9 /* SettingsUserReportAlertsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8CCE165421EA378800173CD9 /* SettingsUserReportAlertsViewController.m */; };
|
||||
8CCE165821EB1E0000173CD9 /* SettingsSeismicNetworkAlertsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8CCE165721EB1E0000173CD9 /* SettingsSeismicNetworkAlertsViewController.m */; };
|
||||
8CCE166121EBA37500173CD9 /* EQNNotificheTsunami.m in Sources */ = {isa = PBXBuildFile; fileRef = 8CCE166021EBA37500173CD9 /* EQNNotificheTsunami.m */; };
|
||||
8CD08638218B3BEE0000CB5E /* ReteSismicaAnnotation.m in Sources */ = {isa = PBXBuildFile; fileRef = 8CD08637218B3BEE0000CB5E /* ReteSismicaAnnotation.m */; };
|
||||
8CF05B51218C41FB0055012B /* PickerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8CF05B4B218C41F90055012B /* PickerViewController.m */; };
|
||||
8CF05B53218C41FB0055012B /* PickerViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 8CF05B4F218C41FA0055012B /* PickerViewController.xib */; };
|
||||
@@ -248,8 +247,6 @@
|
||||
8CCE165421EA378800173CD9 /* SettingsUserReportAlertsViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SettingsUserReportAlertsViewController.m; sourceTree = "<group>"; };
|
||||
8CCE165621EB1E0000173CD9 /* SettingsSeismicNetworkAlertsViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SettingsSeismicNetworkAlertsViewController.h; sourceTree = "<group>"; };
|
||||
8CCE165721EB1E0000173CD9 /* SettingsSeismicNetworkAlertsViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SettingsSeismicNetworkAlertsViewController.m; sourceTree = "<group>"; };
|
||||
8CCE165F21EBA37500173CD9 /* EQNNotificheTsunami.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = EQNNotificheTsunami.h; sourceTree = "<group>"; };
|
||||
8CCE166021EBA37500173CD9 /* EQNNotificheTsunami.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = EQNNotificheTsunami.m; sourceTree = "<group>"; };
|
||||
8CD08636218B3BEE0000CB5E /* ReteSismicaAnnotation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ReteSismicaAnnotation.h; sourceTree = "<group>"; };
|
||||
8CD08637218B3BEE0000CB5E /* ReteSismicaAnnotation.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ReteSismicaAnnotation.m; sourceTree = "<group>"; };
|
||||
8CF05B4B218C41F90055012B /* PickerViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PickerViewController.m; sourceTree = "<group>"; };
|
||||
@@ -762,8 +759,6 @@
|
||||
8CCE165021E7BAEC00173CD9 /* EQNNotificheReteSismiche.m */,
|
||||
8C14113521EE502800A59729 /* EQNAllertaSismica.h */,
|
||||
8C14113621EE502800A59729 /* EQNAllertaSismica.m */,
|
||||
8CCE165F21EBA37500173CD9 /* EQNNotificheTsunami.h */,
|
||||
8CCE166021EBA37500173CD9 /* EQNNotificheTsunami.m */,
|
||||
);
|
||||
path = Settings;
|
||||
sourceTree = "<group>";
|
||||
@@ -1046,7 +1041,6 @@
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
DCEFF21324F5821E009D3FE1 /* SettingDetailTableViewCell.swift in Sources */,
|
||||
8CCE166121EBA37500173CD9 /* EQNNotificheTsunami.m in Sources */,
|
||||
DCC23DEF24D28F58003A2404 /* EQNEdgeInsetLabel.swift in Sources */,
|
||||
8CCE165121E7BAEC00173CD9 /* EQNNotificheReteSismiche.m in Sources */,
|
||||
DC52B8A224FC145500ABEBA6 /* SettingsBaseViewController.m in Sources */,
|
||||
|
||||
-5
@@ -22,7 +22,6 @@
|
||||
|
||||
@property (nonatomic, strong) EQNGenericValue *currentUserPositionRadius;
|
||||
@property (nonatomic, strong) EQNGenericValue *currentSeismicEnergy;
|
||||
@property (nonatomic, strong) EQNGenericValue *currentNearEarthquakeDistance;
|
||||
@property (nonatomic, strong) EQNGenericValue *currentStrongEarthquakeDistance;
|
||||
@end
|
||||
|
||||
@@ -100,10 +99,6 @@ typedef NS_ENUM(NSInteger, RowIdentifier) {
|
||||
// energia sisma
|
||||
EQNGenericValue *energiaSisma = [EQNData magitudoDeboleFor:[EQNNotificheReteSismiche sharedInstance].energiaSisma];
|
||||
self.currentSeismicEnergy = energiaSisma;
|
||||
|
||||
// terremoti vicini
|
||||
EQNGenericValue *terremotiVicini = [EQNData raggioSismaFor:[EQNNotificheReteSismiche sharedInstance].distanzaVicini];
|
||||
self.currentNearEarthquakeDistance = terremotiVicini;
|
||||
|
||||
// terremoti forti
|
||||
EQNGenericValue *terremotiForti = [EQNData magitudoForteFor:[EQNNotificheReteSismiche sharedInstance].energiaTerremotiForti];
|
||||
|
||||
@@ -34,7 +34,8 @@ static NSString * const EQNServerUrlDownloadRetiSismiche = @"https://srv.earthqu
|
||||
static NSString * const EQNServerUrlOfferTimeRemaining = @"https://srv.earthquakenetwork.it/distquake_download_offer_time_remaining.php";
|
||||
/// Recupera il numero di sottoscrizioni ancora disponibili per ogni prodotto
|
||||
static NSString * const EQNServerUrlAvailableSubscriptionsCounter = @"https://srv.earthquakenetwork.it/distquake_count_top_redis.php";
|
||||
|
||||
/// Carica le impostazioni delle notifiche definite dall'utente
|
||||
static NSString * const EQNServerUrlUploadSettings = @"http://srv.earthquakenetwork.it/distquake_upload_settings_ios.php";
|
||||
|
||||
#pragma mark - UserDefaults Keys
|
||||
|
||||
@@ -62,8 +63,6 @@ static NSString * const EQNUserDefaultKeySesmicInformations = @"EQNetwork.Seismi
|
||||
#define URL_SERVER_UPLOAD_SEGNALAZIONI_UTENTE @"http://srv.earthquakenetwork.it/distquake_upload_manual3.php"
|
||||
#define URL_SERVER_UPLOAD_SEGNALAZIONI_COMMENTO_UTENTE @"http://srv.earthquakenetwork.it/distquake_upload_manual_message.php"
|
||||
|
||||
#define URL_SERVER_UPLOAD_IMPOSTAZIONI @"http://srv.earthquakenetwork.it/distquake_upload_settings9.php"
|
||||
|
||||
#define TEMPO_INVIO_MESSAGGIO 5
|
||||
#define TEMPO_INVIO_COMMENTO 30
|
||||
|
||||
@@ -227,15 +226,6 @@ typedef enum : NSInteger {
|
||||
|
||||
#define IMPOSTAZIONE_ENTI_RETI_SISMICHEI @"IMPOSTAZIONE_ENTI_RETI_SISMICHEI"
|
||||
|
||||
|
||||
/////////////////// Tsunami ////////////////////////////
|
||||
#define NOTIFICHE_ORA_INIZIO_TSUNAMI @"NOTIFICHE_ORA_INIZIO_TSUNAMI"
|
||||
#define NOTIFICHE_ORA_FINE_TSUNAMI @"NOTIFICHE_ORA_FINE_TSUNAMI"
|
||||
#define NOTIFICHE_ABILITATO_TSUNAMI @"NOTIFICHE_ABILITATO_TSUNAMI"
|
||||
#define NOTIFICHE_ABILITATO_ITERVALLO_TSUNAMI @"NOTIFICHE_ABILITATO_ITERVALLO_TSUNAMI"
|
||||
#define NOTIFICHE_LISTA_MESSAGGI__TSUNAMI @"NOTIFICHE_LISTA_MESSAGGI__TSUNAMI"
|
||||
#define NOTIFICHE_LISTA_AREE_INTERESSE_TSUNAMI @"NOTIFICHE_LISTA_AREE_INTERESSE_TSUNAMI"
|
||||
|
||||
/////////////////// Allera sismica ////////////////////////////
|
||||
#define NOTIFICHE_ALLERA_SISMICA_ABILITATO @"NOTIFICHE_ALLERA_SISMICA_ABILITATO"
|
||||
#define NOTIFICHE_ALLERA_SISMICA_SISMI_DA_NOTIFICARE @"NOTIFICHE_ALLERA_SISMICA_SISMI_DA_NOTIFICARE"
|
||||
|
||||
@@ -13,7 +13,6 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@interface EQNAllertaSismica : NSObject
|
||||
|
||||
@property (nonatomic, assign) BOOL isAbilitato;
|
||||
@property (nonatomic, assign) BOOL isSimiSenzaIntensita;
|
||||
@property (nonatomic, assign) BOOL isintervalloAllarme;
|
||||
|
||||
@property (nonatomic, strong) NSString *sismiDaNotificare;
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
self = [super init];
|
||||
if (self) {
|
||||
self.isAbilitato = [[NSUserDefaults standardUserDefaults] boolForKey:NOTIFICHE_ALLERA_SISMICA_ABILITATO];
|
||||
self.isSimiSenzaIntensita = NO; // parametro rimosso dalle impostazioni, manteniamo l'invio al server come false
|
||||
self.sismiDaNotificare = [[NSUserDefaults standardUserDefaults] objectForKey:NOTIFICHE_ALLERA_SISMICA_SISMI_DA_NOTIFICARE];
|
||||
self.raggioSismiLievi = [[NSUserDefaults standardUserDefaults] objectForKey:NOTIFICHE_ALLERA_SISMICA_RAGGIO_SISMI_LIEVI];
|
||||
self.raggioSismiForti = [[NSUserDefaults standardUserDefaults] objectForKey:NOTIFICHE_ALLERA_SISMICA_RAGGIO_SISMI_FORTI];
|
||||
|
||||
@@ -18,7 +18,6 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@property (nonatomic, strong) NSArray<NSString *> *listaEnti;
|
||||
@property (nonatomic, strong) NSString *distanzaPosizione;
|
||||
@property (nonatomic, strong) NSString *energiaSisma;
|
||||
@property (nonatomic, strong) NSString *distanzaVicini;
|
||||
@property (nonatomic, strong) NSString *energiaTerremotiForti;
|
||||
|
||||
+ (instancetype)sharedInstance NS_SWIFT_NAME(shared());
|
||||
|
||||
@@ -36,7 +36,6 @@
|
||||
self.isTerremortiForti = [[NSUserDefaults standardUserDefaults] boolForKey:NOTIFICHE_ATTIVA_RETI_TERREMOTI_FORTI];
|
||||
self.distanzaPosizione = [[NSUserDefaults standardUserDefaults] objectForKey:NOTIFICHE_DISTANZA_POSIZIONE_RETI_SISMICHE];
|
||||
self.energiaSisma = [[NSUserDefaults standardUserDefaults] objectForKey:NOTIFICHE_ATTIVA_RETI_ENERGIA_SISMI];
|
||||
self.distanzaVicini = @"50"; // parametro rimosso dalle impostazioni, valore fisso inviato al server
|
||||
self.energiaTerremotiForti = [[NSUserDefaults standardUserDefaults] objectForKey:NOTIFICHE_ATTIVA_RETI_ENERGIA_FORTI];
|
||||
self.listaEnti = (NSArray *)[EQNUtility loadCustomObjectWithKey:NOTIFICHE_ATTIVA_RETI_LISTA_ENTI];
|
||||
}
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
//
|
||||
// EQNNotificheTsunami.h
|
||||
// Earthquake Network
|
||||
//
|
||||
// Created by Luca Beretta on 13/01/2019.
|
||||
// Copyright © 2019 Luca Beretta. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface EQNNotificheTsunami : NSObject
|
||||
@property (nonatomic, assign) BOOL isAbilitato;
|
||||
@property (nonatomic, assign) BOOL isIntervalloNotifiche;
|
||||
@property (nonatomic, strong) NSDate *oraioInizio;
|
||||
@property (nonatomic, strong) NSDate *orarioFine;
|
||||
@property (nonatomic, strong) NSArray *listaMessaggi;
|
||||
@property (nonatomic, strong) NSArray *listaAreeInteresse;
|
||||
|
||||
+(EQNNotificheTsunami *)center;
|
||||
-(void)saveUserInfo;
|
||||
-(void)removeUser;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -1,62 +0,0 @@
|
||||
//
|
||||
// EQNNotificheTsunami.m
|
||||
// Earthquake Network
|
||||
//
|
||||
// Created by Luca Beretta on 13/01/2019.
|
||||
// Copyright © 2019 Luca Beretta. All rights reserved.
|
||||
//
|
||||
|
||||
#import "EQNNotificheTsunami.h"
|
||||
#import "Costanti.h"
|
||||
#import "EQNUtility.h"
|
||||
|
||||
@implementation EQNNotificheTsunami
|
||||
|
||||
+(EQNNotificheTsunami *)center{
|
||||
|
||||
static EQNNotificheTsunami *instance = nil;
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^{
|
||||
instance = [[self alloc]init];
|
||||
[instance initSingleton];
|
||||
});
|
||||
return instance;
|
||||
}
|
||||
|
||||
-(void)initSingleton{
|
||||
|
||||
self.isAbilitato = [[NSUserDefaults standardUserDefaults] boolForKey:NOTIFICHE_ABILITATO_TSUNAMI];
|
||||
self.isIntervalloNotifiche = [[NSUserDefaults standardUserDefaults] boolForKey:NOTIFICHE_ABILITATO_ITERVALLO_TSUNAMI];
|
||||
|
||||
self.listaMessaggi = (NSArray *)[EQNUtility loadCustomObjectWithKey:NOTIFICHE_LISTA_MESSAGGI__TSUNAMI];
|
||||
self.listaAreeInteresse = (NSArray *)[EQNUtility loadCustomObjectWithKey:NOTIFICHE_LISTA_AREE_INTERESSE_TSUNAMI];
|
||||
|
||||
self.oraioInizio = [[NSUserDefaults standardUserDefaults] objectForKey:NOTIFICHE_ORA_INIZIO_TSUNAMI];
|
||||
self.orarioFine = [[NSUserDefaults standardUserDefaults] objectForKey:NOTIFICHE_ORA_FINE_TSUNAMI];
|
||||
|
||||
}
|
||||
|
||||
-(void)saveUserInfo{
|
||||
|
||||
[[NSUserDefaults standardUserDefaults] setBool:self.isAbilitato forKey:NOTIFICHE_ABILITATO_TSUNAMI];
|
||||
|
||||
[[NSUserDefaults standardUserDefaults] setBool:self.isIntervalloNotifiche forKey:NOTIFICHE_ABILITATO_ITERVALLO_TSUNAMI];
|
||||
|
||||
[EQNUtility saveCustomObject:self.listaMessaggi key:NOTIFICHE_LISTA_MESSAGGI__TSUNAMI];
|
||||
[EQNUtility saveCustomObject:self.listaAreeInteresse key:NOTIFICHE_LISTA_AREE_INTERESSE_TSUNAMI];
|
||||
|
||||
[[NSUserDefaults standardUserDefaults] setObject:self.oraioInizio forKey:NOTIFICHE_ORA_INIZIO_TSUNAMI];
|
||||
[[NSUserDefaults standardUserDefaults] setObject:self.orarioFine forKey:NOTIFICHE_ORA_FINE_TSUNAMI];
|
||||
|
||||
[[NSUserDefaults standardUserDefaults] synchronize];
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
-(void)removeUser{
|
||||
|
||||
|
||||
|
||||
}
|
||||
@end
|
||||
@@ -13,7 +13,6 @@
|
||||
#import "EQNRilevamento.h"
|
||||
#import "EQNNotificheSegnalazioniUtente.h"
|
||||
#import "EQNNotificheReteSismiche.h"
|
||||
#import "EQNNotificheTsunami.h"
|
||||
#import "EQNAllertaSismica.h"
|
||||
#import <MapKit/MapKit.h>
|
||||
|
||||
@@ -39,14 +38,14 @@
|
||||
}
|
||||
|
||||
+(NSURL *)urlPosizione{
|
||||
|
||||
|
||||
NSString *stringUrl = [NSString stringWithFormat:@"%@?u_id=%@&lat=%f&lon=%f",URL_SERVER_POSIZIONE, [EQNUser defaultUser].user_ID, [EQNUser defaultUser].lastPosition.coordinate.latitude, [EQNUser defaultUser].lastPosition.coordinate.longitude ];
|
||||
|
||||
return [NSURL URLWithString:stringUrl];
|
||||
}
|
||||
|
||||
+(NSURL *)urlMessagioStatoSmartPhone:(EQNCalibrazione *)calibrazione rilevamento:(EQNRilevamento *)rilevamento{
|
||||
|
||||
|
||||
NSString *e_t = @"0";
|
||||
NSString *a_max = @"0";
|
||||
|
||||
@@ -65,8 +64,8 @@
|
||||
calib = @"1";
|
||||
|
||||
NSString *ch = @"0";
|
||||
if ([EQNUser defaultUser].inCarica)
|
||||
ch = @"1";
|
||||
if ([EQNUser defaultUser].inCarica)
|
||||
ch = @"1";
|
||||
|
||||
NSString *s_on = @"0";
|
||||
if ([EQNUser defaultUser].monitorOn)
|
||||
@@ -106,39 +105,37 @@
|
||||
|
||||
NSURL *url = [NSURL URLWithString:stringUrl];
|
||||
if (url) {
|
||||
return url;
|
||||
return url;
|
||||
}
|
||||
else{
|
||||
|
||||
stringUrl = [NSString stringWithFormat:@"%@?u_id=%@&lat=%@&lon=%@&mag=%ld&hod=%@", URL_SERVER_UPLOAD_SEGNALAZIONI_UTENTE, [EQNUser defaultUser].user_ID, lat, lon, (long)magnitudo, ora];
|
||||
return [NSURL URLWithString:stringUrl];
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
+(NSURL *)urlInvioCommentoTerremoto:(NSString *)commento codeMessage:(NSString *)code{
|
||||
|
||||
|
||||
|
||||
NSString* codeEscaped = [code stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLHostAllowedCharacterSet ]];
|
||||
|
||||
NSString* commentEscaped = [commento stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLHostAllowedCharacterSet ]];
|
||||
NSString* commentEscaped = [commento stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLHostAllowedCharacterSet ]];
|
||||
|
||||
NSString *stringUrl = [NSString stringWithFormat:@"%@?u_id=%@&e_code=%@&message=%@", URL_SERVER_UPLOAD_SEGNALAZIONI_COMMENTO_UTENTE, [EQNUser defaultUser].user_ID, codeEscaped, commentEscaped];
|
||||
|
||||
NSString *stringUrl = [NSString stringWithFormat:@"%@?u_id=%@&e_code=%@&message=%@", URL_SERVER_UPLOAD_SEGNALAZIONI_COMMENTO_UTENTE, [EQNUser defaultUser].user_ID, codeEscaped, commentEscaped];
|
||||
|
||||
return [NSURL URLWithString: stringUrl];
|
||||
|
||||
|
||||
}
|
||||
|
||||
+(NSURL *)urlInvioImpostazioniNotifiche{
|
||||
|
||||
+ (NSURL *)urlInvioImpostazioniNotifiche
|
||||
{
|
||||
NSString *n_e = [NSString stringWithFormat:@"&n_e=%i",[EQNAllertaSismica sharedInstance].isAbilitato];
|
||||
|
||||
NSString *n_m = [NSString stringWithFormat:@"&n_m=%i",[EQNNotificheSegnalazioniUtente sharedInstance].isAbilitato];
|
||||
NSString *n_o = [NSString stringWithFormat:@"&n_o=%i",[EQNNotificheReteSismiche sharedInstance].isAbilitato];
|
||||
NSString *n_o_near = [NSString stringWithFormat:@"&n_o_near=%i",[EQNNotificheReteSismiche sharedInstance].isAbilitaVicini];
|
||||
NSString *n_o_mag = [NSString stringWithFormat:@"&n_o_mag=%@",[EQNNotificheReteSismiche sharedInstance].energiaSisma];
|
||||
NSString *n_tsu = [NSString stringWithFormat:@"&n_tsu=%i",[EQNNotificheTsunami center].isAbilitato];
|
||||
|
||||
|
||||
NSString *n_o_usgs = @"&n_o_usgs=0";
|
||||
NSString *n_o_emsc = @"&n_o_emsc=0";
|
||||
NSString *n_o_ingv = @"&n_o_ingv=0";
|
||||
@@ -157,112 +154,89 @@
|
||||
NSString *n_o_phivolcs = @"&n_o_phivolcs=0";
|
||||
NSString *n_o_igp = @"&n_o_igp=0";
|
||||
NSString *n_o_uasd = @"&n_o_uasd=0";
|
||||
|
||||
|
||||
for (NSString *ente in [EQNNotificheReteSismiche sharedInstance].listaEnti) {
|
||||
|
||||
if ([ente isEqualToString:@"USGS"])
|
||||
if ([ente isEqualToString:@"USGS"]) {
|
||||
n_o_usgs = @"&n_o_usgs=1";
|
||||
if ([ente isEqualToString:@"EMSC"])
|
||||
} else if ([ente isEqualToString:@"EMSC"]) {
|
||||
n_o_emsc = @"&n_o_emsc=1";
|
||||
if ([ente isEqualToString:@"INGV"])
|
||||
} else if ([ente isEqualToString:@"INGV"]) {
|
||||
n_o_ingv = @"&n_o_ingv=1";
|
||||
if ([ente isEqualToString:@"IGN"])
|
||||
} else if ([ente isEqualToString:@"IGN"]) {
|
||||
n_o_ign = @"&n_o_ign=1";
|
||||
if ([ente isEqualToString:@"CSI"])
|
||||
} else if ([ente isEqualToString:@"CSI"]) {
|
||||
n_o_csi = @"&n_o_csi=1";
|
||||
if ([ente isEqualToString:@"JMA"])
|
||||
} else if ([ente isEqualToString:@"JMA"]) {
|
||||
n_o_jma = @"&n_o_jma=1";
|
||||
if ([ente isEqualToString:@"Ineter"])
|
||||
} else if ([ente isEqualToString:@"Ineter"]) {
|
||||
n_o_ineter = @"&n_o_ineter=1";
|
||||
if ([ente isEqualToString:@"SSN"])
|
||||
} else if ([ente isEqualToString:@"SSN"]) {
|
||||
n_o_ssn = @"&n_o_ssn=1";
|
||||
if ([ente isEqualToString:@"SGC"])
|
||||
} else if ([ente isEqualToString:@"SGC"]) {
|
||||
n_o_sgc = @"&n_o_sgc=1";
|
||||
if ([ente isEqualToString:@"RSN"])
|
||||
} else if ([ente isEqualToString:@"RSN"]) {
|
||||
n_o_rsn = @"&n_o_rsn=1";
|
||||
if ([ente isEqualToString:@"CSN"])
|
||||
} else if ([ente isEqualToString:@"CSN"]) {
|
||||
n_o_csn = @"&n_o_csn=1";
|
||||
if ([ente isEqualToString:@"FUNVISIS"])
|
||||
} else if ([ente isEqualToString:@"FUNVISIS"]) {
|
||||
n_o_funvisis = @"&n_o_funvisis=1";
|
||||
if ([ente isEqualToString:@"GeoNet"])
|
||||
} else if ([ente isEqualToString:@"GeoNet"]) {
|
||||
n_o_geonet = @"&n_o_geonet=1";
|
||||
if ([ente isEqualToString:@"INPRES"])
|
||||
} else if ([ente isEqualToString:@"INPRES"]) {
|
||||
n_o_inpres = @"&n_o_inpres=1";
|
||||
if ([ente isEqualToString:@"IGEPN"])
|
||||
} else if ([ente isEqualToString:@"IGEPN"]) {
|
||||
n_o_igepn = @"&n_o_igepn=1";
|
||||
if ([ente isEqualToString:@"PHIVOLCS"])
|
||||
} else if ([ente isEqualToString:@"PHIVOLCS"]) {
|
||||
n_o_phivolcs = @"&n_o_phivolcs=1";
|
||||
if ([ente isEqualToString:@"IGP"])
|
||||
} else if ([ente isEqualToString:@"IGP"]) {
|
||||
n_o_igp = @"&n_o_igp=1";
|
||||
if ([ente isEqualToString:@"UASD"])
|
||||
} else if ([ente isEqualToString:@"UASD"]) {
|
||||
n_o_uasd = @"&n_o_uasd=1";
|
||||
}
|
||||
}
|
||||
NSString *enti = [NSString stringWithFormat:@"%@%@%@%@%@%@%@%@%@%@%@%@%@%@%@%@%@%@", n_o_usgs, n_o_emsc, n_o_ingv, n_o_ign, n_o_csi, n_o_jma, n_o_ineter, n_o_ssn, n_o_sgc, n_o_rsn, n_o_csn, n_o_funvisis, n_o_geonet, n_o_inpres, n_o_igepn, n_o_phivolcs, n_o_igp, n_o_uasd];
|
||||
|
||||
NSString *n_o_strong = [NSString stringWithFormat:@"n_o_strong=%i",[EQNNotificheReteSismiche sharedInstance].isTerremortiForti];
|
||||
|
||||
// andrea.busi - 27/09/2020: manteniamo il controllo su eventuali valori "Qualsiasi intensità/distanza" salvati
|
||||
// non sembrano servire, perchè i valori sono salvati come 100.000 anche nelle versioni prcedenti alla 2.0
|
||||
// per sicurezza, però, teniamo i controlli
|
||||
|
||||
NSString *n_tsu_car = @"&n_tsu_car=1";
|
||||
NSString *n_tsu_pac = @"&n_tsu_pac=1";
|
||||
NSString *n_tsu_haw = @"&n_tsu_haw=1";
|
||||
|
||||
|
||||
if (![[EQNNotificheTsunami center].listaAreeInteresse containsObject:NSLocalizedString(@"Mar dei Caraibi", @"voce elenco aree tsunami")]) {
|
||||
n_tsu_car = @"&n_tsu_car=0";
|
||||
|
||||
}
|
||||
if (![[EQNNotificheTsunami center].listaAreeInteresse containsObject:NSLocalizedString(@"Oceano Pacifico", @"voce elenco aree tsunami")]) {
|
||||
n_tsu_pac = @"&n_tsu_pac=0";
|
||||
|
||||
}
|
||||
if (![[EQNNotificheTsunami center].listaAreeInteresse containsObject:NSLocalizedString(@"Isole Hawaii", @"voce elenco aree tsunami")]) {
|
||||
n_tsu_haw = @"&n_tsu_haw=0";
|
||||
|
||||
}
|
||||
|
||||
NSString *n_tsu_aree = [NSString stringWithFormat:@"%@%@%@",n_tsu_car, n_tsu_pac, n_tsu_haw];
|
||||
NSString *n_e_unk = [NSString stringWithFormat:@"&n_e_unk=%i", [EQNAllertaSismica sharedInstance].isSimiSenzaIntensita];
|
||||
|
||||
NSString *n_o_strmag = [NSString stringWithFormat:@"&n_o_strmag=%@", [EQNNotificheReteSismiche sharedInstance].energiaTerremotiForti];
|
||||
if ([[EQNAllertaSismica sharedInstance].sismiDaNotificare isEqualToString:NSLocalizedString(@"Qualsiasi intensità", @"")])
|
||||
if ([[EQNAllertaSismica sharedInstance].sismiDaNotificare isEqualToString:NSLocalizedString(@"Qualsiasi intensità", @"")]) {
|
||||
n_o_strmag = @"&n_o_strmag=0";
|
||||
|
||||
}
|
||||
|
||||
NSString *r_e_mild = [NSString stringWithFormat:@"&r_e_mild=%@", [EQNAllertaSismica sharedInstance].raggioSismiLievi];
|
||||
|
||||
if ([[EQNAllertaSismica sharedInstance].raggioSismiLievi isEqualToString:NSLocalizedString(@"Qualsiasi distanza", @"")])
|
||||
if ([[EQNAllertaSismica sharedInstance].raggioSismiLievi isEqualToString:NSLocalizedString(@"Qualsiasi distanza", @"")]) {
|
||||
r_e_mild = @"&r_e_mild=100000";
|
||||
}
|
||||
|
||||
NSString *r_e_strong = [NSString stringWithFormat:@"&r_e_strong=%@", [EQNAllertaSismica sharedInstance].raggioSismiForti];
|
||||
|
||||
if ([[EQNAllertaSismica sharedInstance].raggioSismiForti isEqualToString:NSLocalizedString(@"Qualsiasi distanza", @"")])
|
||||
if ([[EQNAllertaSismica sharedInstance].raggioSismiForti isEqualToString:NSLocalizedString(@"Qualsiasi distanza", @"")]) {
|
||||
r_e_strong = @"&r_e_strong=100000";
|
||||
|
||||
NSString *r_m = [NSString stringWithFormat:@"&r_m=%@", [EQNNotificheSegnalazioniUtente sharedInstance].distanzaPosizione];
|
||||
if ([[EQNNotificheSegnalazioniUtente sharedInstance].distanzaPosizione isEqualToString:NSLocalizedString(@"Qualsiasi distanza", @"")])
|
||||
r_m = @"&r_m=100000";
|
||||
}
|
||||
|
||||
NSString *r_m = [NSString stringWithFormat:@"&r_m=%@", [EQNNotificheSegnalazioniUtente sharedInstance].distanzaPosizione];
|
||||
if ([[EQNNotificheSegnalazioniUtente sharedInstance].distanzaPosizione isEqualToString:NSLocalizedString(@"Qualsiasi distanza", @"")]) {
|
||||
r_m = @"&r_m=100000";
|
||||
}
|
||||
|
||||
NSString *r_o = [NSString stringWithFormat:@"&r_o=%@", [EQNNotificheReteSismiche sharedInstance].distanzaPosizione];
|
||||
if ([[EQNNotificheReteSismiche sharedInstance].distanzaPosizione isEqualToString:NSLocalizedString(@"Qualsiasi distanza", @"")])
|
||||
if ([[EQNNotificheReteSismiche sharedInstance].distanzaPosizione isEqualToString:NSLocalizedString(@"Qualsiasi distanza", @"")]) {
|
||||
r_o = @"&r_o=100000";
|
||||
}
|
||||
|
||||
NSString *r_o_near = [NSString stringWithFormat:@"&r_o_near=%@", [EQNNotificheReteSismiche sharedInstance].distanzaVicini];
|
||||
if ([[EQNNotificheReteSismiche sharedInstance].distanzaPosizione isEqualToString:NSLocalizedString(@"Qualsiasi distanza", @"")])
|
||||
r_o_near = @"&r_o_near=100000";
|
||||
|
||||
// da sistemare
|
||||
NSString *n_e_type = [NSString stringWithFormat:@"&n_e_type=%@", [EQNAllertaSismica sharedInstance].sismiDaNotificare];
|
||||
|
||||
NSString *stringUrl = [NSString stringWithFormat:@"%@?u_id=%@&lat=%f&lon=%f%@%@%@%@%@%@%@&ios=1&%@%@%@%@%@%@%@%@%@%@",URL_SERVER_UPLOAD_IMPOSTAZIONI, [EQNUser defaultUser].user_ID, [EQNUser defaultUser].lastPosition.coordinate.latitude, [EQNUser defaultUser].lastPosition.coordinate.longitude, n_e, n_m, n_o, n_o_near,n_o_mag, enti, n_tsu, n_o_strong,n_tsu_aree, n_e_type, n_e_unk, n_o_strmag, r_e_mild, r_e_strong, r_m, r_o, r_o_near];
|
||||
NSString *stringUrl = [NSString stringWithFormat:@"%@?u_id=%@&lat=%f&lon=%f%@%@%@%@%@%@%@&%@%@%@%@%@%@", EQNServerUrlUploadSettings, [EQNUser defaultUser].user_ID, [EQNUser defaultUser].lastPosition.coordinate.latitude, [EQNUser defaultUser].lastPosition.coordinate.longitude, n_e, n_m, n_o, n_o_near,n_o_mag, enti, n_o_strong, n_e_type, n_o_strmag, r_e_mild, r_e_strong, r_m, r_o];
|
||||
|
||||
|
||||
NSLog(@"stringUrl %@", stringUrl);
|
||||
|
||||
|
||||
return [NSURL URLWithString:stringUrl];
|
||||
|
||||
}
|
||||
|
||||
+(NSURL *)urlDownloadOfferTimeRemaining
|
||||
+ (NSURL *)urlDownloadOfferTimeRemaining
|
||||
{
|
||||
NSString *stringUrl = [NSString stringWithFormat:@"%@?u_id=%@", EQNServerUrlOfferTimeRemaining, [EQNUser defaultUser].user_ID];
|
||||
return [NSURL URLWithString:stringUrl];
|
||||
|
||||
Reference in New Issue
Block a user