Compare commits

...

8 Commits

Author SHA1 Message Date
Andrea Busi 53b8c0fab4 release: Increase version for release 2022-05-29 22:16:19 +02:00
Andrea Busi 8751d3c8f2 fix: Solve crazy behaviour with iOS 15 2022-05-29 22:14:06 +02:00
Andrea Busi 2d333f993b feat: Make slider with step values 2022-05-29 22:13:46 +02:00
Andrea Busi 22d421f1cc refactor: Add debug log 2022-05-26 21:51:30 +02:00
Andrea Busi cec8b39fc7 fix: Be sure to update push token in Firebase 2022-05-26 21:51:08 +02:00
Andrea Busi 5ceaa4a8be fix: Save user position after server registration 2022-05-26 18:06:37 +02:00
Andrea Busi 94bdb9dbe1 fix: Don't try to parse nil data 2022-05-26 18:06:27 +02:00
Andrea Busi ee1b762032 fix: Call callback for position endpoint 2022-05-26 18:06:13 +02:00
8 changed files with 51 additions and 31 deletions
+9
View File
@@ -1,5 +1,14 @@
# Changelog
## Versione 5.0.3
### Build (89)
- Corretto problema con ultima posizione non salvata in app
- Forzato aggiornamento Firebase
- Corretti metodi deprecati in salvataggio dati
- Corretti comportamento filtri con iOS 15
- Slider con valori a step
## Versione 5.0.2
### Build (88)
@@ -1738,12 +1738,12 @@
CODE_SIGN_ENTITLEMENTS = EQNNotificationService/EQNNotificationService.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 88;
CURRENT_PROJECT_VERSION = 89;
DEVELOPMENT_TEAM = WJA4MR4CPC;
INFOPLIST_FILE = EQNNotificationService/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
MARKETING_VERSION = 5.0.2;
MARKETING_VERSION = 5.0.3;
PRODUCT_BUNDLE_IDENTIFIER = com.finazzi.distquake.notificationservice;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "EQNetwork Extension Service - Development";
@@ -1762,12 +1762,12 @@
CODE_SIGN_ENTITLEMENTS = EQNNotificationService/EQNNotificationService.entitlements;
CODE_SIGN_IDENTITY = "Apple Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 88;
CURRENT_PROJECT_VERSION = 89;
DEVELOPMENT_TEAM = WJA4MR4CPC;
INFOPLIST_FILE = EQNNotificationService/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
MARKETING_VERSION = 5.0.2;
MARKETING_VERSION = 5.0.3;
PRODUCT_BUNDLE_IDENTIFIER = com.finazzi.distquake.notificationservice;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "EQNetwork Extension Service - AppStore";
@@ -1907,14 +1907,14 @@
CODE_SIGN_ENTITLEMENTS = "Earthquake Network/Earthquake Network.entitlements";
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 88;
CURRENT_PROJECT_VERSION = 89;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = WJA4MR4CPC;
GCC_PREFIX_HEADER = "Earthquake Network/Earthquake Network-Prefix.pch";
INFOPLIST_FILE = "Earthquake Network/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 5.0.2;
MARKETING_VERSION = 5.0.3;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
@@ -2017,13 +2017,13 @@
CODE_SIGN_ENTITLEMENTS = "Earthquake Network/Earthquake Network.entitlements";
CODE_SIGN_IDENTITY = "Apple Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 88;
CURRENT_PROJECT_VERSION = 89;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = WJA4MR4CPC;
GCC_PREFIX_HEADER = "Earthquake Network/Earthquake Network-Prefix.pch";
INFOPLIST_FILE = "Earthquake Network/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 5.0.2;
MARKETING_VERSION = 5.0.3;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
@@ -2122,12 +2122,12 @@
CODE_SIGN_ENTITLEMENTS = EQNNotificationContent/EQNNotificationContent.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 88;
CURRENT_PROJECT_VERSION = 89;
DEVELOPMENT_TEAM = WJA4MR4CPC;
INFOPLIST_FILE = EQNNotificationContent/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
MARKETING_VERSION = 5.0.2;
MARKETING_VERSION = 5.0.3;
PRODUCT_BUNDLE_IDENTIFIER = com.finazzi.distquake.notificationcontent;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "EQNetwork Extension Content - Development";
@@ -2146,12 +2146,12 @@
CODE_SIGN_ENTITLEMENTS = EQNNotificationContent/EQNNotificationContent.entitlements;
CODE_SIGN_IDENTITY = "Apple Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 88;
CURRENT_PROJECT_VERSION = 89;
DEVELOPMENT_TEAM = WJA4MR4CPC;
INFOPLIST_FILE = EQNNotificationContent/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
MARKETING_VERSION = 5.0.2;
MARKETING_VERSION = 5.0.3;
PRODUCT_BUNDLE_IDENTIFIER = com.finazzi.distquake.notificationcontent;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "EQNetwork Extension Content - AppStore";
+3
View File
@@ -124,7 +124,10 @@
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken
{
NSString *token = [self stringWithDeviceToken:deviceToken];
NSLog(@"[DEBUG] push token: %@", token);
[[NSUserDefaults standardUserDefaults] setObject:token forKey:EQNUserDefaultPushToken];
FIRMessaging.messaging.APNSToken = deviceToken;
}
- (NSString *)stringWithDeviceToken:(NSData *)deviceToken
@@ -66,7 +66,8 @@ class SeismicFiltersViewController: UIViewController, UITableViewDelegate, UITab
super.viewDidLoad()
setupUI()
updateUI()
loadDataSource()
tableView.reloadData()
}
private func setupUI() {
@@ -83,7 +84,7 @@ class SeismicFiltersViewController: UIViewController, UITableViewDelegate, UITab
closeButton.setLocalizedTitle(key: "official_close", uppercased: false)
}
private func updateUI() {
private func loadDataSource() {
currentMagnitudoMinima = EQNData.magitudoDebole(for: EQNSeismic.shared.magnitudoMinima)
if initialMagnitudoMinima == nil {
initialMagnitudoMinima = currentMagnitudoMinima
@@ -97,7 +98,6 @@ class SeismicFiltersViewController: UIViewController, UITableViewDelegate, UITab
initialQualsiasiMagnitudo = currentSismiQualsiasiMagnitudo
}
currentModificaImpostazioni = EQNSeismic.shared.modificaImpostazioniAbilitato
tableView.reloadData()
}
// MARK: - Table view delegate and data source
@@ -111,7 +111,7 @@ class SeismicFiltersViewController: UIViewController, UITableViewDelegate, UITab
switch setting.type {
case .slider:
let cell = tableView.dequeueReusableCell(withIdentifier: SettingSliderTableViewCell.Identifier, for: indexPath) as! SettingSliderTableViewCell
let cell = SettingSliderTableViewCell(style: .default, reuseIdentifier: nil)
cell.titleLabel.text = setting.displayTitle
if indexPath.row == RowIdentifier.magnitudoMinima.rawValue {
@@ -120,7 +120,6 @@ class SeismicFiltersViewController: UIViewController, UITableViewDelegate, UITab
currentMagnitudoMinima = value
EQNSeismic.shared.magnitudoMinima = value.value
EQNSeismic.shared.saveFilters()
updateUI()
}
cell.dragEnded = { [unowned self] in
showWarningAlertIfNeeded(for: currentMagnitudoMinima)
@@ -131,7 +130,6 @@ class SeismicFiltersViewController: UIViewController, UITableViewDelegate, UITab
currentDistanzaMassima = value
EQNSeismic.shared.distanzaMassima = value.value
EQNSeismic.shared.saveFilters()
updateUI()
}
} else if indexPath.row == RowIdentifier.periodoTemporale.rawValue {
cell.configureSlider(with: dataSourcePeriodoTemporale, current: currentPeriodoTemporale)
@@ -139,7 +137,6 @@ class SeismicFiltersViewController: UIViewController, UITableViewDelegate, UITab
currentPeriodoTemporale = value
EQNSeismic.shared.periodoTemporale = value.value
EQNSeismic.shared.saveFilters()
updateUI()
}
} else if indexPath.row == RowIdentifier.sismiFortiDistanza.rawValue {
cell.isDisabled = !currentSismiFortiAbilitati
@@ -148,13 +145,12 @@ class SeismicFiltersViewController: UIViewController, UITableViewDelegate, UITab
currentSismiFortiDistanza = value
EQNSeismic.shared.sismiFortiMagnitudo = value.value
EQNSeismic.shared.saveFilters()
updateUI()
}
}
return cell
case .enable:
let cell = tableView.dequeueReusableCell(withIdentifier: SettingEnableTableViewCell.Identifier, for: indexPath) as! SettingEnableTableViewCell
let cell = SettingEnableTableViewCell(style: .default, reuseIdentifier: nil)
cell.titleLabel.text = setting.displayTitle
cell.detailTextLabel?.text = setting.subtitle
@@ -164,7 +160,9 @@ class SeismicFiltersViewController: UIViewController, UITableViewDelegate, UITab
currentSismiFortiAbilitati = value
EQNSeismic.shared.sismiFortiAbilitati = value
EQNSeismic.shared.saveFilters()
updateUI()
loadDataSource()
tableView.reloadData()
}
} else if indexPath.row == RowIdentifier.sismiQualsiasiMagnitudo.rawValue {
cell.toggleSwitch.isOn = currentSismiQualsiasiMagnitudo
@@ -172,7 +170,6 @@ class SeismicFiltersViewController: UIViewController, UITableViewDelegate, UITab
currentSismiQualsiasiMagnitudo = value
EQNSeismic.shared.sismiQualsiasiAbilitati = value
EQNSeismic.shared.saveFilters()
updateUI()
}
} else if indexPath.row == RowIdentifier.modificaImpostazioni.rawValue {
cell.toggleSwitch.isOn = currentModificaImpostazioni
@@ -180,7 +177,6 @@ class SeismicFiltersViewController: UIViewController, UITableViewDelegate, UITab
currentModificaImpostazioni = value
EQNSeismic.shared.modificaImpostazioniAbilitato = value
EQNSeismic.shared.saveFilters()
updateUI()
}
}
@@ -98,6 +98,12 @@ class SettingSliderTableViewCell: UITableViewCell {
let index = Int(sender.value)
let item = items[index]
// make slider with step values
let step: Float = 1
let roundedValue = round(sender.value / step) * step
sender.value = roundedValue
// update value
valueLabel.text = item.display
valueChanged?(item)
}
+4 -7
View File
@@ -130,14 +130,11 @@
- (void)inviaPosizioneServer
{
NSLog(@"URLPosizione %@", [EQNGeneratoreURLServer urlPosizione]);
[[ServerRequest defaultServerConnectionSingleton] inviaInformazioniAlServerWithURL:[EQNGeneratoreURLServer urlPosizione] richiesta:EQNTipoChiamataPosizione success:^(id result) {
NSLog(@"inviato");
} failure:^(NSError *errore) {
NSLog(@"[EQNUtility] Position saved on server");
[self saveUserInfo];
} failure:^(NSError *error) {
NSLog(@"[EQNUtility] Unable to save position. Error: %@", error.localizedDescription);
}];
}
@@ -102,6 +102,10 @@
{
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSData *data = [defaults objectForKey:keyName];
if (!data) {
NSLog(@"[EQNUtility] No array saved for key '%@'", keyName);
return nil;
}
NSError *error;
NSKeyedUnarchiver *unarchiver = [[NSKeyedUnarchiver alloc] initForReadingFromData:data error:&error];
@@ -119,6 +123,10 @@
{
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSData *data = [defaults objectForKey:keyName];
if (!data) {
NSLog(@"[EQNUtility] No dictionary saved for key '%@'", keyName);
return nil;
}
NSError *error;
NSKeyedUnarchiver *unarchiver = [[NSKeyedUnarchiver alloc] initForReadingFromData:data error:&error];
@@ -137,6 +137,7 @@
case EQNTipoChiamataRilevamento:
onSuccess([EQNUtility clearStringMessaggi:newStr]);
break;
case EQNTipoChiamataPosizione:
case EQNTipoChiamataCalibrazione:
case EQNTipoChiamataImpostazioniNotifiche:
case EQNTipoChiamataAlertSimulator: