Compare commits

...

12 Commits

Author SHA1 Message Date
Andrea Busi 8f711b988a release: Increase version for release 2020-10-08 14:22:26 +02:00
Andrea Busi e202ba8452 fix: Solve wrong url for settings upload 2020-10-08 14:21:49 +02:00
Andrea Busi eb8d8be800 fix: Make provider label fit required space 2020-10-08 14:01:52 +02:00
Andrea Busi a1b7a5ee70 fix: Seismic filter now use case-insensitive check for networks 2020-10-08 14:01:36 +02:00
Andrea Busi 7a117097e3 fix: Add missing translations 2020-10-08 14:01:24 +02:00
Andrea Busi 8070262a44 fix: Use proper time zone when parse web service date 2020-10-08 14:00:53 +02:00
Andrea Busi f768b15916 release: Increase version for release 2020-10-03 12:10:24 +02:00
Andrea Busi a07480f90a fix: Handle seismic date as nullable parameter to avoid crashes 2020-10-03 12:09:47 +02:00
Andrea Busi 4e5e93e3f1 refactor: Rename method to convert server string into date 2020-10-03 12:09:31 +02:00
Andrea Busi 68c9eb9bbc feat: Show alert when weather data are not available 2020-10-03 12:09:06 +02:00
Andrea Busi ba2fbfaa60 feat: Handle weather code as nullable parameter 2020-10-03 12:01:17 +02:00
Andrea Busi e194731bc8 refactor: Rename NSDictionary extension and improve code 2020-10-03 11:58:15 +02:00
22 changed files with 153 additions and 96 deletions
+13
View File
@@ -1,5 +1,18 @@
# Changelog
## Versione 2.3.2
### Build (41)
- Corretto caricamento parametri settings
- Corretto filtro per rete Geonet
- Fix minori
## Versione 2.3.1
### Build (35)
- Aggiunto controllo su data in schede sismi per evitare crash
- Aggiunta gestione dati meteo non disponibili
## Versione 2.3
### Build (34)
@@ -43,7 +43,7 @@
8C602246218D9DB200C799C2 /* PastquakesDettagliMappa.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C602245218D9DB200C799C2 /* PastquakesDettagliMappa.m */; };
8C60224A218EDBE200C799C2 /* PastquakesAnnotation.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C602249218EDBE200C799C2 /* PastquakesAnnotation.m */; };
8C6CBAE521597E79005C426A /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 8C6CBAE421597E79005C426A /* GoogleService-Info.plist */; };
8C7A3B66225A5EA40045B266 /* NSDictionary+BVJSONString.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C7A3B64225A5EA30045B266 /* NSDictionary+BVJSONString.m */; };
8C7A3B66225A5EA40045B266 /* NSDictionary+EQNExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C7A3B64225A5EA30045B266 /* NSDictionary+EQNExtensions.m */; };
8C7CD64821F7D0F800835812 /* ReteSismicaAnnotation.m in Sources */ = {isa = PBXBuildFile; fileRef = 8CD08637218B3BEE0000CB5E /* ReteSismicaAnnotation.m */; };
8C7CD64921F7D11700835812 /* ReteSismicaAnnotation.m in Frameworks */ = {isa = PBXBuildFile; fileRef = 8CD08637218B3BEE0000CB5E /* ReteSismicaAnnotation.m */; };
8C7CD64A21F7D11700835812 /* ReteSismicaAnnotation.h in Frameworks */ = {isa = PBXBuildFile; fileRef = 8CD08636218B3BEE0000CB5E /* ReteSismicaAnnotation.h */; };
@@ -215,8 +215,8 @@
8C602248218EDBE200C799C2 /* PastquakesAnnotation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PastquakesAnnotation.h; sourceTree = "<group>"; };
8C602249218EDBE200C799C2 /* PastquakesAnnotation.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PastquakesAnnotation.m; sourceTree = "<group>"; };
8C6CBAE421597E79005C426A /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
8C7A3B64225A5EA30045B266 /* NSDictionary+BVJSONString.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSDictionary+BVJSONString.m"; sourceTree = "<group>"; };
8C7A3B65225A5EA40045B266 /* NSDictionary+BVJSONString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSDictionary+BVJSONString.h"; sourceTree = "<group>"; };
8C7A3B64225A5EA30045B266 /* NSDictionary+EQNExtensions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSDictionary+EQNExtensions.m"; sourceTree = "<group>"; };
8C7A3B65225A5EA40045B266 /* NSDictionary+EQNExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSDictionary+EQNExtensions.h"; sourceTree = "<group>"; };
8C8EBBA521540039002784BA /* EQNUser.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = EQNUser.h; sourceTree = "<group>"; };
8C8EBBA621540039002784BA /* EQNUser.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = EQNUser.m; sourceTree = "<group>"; };
8CA46B9F2194532E00C63C16 /* SismaAnnotation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SismaAnnotation.h; sourceTree = "<group>"; };
@@ -553,6 +553,8 @@
isa = PBXGroup;
children = (
DC105640251E7ECE002579BB /* UIFont+Extensions.swift */,
8C7A3B65225A5EA40045B266 /* NSDictionary+EQNExtensions.h */,
8C7A3B64225A5EA30045B266 /* NSDictionary+EQNExtensions.m */,
);
path = Extensions;
sourceTree = "<group>";
@@ -621,8 +623,6 @@
DC10563F251E7EC0002579BB /* Extensions */,
8CF66054214C566A009F4314 /* Reachability.h */,
8CF66056214C566A009F4314 /* Reachability.m */,
8C7A3B65225A5EA40045B266 /* NSDictionary+BVJSONString.h */,
8C7A3B64225A5EA30045B266 /* NSDictionary+BVJSONString.m */,
);
path = Libs;
sourceTree = "<group>";
@@ -1094,7 +1094,7 @@
8CBD3DD82149B9AD0070C963 /* main.m in Sources */,
8CF05B57218C93BA0055012B /* EQNUtility.m in Sources */,
8C4E34422152B5E8008B0D2A /* EQNRilevamento.m in Sources */,
8C7A3B66225A5EA40045B266 /* NSDictionary+BVJSONString.m in Sources */,
8C7A3B66225A5EA40045B266 /* NSDictionary+EQNExtensions.m in Sources */,
8CF66053214C12DC009F4314 /* EQNMath.m in Sources */,
DCF4A54524F8DB8300B17326 /* SettingDateTableViewCell.swift in Sources */,
8C60224A218EDBE200C799C2 /* PastquakesAnnotation.m in Sources */,
@@ -1202,12 +1202,12 @@
buildSettings = {
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 34;
CURRENT_PROJECT_VERSION = 41;
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 = 2.3;
MARKETING_VERSION = 2.3.2;
PRODUCT_BUNDLE_IDENTIFIER = com.finazzi.distquake.EQNNotificationService;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "Earthquake Network Extensions - Development";
@@ -1224,12 +1224,12 @@
buildSettings = {
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 34;
CURRENT_PROJECT_VERSION = 41;
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 = 2.3;
MARKETING_VERSION = 2.3.2;
PRODUCT_BUNDLE_IDENTIFIER = com.finazzi.distquake.EQNNotificationService;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "Earthquake Network Extensions - Development";
@@ -1362,14 +1362,14 @@
CODE_SIGN_ENTITLEMENTS = "Earthquake Network/Earthquake Network.entitlements";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 34;
CURRENT_PROJECT_VERSION = 41;
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 = 2.3;
MARKETING_VERSION = 2.3.2;
PRODUCT_BUNDLE_IDENTIFIER = com.finazzi.distquake;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
@@ -1390,13 +1390,13 @@
CODE_SIGN_ENTITLEMENTS = "Earthquake Network/Earthquake Network.entitlements";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 34;
CURRENT_PROJECT_VERSION = 41;
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 = 2.3;
MARKETING_VERSION = 2.3.2;
PRODUCT_BUNDLE_IDENTIFIER = com.finazzi.distquake;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
@@ -1412,12 +1412,12 @@
buildSettings = {
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 34;
CURRENT_PROJECT_VERSION = 41;
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 = 2.3;
MARKETING_VERSION = 2.3.2;
PRODUCT_BUNDLE_IDENTIFIER = com.finazzi.distquake.EQNNotificationContent;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "Earthquake Network Extensions - Development";
@@ -1434,12 +1434,12 @@
buildSettings = {
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 34;
CURRENT_PROJECT_VERSION = 41;
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 = 2.3;
MARKETING_VERSION = 2.3.2;
PRODUCT_BUNDLE_IDENTIFIER = com.finazzi.distquake.EQNNotificationContent;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "Earthquake Network Extensions - Development";
@@ -14,7 +14,7 @@ protocol SeismicNetworkTableViewCellDelegate: class {
func seismicNetworkCellDidTapShare(_ cell: SeismicNetworkTableViewCell)
func seismicNetworkCellDidTapMap(_ cell: SeismicNetworkTableViewCell)
func seismicNetworkCellDidTapMapDetail(_ cell: SeismicNetworkTableViewCell)
func seismicNetworkCellDidTapWeather(_ cell: SeismicNetworkTableViewCell)
func seismicNetworkCellDidTapWeather(_ cell: SeismicNetworkTableViewCell, hasValidWeatherData: Bool)
func seismicNetworkCellDidTapCalendar(_ cell: SeismicNetworkTableViewCell)
func seismicNetworkCellDidTapSettings(_ cell: SeismicNetworkTableViewCell)
func seismicNetworkCellDidTapClose(_ cell: SeismicNetworkTableViewCell)
@@ -255,7 +255,8 @@ class SeismicNetworkTableViewCell: UITableViewCell {
titleImageView.heightAnchor.constraint(equalToConstant: titleComponentsHeight).isActive = true
titleImageView.widthAnchor.constraint(equalTo: titleImageView.heightAnchor).isActive = true
networkLabel.heightAnchor.constraint(equalToConstant: 40.0).isActive = true
networkLabel.widthAnchor.constraint(equalToConstant: 60.0).isActive = true
networkLabel.setContentHuggingPriority(.init(800), for: .horizontal)
placeLabel.setContentHuggingPriority(.init(200), for: .horizontal)
shareButton.widthAnchor.constraint(equalToConstant: titleComponentsHeight).isActive = true
shareButton.widthAnchor.constraint(equalTo: shareButton.heightAnchor).isActive = true
@@ -433,10 +434,16 @@ class SeismicNetworkTableViewCell: UITableViewCell {
depthLabel.text = String(format: "%@: %.1f km", NSLocalizedString("Profondità", comment: ""), seismic.depth.doubleValue)
}
let formattedDate = Self.dateFormatter.string(from: seismic.date)
let timeSuffix = seismic.timeDifference > 60 ? NSLocalizedString("ore fa", comment: "") : NSLocalizedString("minuti fa", comment: "")
let timeRounded = seismic.timeDifference > 60 ? Int(round(seismic.timeDifference / 60)) : Int(seismic.timeDifference)
timeLabel.text = "🕗 \(formattedDate) - \(timeRounded) \(timeSuffix)"
// we need to check agains null values, because sometimes WS returns invalid dates
if let date = seismic.date {
let formattedDate = Self.dateFormatter.string(from: date)
let timeSuffix = seismic.timeDifference > 60 ? NSLocalizedString("ore fa", comment: "") : NSLocalizedString("minuti fa", comment: "")
let timeRounded = seismic.timeDifference > 60 ? Int(round(seismic.timeDifference / 60)) : Int(seismic.timeDifference)
timeLabel.text = "🕗 \(formattedDate) - \(timeRounded) \(timeSuffix)"
} else {
timeLabel.text = "🕗 no time available"
}
let distanceRounded = Int(round(seismic.userDistance))
distanceLabel.text = "📐 \(distanceRounded) km \(NSLocalizedString("dalla tua posizione", comment: ""))"
let coordinateText = coordinateString(coordinate: seismic.coordinate.coordinate)
@@ -537,7 +544,8 @@ class SeismicNetworkTableViewCell: UITableViewCell {
@objc func weatherTapped(_ sender: UIButton) {
if displayType != .weatherExpanded {
delegate?.seismicNetworkCellDidTapWeather(self)
let validData = seismic?.weatherCode != nil
delegate?.seismicNetworkCellDidTapWeather(self, hasValidWeatherData: validData)
}
}
@@ -250,9 +250,18 @@ extension SeismicNetworksViewController: SeismicNetworkTableViewCellDelegate {
present(controller, animated: true)
}
func seismicNetworkCellDidTapWeather(_ cell: SeismicNetworkTableViewCell) {
func seismicNetworkCellDidTapWeather(_ cell: SeismicNetworkTableViewCell, hasValidWeatherData: Bool) {
guard let index = tableView?.indexPath(for: cell) else { return }
if !hasValidWeatherData {
let alert = UIAlertController(title: NSLocalizedString("Attenzione", comment: ""),
message: NSLocalizedString("weather_nodata", comment: ""),
preferredStyle: .alert)
alert.addAction(UIAlertAction(title: NSLocalizedString("OK", comment: ""), style: .default))
present(alert, animated: true)
return
}
let indexToReloads = [openMapIndexPath, openWeatherIndexPath, index].compactMap { $0 }
openWeatherIndexPath = index
@@ -0,0 +1,25 @@
//
// NSDictionary+EQNExtensions.h
// Earthquake Network
//
// Created by Andrea Busi on 03/10/2020.
// Copyright © 2020 Earthquake Network. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface NSDictionary (EQNExtensions)
/// Returns a string representation of the current dictionary
/// @param prettyPrint If YES, uses white space and indentation to make the output more readable.
- (NSString *)eqn_jsonStringWithPrettyPrint:(BOOL)prettyPrint;
/// Returns the value associated with a given key if exists, nil otherwise.
/// @param aKey The key for which to return the corresponding value
- (nullable id)eqn_safeObjectForKey:(id)aKey;
@end
NS_ASSUME_NONNULL_END
@@ -0,0 +1,36 @@
//
// NSDictionary+EQNExtensions.h
// Earthquake Network
//
// Created by Andrea Busi on 03/10/2020.
// Copyright © 2020 Earthquake Network. All rights reserved.
//
#import "NSDictionary+EQNExtensions.h"
@implementation NSDictionary (BVJSONString)
#pragma mark - Public
- (NSString *)eqn_jsonStringWithPrettyPrint:(BOOL)prettyPrint
{
NSError *error;
NSJSONWritingOptions options = prettyPrint ? NSJSONWritingPrettyPrinted : 0;
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:self options:options error:&error];
if (!jsonData) {
return @"{}";
}
return [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
}
- (id)eqn_safeObjectForKey:(id)aKey
{
NSObject *object = [self objectForKey:aKey];
if (object == [NSNull null]) {
return nil;
}
return object;
}
@end
@@ -1,18 +0,0 @@
//
// NSDictionary+BVJSONString.h
// Smash
//
// Created by Luca Beretta on 24/03/2019.
// Copyright © 2019 Luca Beretta. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface NSDictionary (BVJSONString)
-(NSString*) bv_jsonStringWithPrettyPrint:(BOOL) prettyPrint;
@end
NS_ASSUME_NONNULL_END
@@ -1,25 +0,0 @@
//
// NSDictionary+BVJSONString.m
// Smash
//
// Created by Luca Beretta on 24/03/2019.
// Copyright © 2019 Luca Beretta. All rights reserved.
//
#import "NSDictionary+BVJSONString.h"
@implementation NSDictionary (BVJSONString)
-(NSString*) bv_jsonStringWithPrettyPrint:(BOOL) prettyPrint {
NSError *error;
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:self
options:(NSJSONWritingOptions) (prettyPrint ? NSJSONWritingPrettyPrinted : 0)
error:&error];
if (! jsonData) {
NSLog(@"%s: error: %@", __func__, error.localizedDescription);
return @"{}";
} else {
return [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
}
}
@end
@@ -109,12 +109,13 @@ import Foundation
@objc func filterSeismicList(_ list: [EQNSisma]) -> [EQNSisma] {
// enti abilitati
let networks: [String]
var networks: [String]
if let savedNetworks = UserDefaults.standard.object(forKey: IMPOSTAZIONE_ENTI_RETI_SISMICHEI) as? [String] {
networks = savedNetworks
} else {
networks = EQNData.seismicNetworkAcronyms()
}
networks = networks.map { $0.lowercased() }
// filtri
let filterDistance = Double(distanzaMassima)
@@ -130,7 +131,7 @@ import Foundation
for seismic in list {
var keep = true
if !networks.contains(seismic.provider) {
if !networks.contains(seismic.provider.lowercased()) {
keep = false
}
+2 -2
View File
@@ -26,14 +26,14 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, strong) NSString *place;
@property (nonatomic, strong) NSString *provider;
/// Date of the seismic
@property (nonatomic, strong) NSDate *date;
@property (nonatomic, strong, nullable) NSDate *date;
/// Difference between seismic and user time (ex. 1 hour ago)
@property (nonatomic) NSTimeInterval timeDifference;
@property (nonatomic, strong) NSNumber *magnitudeRange;
@property (nonatomic, strong) NSNumber *preliminary;
@property (nonatomic, strong) NSNumber *smartphoneNumber;
@property (nonatomic, strong) NSNumber *userNumber;
@property (nonatomic, strong) NSString *weatherCode;
@property (nonatomic, strong, nullable) NSString *weatherCode;
@property (nonatomic, strong) NSString *weatherIcon;
@property (nonatomic, strong) NSNumber *weatherCloud;
@property (nonatomic, strong) NSNumber *weatherWindSpeed;
+3 -2
View File
@@ -9,6 +9,7 @@
#import "EQNSisma.h"
#import "EQNUser.h"
#import "EQNUtility.h"
#import "NSDictionary+EQNExtensions.h"
@implementation EQNSisma
@@ -34,7 +35,7 @@
self.intensity = info[@"it"];
self.place = info[@"pl"];
self.provider = info[@"pr"];
self.date = [EQNUtility getDataFromString:info[@"dt"]];
self.date = [EQNUtility getDateFromString:info[@"dt"]];
self.timeDifference = [info[@"di"] doubleValue];
self.magnitudeRange = info[@"mr"];
@@ -42,7 +43,7 @@
self.smartphoneNumber = info[@"sm"];
self.userNumber = info[@"rp"];
self.weatherCode = info[@"wc"];
self.weatherCode = [info eqn_safeObjectForKey:@"wc"];
self.weatherIcon = info[@"ic"];
self.weatherCloud = info[@"cl"];
self.weatherWindSpeed = info[@"ws"];
+2 -2
View File
@@ -10,7 +10,7 @@
#import "Reachability.h"
#import "Costanti.h"
#import "EQNUtility.h"
#import "NSDictionary+BVJSONString.h"
#import "NSDictionary+EQNExtensions.h"
@interface ServerRequest ()
@@ -162,7 +162,7 @@
{
NSString *jsonObjectString = [ricevuta base64EncodedStringWithOptions:0];
NSDictionary *params = @{@"ricevuta" :jsonObjectString};
NSString *parametri = [params bv_jsonStringWithPrettyPrint:YES];
NSString *parametri = [params eqn_jsonStringWithPrettyPrint:YES];
NSMutableURLRequest * urlRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@""]];
[urlRequest setHTTPMethod:@"POST"];
@@ -525,16 +525,16 @@
"x3N-F9-QOy.text" = "Versión PRO";
"xwb-Pw-WFu.normalTitle" = "INICIAR LA CONVERSIÓN";
"gGN-X8-wUL.text" = "Está pagando:";
"Xkb-Nt-Fiw.normalTitle" = "Informativa privacy"; // missing
"dnA-Yy-Ado.normalTitle" = "Termini e condizioni"; // missing
"Xkb-Nt-Fiw.normalTitle" = "Nota informativa sobre privacidady";
"dnA-Yy-Ado.normalTitle" = "Términos y condiciones";
"6z8-bz-exh.text" = "Está comprando la versión pro, el anuncios serán eliminados";
// Subscriptions
"c9L-RP-VQh.text" = "Suscripción activa";
"ZXY-1S-WBT.text" = "Servicio de prioridad";
"axa-WN-rP3.text" = "Ninguna suscripción activa";
"ZqJ-8B-jWz.normalTitle" = "Informativa privacy"; // missing
"Lur-Tu-wib.normalTitle" = "Termini e condizioni"; // missing
"ZqJ-8B-jWz.normalTitle" = "Nota informativa sobre privacidady";
"Lur-Tu-wib.normalTitle" = "Términos y condiciones";
"BNz-EW-lXI.text" = "Se envía una alerta a los usuarios de la app cada vez que se detecta un sismo en tiempo real. Alertar a todos los usuarios puede tomar hasta 30 segundos ya que no es técnicamente factible alertar instantáneamente a todos. Ahora puedes unirte a las primeras 10'000 o 100'000 personas alertadas en tiempo real. El orden de alerta es el siguiente: primero todos los usuarios con el servicio TOP 10K, luego todos los usuarios con el servicio TOP 100K y finalmente todos los demás usuarios. Para el mismo servicio, el orden de alerta se basa en la distancia desde el epicentro.";
"s4u-Jd-ULw.text" = "• Tu pago se cargará a tu cuenta de iTunes después de la confirmación de la compra\n\n• La suscripción se renueva automáticamente a menos que la renovación automática se desactive al menos 24 horas antes del final del período actual\n\n• Se cobrará la suscripción para la renovación dentro de las 24 horas antes del final del período actual\n\n• Las suscripciones pueden ser administradas por el usuario y la renovación automática puede desactivarse accediendo a la configuración de la cuenta del usuario después de la compra.";
"iY8-yI-DH9.normalTitle" = "SUSCRIBIR AL SERVICIO";
@@ -525,16 +525,16 @@
"x3N-F9-QOy.text" = "Versione PRO";
"xwb-Pw-WFu.normalTitle" = "INIZIA LA CONVERSIONE";
"gGN-X8-wUL.text" = "Stai pagando:";
"Xkb-Nt-Fiw.normalTitle" = "Informativa privacy"; // missing
"dnA-Yy-Ado.normalTitle" = "Termini e condizioni"; // missing
"Xkb-Nt-Fiw.normalTitle" = "Informativa privacy";
"dnA-Yy-Ado.normalTitle" = "Termini e condizioni";
"6z8-bz-exh.text" = "Stai acquistando la versione pro, verrà rimossa la pubblicità";
// Subscriptions
"c9L-RP-VQh.text" = "Servizi attivi";
"ZXY-1S-WBT.text" = "Servizio di priorità";
"axa-WN-rP3.text" = "Nessun servizio attivo";
"ZqJ-8B-jWz.normalTitle" = "Informativa privacy"; // missing
"Lur-Tu-wib.normalTitle" = "Termini e condizioni"; // missing
"ZqJ-8B-jWz.normalTitle" = "Informativa privacy";
"Lur-Tu-wib.normalTitle" = "Termini e condizioni";
"BNz-EW-lXI.text" = "Un'allerta è inviata agli utenti dell'app ogni volta che un sisma è rilevato in tempo reale. Allertare tutti può richiedere fino a 30 secondi in quanto non è tecnicamente fattibile farlo istantaneamente. Ora puoi entrare a far parte delle liste di priorità delle prime 10'000 o 100'000 persone allertate. L'ordine di allerta è il seguente: prima tutti gli utenti con servizio TOP 10K, successivamente tutti gli utenti con servizio TOP 100K ed infine tutti gli altri utenti. A parità di servizio, l'ordine di allerta si basa sulla distanza dall'epicentro.";
"s4u-Jd-ULw.text" = "• Il pagamento verrà addebitato sull\'account iTunes alla conferma dell\'acquisto\n\n• L\'abbonamento si rinnova automaticamente a meno che il rinnovo automatico non venga disattivato almeno 24 ore prima della fine del periodo corrente\n\n• L\'abbonamento verrà addebitato per il rinnovo entro 24 ore prima della fine del periodo corrente e identificato il costo del rinnovo\n\n• Le sottoscrizioni possono essere gestite dall\'utente e il rinnovo automatico può essere disattivato accedendo alle Impostazioni account dell\'utente dopo l\'acquisto.";
"iY8-yI-DH9.normalTitle" = "ABBONATI AL SERVIZIO";
@@ -714,6 +714,7 @@
"weather_windspeed" = "Wind speed: %@m/s";
"weather_humidity" = "Humidity: %@%%";
"weather_clouds" = "Cloud cover: %@%%";
"weather_nodata" = "No weather data are available for this quake";
"official_prelimiary" = "Preliminary";
"calendar_description_nogeo_km" = "Earthquake M%@, depth %@ km.";
"filter_empty" = "Based on the filters and seismic networks enabled, there are no earthquakes in the last 24 hours. To change the filters click on the purple bar at the bottom. To enable other seismic networks click on the world icon at the top.";
@@ -709,6 +709,7 @@
"weather_windspeed" = "Velocidad viento: %@m/s";
"weather_humidity" = "Humedad: %@%%";
"weather_clouds" = "Cubierta de nubes: %@%%";
"weather_nodata" = "Los datos del tiempo no están disponible para este sismo";
"official_prelimiary" = "Preliminar";
"calendar_description_nogeo_km" = "Sismo M%@, profundidad %@ km.";
"filter_empty" = "Según los filtros y las redes sísmicas habilitadas, no hay sismos en las últimas 24 horas. Para cambiar los filtros, haga clic en la barra en la parte inferior. Para habilitar otras redes sísmicas, haga clic en el icono en forma de mundo en la parte superior.";
@@ -702,6 +702,7 @@
"weather_windspeed" = "Velocità vento: %@m/s";
"weather_humidity" = "Umidità: %@%%";
"weather_clouds" = "Copertura nuvolosa: %@%%";
"weather_nodata" = "I dati meteo non sono disponibili per questo sisma";
"official_prelimiary" = "Preliminare";
"calendar_description_nogeo_km" = "Sisma M%@, profondità %@ km.";
"filter_empty" = "In base ai filtri ed alle reti sismiche abilitate, non ci sono sismi nelle ultime 24 ore. Per modificare i filtri clicca sulla barra in basso. Per abilitare altre reti sismiche clicca sull\'icona a forma di mondo in alto.";
@@ -205,7 +205,7 @@
}
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, n_o_rspr, n_o_bdtim, n_o_ncs];
NSString *n_o_strong = [NSString stringWithFormat:@"n_o_strong=%i",[EQNNotificheReteSismiche sharedInstance].isTerremortiForti];
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
@@ -238,7 +238,7 @@
NSString *n_e_type = [NSString stringWithFormat:@"&n_e_type=%@", [EQNAllertaSismica sharedInstance].sismiDaNotificare];
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];
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];
return [NSURL URLWithString:stringUrl];
@@ -20,7 +20,7 @@
_users = info[@"users"];
_state = info[@"state"];
_code = info[@"code"];
_date = [EQNUtility getDataFromString:info[@"date"]];
_date = [EQNUtility getDateFromString:info[@"date"]];
_differencePas = info[@"difference"];
_intensity = info[@"intensity"];
}
@@ -19,8 +19,7 @@
_ban = info[@"ban"];
_code = info[@"code"];
// NSDate *dateServer = [dataFormatter dateFromString:info[@"data"]];
_date = [EQNUtility getDataFromString:info[@"date"]];
_date = [EQNUtility getDateFromString:info[@"date"]];
_differenceSeg = info[@"difference"];
_latitude = info[@"latitude"];
_longitude = info[@"longitude"];
@@ -17,7 +17,11 @@ NS_ASSUME_NONNULL_BEGIN
@interface EQNUtility : NSObject
+(NSDate *)getDataFromString:(NSString *)stringData;
/// Converts date received from web server into Date objects
/// Time zone of the received date is Europe/Rome
/// @param dateString String date received
/// @return Date object
+ (nullable NSDate *)getDateFromString:(NSString *)dateString;
+(NSArray *)applicaFiltroWithTime:(EQNFiltriMappa )filtro withList:(NSArray *)list;
+(void)writeArrayWithCustomObjToUserDefaults:(NSString *)keyName withArray:(NSArray *)myArray;
+(void)writeArrayWithCustomObjToUserDefaults:(NSString *)keyName withDict:(NSDictionary *)myDict;
@@ -14,11 +14,12 @@
@implementation EQNUtility
+(NSDate *)getDataFromString:(NSString *)stringData{
NSDateFormatter *dataFormatter = [[NSDateFormatter alloc] init];
[dataFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
return [dataFormatter dateFromString:stringData];
+ (NSDate *)getDateFromString:(NSString *)dateString
{
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
formatter.timeZone = [NSTimeZone timeZoneWithName:@"Europe/Rome"];
[formatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
return [formatter dateFromString:dateString];
}
+(NSDate *)impostaFiltroWithTime:(EQNFiltriMappa )filtro{