Compare commits
196 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 122cf497b3 | |||
| 361b51a5a2 | |||
| bbfd28c5d2 | |||
| e399c53de1 | |||
| d8c0d48ad2 | |||
| a474d5782f | |||
| c538ca7dcb | |||
| b11af3d138 | |||
| 8e1b1bd5a7 | |||
| 67546801ac | |||
| 6135e2d38c | |||
| e46fa0417d | |||
| dc6bb13960 | |||
| 6aecff1415 | |||
| 6fcf58608f | |||
| 65ed82445b | |||
| ab727b119b | |||
| 1bd833093b | |||
| 904d4c5de8 | |||
| 720d0fcd2a | |||
| 8f50ed0a25 | |||
| 4f3bd9aa95 | |||
| cb30995a07 | |||
| faeb9c0788 | |||
| d286909a8d | |||
| 499d689943 | |||
| 89e7989abc | |||
| bf4a5e7728 | |||
| e1bd26db48 | |||
| 509b75e7b5 | |||
| 5e16909f12 | |||
| 53817ac52a | |||
| 54c6297637 | |||
| 0374a0a1bd | |||
| cf7ae31eb1 | |||
| 92e75913ab | |||
| 061c321c2b | |||
| d50104a2f9 | |||
| 81d554cc78 | |||
| bda81d01ba | |||
| 708e6dd92f | |||
| 74d7c71ed4 | |||
| 27503c1643 | |||
| 95935dd377 | |||
| b357039901 | |||
| df8c154848 | |||
| 882e0ba4b6 | |||
| 88572c2829 | |||
| bad1ce5879 | |||
| ce387912f8 | |||
| 8f711b988a | |||
| e202ba8452 | |||
| eb8d8be800 | |||
| a1b7a5ee70 | |||
| 7a117097e3 | |||
| 8070262a44 | |||
| f768b15916 | |||
| a07480f90a | |||
| 4e5e93e3f1 | |||
| 68c9eb9bbc | |||
| ba2fbfaa60 | |||
| e194731bc8 | |||
| 928793b755 | |||
| 3d7a0ad9f6 | |||
| 00a54dede1 | |||
| 76861163a3 | |||
| 8ba2f8cea6 | |||
| bcfadc7f3e | |||
| e830e2eeb5 | |||
| e37ea4757d | |||
| 5504160db6 | |||
| 0dddb1c69b | |||
| 9c70f0a6d6 | |||
| d6d3ee8682 | |||
| 397e1c6e24 | |||
| 2b304cd7aa | |||
| 88c1c5aa16 | |||
| 7a9206b15a | |||
| ee7596644b | |||
| 85191d228e | |||
| b3f099efd8 | |||
| e11c5f8f19 | |||
| bbcf67d7cc | |||
| 89193b61ce | |||
| d5993d01bf | |||
| 3b379a5da1 | |||
| 7013b868b2 | |||
| 211de82031 | |||
| e8b5f742d1 | |||
| 0731a1e134 | |||
| 1dc71ca8df | |||
| ea275e46b9 | |||
| de1912ea99 | |||
| 4ec735ac9e | |||
| c15aeb0e3a | |||
| 3b5e8e395f | |||
| 672982d7d5 | |||
| 2ee413d9c8 | |||
| 39a10b2cbc | |||
| 0eb0880b0e | |||
| 73c8ce1094 | |||
| 4bb4815cd1 | |||
| 1501b88a02 | |||
| cd94302e00 | |||
| eed5f6ae28 | |||
| d29621492a | |||
| e56919d279 | |||
| 28f31979bb | |||
| 3b93ab84ce | |||
| 8a4f6436f0 | |||
| ea2573c17c | |||
| 0f5c4fc8dc | |||
| a871f7b27b | |||
| b88a1e197f | |||
| d4986ac610 | |||
| 831c33bdb9 | |||
| 7438f8bfb9 | |||
| 86de3fa026 | |||
| b47fdcb8a1 | |||
| ce3436876d | |||
| 2d0a453626 | |||
| e9cc1e9ea2 | |||
| 2627eef807 | |||
| 4cf1ae1fb3 | |||
| c7bf8ecc94 | |||
| 323a9df3e8 | |||
| ce21acce3b | |||
| 81f8740486 | |||
| 41c4170e71 | |||
| 16e0d15522 | |||
| 62e6437d4a | |||
| a71ee9afbf | |||
| bb3c8798f3 | |||
| c23012cc56 | |||
| 4a77692e23 | |||
| d6b6d6883f | |||
| 5528756aad | |||
| 1970cc21ec | |||
| bb54e78278 | |||
| 5cef7215df | |||
| ffa63352b2 | |||
| c6ee123eee | |||
| e9846cc75d | |||
| 1792f4b4bb | |||
| 7e7747efcb | |||
| 0d5bf272c1 | |||
| 8201ece916 | |||
| 0148ac65f7 | |||
| 8d0439f7f8 | |||
| 31f928fed9 | |||
| 93f72cddb7 | |||
| fe8f9f46fd | |||
| 33f2d45cb9 | |||
| 4b457286dd | |||
| 6b2d690491 | |||
| b02d3dbb8e | |||
| b8feb2fa70 | |||
| b1b7ddd8c1 | |||
| 84ee7b7958 | |||
| 4fbbb8e4fc | |||
| 6e1a982188 | |||
| de1167fcad | |||
| 031b731e30 | |||
| ccc74f6b39 | |||
| 0a5902c5f1 | |||
| e494109a72 | |||
| 530ce3d56f | |||
| 1c0a449c05 | |||
| b70bd95a6d | |||
| 87becee4fb | |||
| 9344eae39a | |||
| bed5198bbc | |||
| c416a12c1b | |||
| 6ebc4d319a | |||
| e93ddc91d6 | |||
| aa765d7bac | |||
| 388fbfd2e5 | |||
| e0661c138b | |||
| 9c7f9eaaf0 | |||
| 984c18e435 | |||
| 2f5e0f0492 | |||
| eadba2b1e7 | |||
| ed236371ed | |||
| b1772d7712 | |||
| 4672549f2d | |||
| 08a493d0a3 | |||
| 6a056ec8d1 | |||
| 0636ea65da | |||
| 7f9543309a | |||
| 8440c70fb2 | |||
| ac553df6c6 | |||
| 803843598c | |||
| 11884cd897 | |||
| 050b4467d6 | |||
| 2b01ffe621 | |||
| 78abc28a7e |
@@ -1,20 +1,200 @@
|
||||
# Changelog
|
||||
|
||||
## Versione 3.1.0
|
||||
|
||||
### Build (46)
|
||||
- Corretto invio parametri per test allerta
|
||||
|
||||
### Build (45)
|
||||
- Rimossi suoni non utilizzati
|
||||
- Rivista content extension notifica
|
||||
|
||||
## Versione 3.0
|
||||
|
||||
### Build (44)
|
||||
- Corrette stringhe in tab Sismi
|
||||
- Disabilitato zoom mappa in Allerte
|
||||
- Nascosto bottone per "Simulatore"
|
||||
- Corretto problema ritardo visualizzazione notifiche push
|
||||
- Suono notifiche riprodotto anche con app in foreground
|
||||
- Icone in notifiche caricate da locale e non scaricate dal server
|
||||
- Aggiornato suono notifica
|
||||
|
||||
### Build (43)
|
||||
- Corretto scaricamento dati sismi per gestione "qualsiasi terremoto se < 50 km"
|
||||
- Corretta selezione cella "dati posizione"
|
||||
|
||||
### Build (42)
|
||||
- Corretto filtro rete GEONET
|
||||
- Completata funzione "Test allerta"
|
||||
- Aggiunta card "dati posizione"
|
||||
|
||||
### Build (40)
|
||||
- Completato flusso e alert per invio messaggio
|
||||
- Correzioni layout
|
||||
|
||||
### Build (39)
|
||||
- Ombra e angoli arrotondati in card
|
||||
- Funzione test allerte (WIP)
|
||||
|
||||
### Build (38)
|
||||
- Aggiornate icone stelle
|
||||
- Aggiunto messaggio localizzazione
|
||||
- Rimosso bottone invio messaggio
|
||||
|
||||
### Build (37)
|
||||
- Correzioni varie layout
|
||||
- Corretto flusso invio commento
|
||||
|
||||
### Build (36)
|
||||
- Migrate chiamate ad HTTPS
|
||||
- Rimossa eccezione AppTransportSecurity per chiamate non sicure
|
||||
- Aggiunto meccanismo cache per sismi
|
||||
- Rivisto layout tab Segnalazioni (WIP)
|
||||
- Rivisto layout tab Allerte (WIP)
|
||||
|
||||
## 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)
|
||||
- Apertura automatica selezione nazione (solo 1 volta, ad installazione/update app)
|
||||
- Corretti decimali in layout card sisma
|
||||
- Rimosso controller loading iniziale
|
||||
|
||||
### Build (33)
|
||||
- Corretto crash con lingua spagnola
|
||||
|
||||
### Build (32)
|
||||
- Aggiunto testo in condivisione sisma
|
||||
- Aggiunte icone in notifiche push per nuove reti
|
||||
|
||||
### Build (31)
|
||||
- Risolto crash in reload tabella reti sismiche
|
||||
- Possibile fix per crash in background
|
||||
|
||||
### Build (30)
|
||||
- Migliorata selezione nazione
|
||||
- Corretta traduzione errata
|
||||
|
||||
### Build (29)
|
||||
- Corretti colore e udm magnitudo in schede sisma
|
||||
- Aggiunte nuove reti sismiche
|
||||
- Migrato a nuovo endpoint per salvataggio settings
|
||||
- Corretto errore in invio parametri settings
|
||||
- Aggiunto aggiornamento reti notifiche da selezione nazione
|
||||
|
||||
### Build (28)
|
||||
- Messaggio se tabella sismi è vuota
|
||||
- Corretto filtro enti
|
||||
|
||||
### Build (27)
|
||||
- Corretto zoom mappa
|
||||
- Corretto elenco reti e ordinato in filtri
|
||||
- Apertura mappa da cella espansa
|
||||
- Aggiornate icone sezione sismi e aggiunga espandi/collassa
|
||||
|
||||
### Build (26)
|
||||
- Aggiunto salvataggio evento in calendario
|
||||
- Aggiunta logica mancante (filtri, impostazioni e mappa dettaglio)
|
||||
- Corretto layout schede sismi
|
||||
- Aggiunta gestione campanella
|
||||
- Aggiunto popup per impostazioni singola card
|
||||
|
||||
### Build (25)
|
||||
- Nuovo layout in schede sismi
|
||||
|
||||
### Build (23)
|
||||
- Refresh impostazioni se torno da filtri
|
||||
- Cambiata API per download sismi e aggiornati relativi modelli
|
||||
- Aggiunta nuova gestione per download sismi in base a magnitudo
|
||||
|
||||
### Build (22)
|
||||
- Aggiunto aggiornamento impostazioni notifiche se toggle filtri sismi è attivo
|
||||
- Correzioni grafiche varie
|
||||
|
||||
### Build (21)
|
||||
- Ricreato controlle per gestione filtri Sismi
|
||||
- Aggiunti filtri mancanti e rivista logica filtro
|
||||
- Compilazione con Xcode 12 (iOS 14)
|
||||
|
||||
### Build (20)
|
||||
- Ricreati controller per gestione filtri in sezione Sismi
|
||||
|
||||
## Versione 2.2.1
|
||||
|
||||
### Build (24)
|
||||
- Corretto problema in salvataggio impostazione allerte in tempo reale
|
||||
|
||||
## Versione 2.2
|
||||
|
||||
### Build (19)
|
||||
- Semplificate alcune voci nel menu Impostazioni
|
||||
|
||||
### Build (18)
|
||||
- Impostazioni occupa ora un tab di navigazione
|
||||
- Rimosso menu laterale e spostati link in sezione Impostazioni
|
||||
- Rimossi riferimenti a CoraData inutilizzati
|
||||
- Aggiornata icona app
|
||||
- Aggiornati messaggi per permesso localizzatione (stato Consenti Sempre)
|
||||
|
||||
## Versione 2.1
|
||||
|
||||
### Build (17)
|
||||
- Utilizzo nuove icone interne all'app
|
||||
|
||||
### Build (16)
|
||||
- Correzioni varie a menu impostazioni
|
||||
|
||||
### Build (15)
|
||||
- Completamento restyling sezione Impostazioni
|
||||
- Correzioni varie in impostazioni (issue #11)
|
||||
|
||||
### Build (14)
|
||||
- Inizio restyling sezione Impostazioni (Notifiche sismi con nuovo layout)
|
||||
|
||||
### Build (13)
|
||||
- Aggiornate dipendenze (GMA SDK compatibile con iOS 14)
|
||||
- Risolti warning Xcode 11.5
|
||||
|
||||
### Build (12)
|
||||
- Migliorata gestione layout banner in sezioni principali (se banner è nascosto, tabella occupa tutto lo spazio disponibile)
|
||||
- Corretta gesture per aprire menu laterale
|
||||
- Aggiornate icone con nuova versione
|
||||
|
||||
### Build (11)
|
||||
- Corretto crash in invio segnalazione sisma
|
||||
|
||||
### Build (10)
|
||||
- Utilizzo tab bar nativa per gestione sezioni app
|
||||
- Rimossa sezione Tsunami
|
||||
|
||||
## Versione 2.0
|
||||
|
||||
## Build (9)
|
||||
### Build (9)
|
||||
- Aggiunta integrazione con Crashlytics
|
||||
- Risolto problema con mappa segnalazioni
|
||||
|
||||
## Build (8)
|
||||
### Build (8)
|
||||
- Aggiunti loader durante caricamenti prodotti
|
||||
- Gestiti messaggi di conferma restore acquisti
|
||||
|
||||
## Build (7)
|
||||
### Build (7)
|
||||
- Abbonamenti annuali sbloccano versione pro
|
||||
- Rivisto codice per gestione versione pro e rimosso codice duplicato
|
||||
|
||||
## Build (6)
|
||||
### Build (6)
|
||||
- Rifatti controller per versione Pro e abbonamenti
|
||||
- Allineati comportamenti acquisti in-app con versione Android
|
||||
- Fix crash alla prima installazione
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="M4Y-Lb-cyx">
|
||||
<device id="retina4_7" orientation="portrait">
|
||||
<adaptation id="fullscreen"/>
|
||||
</device>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="17156" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="M4Y-Lb-cyx">
|
||||
<device id="retina4_7" orientation="portrait" appearance="light"/>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14490.49"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17125"/>
|
||||
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
@@ -15,68 +13,61 @@
|
||||
<objects>
|
||||
<viewController id="M4Y-Lb-cyx" userLabel="Notification View Controller" customClass="NotificationViewController" sceneMemberID="viewController">
|
||||
<view key="view" contentMode="scaleToFill" simulatedAppContext="notificationCenter" id="S3S-Oj-5AN">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="480"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="330"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="pCT-Wh-lut">
|
||||
<rect key="frame" x="30" y="28" width="274" height="33"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="33" id="3nL-zP-Xy4"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="boldSystem" pointSize="17"/>
|
||||
<nil key="textColor"/>
|
||||
<rect key="frame" x="8" y="216" width="304" height="20.5"/>
|
||||
<fontDescription key="fontDescription" style="UICTFontTextStyleHeadline"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="f3d-th-bgU">
|
||||
<rect key="frame" x="16" y="69" width="288" height="47"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="47" id="ret-xK-EBP"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="bT3-3m-qLh">
|
||||
<rect key="frame" x="16" y="124" width="288" height="29"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="29" id="Uqp-c7-9jk"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="boldSystem" pointSize="17"/>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="bT3-3m-qLh">
|
||||
<rect key="frame" x="8" y="285" width="304" height="29"/>
|
||||
<fontDescription key="fontDescription" style="UICTFontTextStyleTitle2"/>
|
||||
<color key="textColor" red="0.91764705879999997" green="0.46274509800000002" blue="0.0078431372550000003" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<mapView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" mapType="standard" translatesAutoresizingMaskIntoConstraints="NO" id="4ID-Zb-OQF">
|
||||
<rect key="frame" x="0.0" y="161" width="320" height="259"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="200"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="259" id="WpP-bs-nlm"/>
|
||||
<constraint firstAttribute="height" constant="200" id="Pgl-8e-ePq"/>
|
||||
</constraints>
|
||||
<connections>
|
||||
<outlet property="delegate" destination="M4Y-Lb-cyx" id="Cs2-OY-eT2"/>
|
||||
</connections>
|
||||
</mapView>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="f3d-th-bgU">
|
||||
<rect key="frame" x="8" y="244.5" width="304" height="20.5"/>
|
||||
<fontDescription key="fontDescription" style="UICTFontTextStyleBody"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="4ID-Zb-OQF" firstAttribute="leading" secondItem="2BE-c3-nQJ" secondAttribute="leading" id="6ml-zm-WGB"/>
|
||||
<constraint firstItem="f3d-th-bgU" firstAttribute="top" secondItem="pCT-Wh-lut" secondAttribute="bottom" constant="8" id="7wZ-2G-DRJ"/>
|
||||
<constraint firstItem="f3d-th-bgU" firstAttribute="leading" secondItem="2BE-c3-nQJ" secondAttribute="leading" constant="16" id="B18-89-k0p"/>
|
||||
<constraint firstItem="2BE-c3-nQJ" firstAttribute="trailing" secondItem="f3d-th-bgU" secondAttribute="trailing" constant="16" id="JZ8-8S-jXR"/>
|
||||
<constraint firstItem="2BE-c3-nQJ" firstAttribute="trailing" secondItem="pCT-Wh-lut" secondAttribute="trailing" constant="16" id="P48-jk-9M7"/>
|
||||
<constraint firstItem="4ID-Zb-OQF" firstAttribute="top" secondItem="bT3-3m-qLh" secondAttribute="bottom" constant="8" id="beN-rS-bGS"/>
|
||||
<constraint firstItem="bT3-3m-qLh" firstAttribute="leading" secondItem="2BE-c3-nQJ" secondAttribute="leading" constant="16" id="cYK-5u-EMT"/>
|
||||
<constraint firstItem="4ID-Zb-OQF" firstAttribute="bottom" secondItem="2BE-c3-nQJ" secondAttribute="bottom" constant="-60" id="gfC-gJ-8KE"/>
|
||||
<constraint firstItem="bT3-3m-qLh" firstAttribute="top" secondItem="f3d-th-bgU" secondAttribute="bottom" constant="8" id="ixD-Y8-JnR"/>
|
||||
<constraint firstItem="4ID-Zb-OQF" firstAttribute="trailing" secondItem="2BE-c3-nQJ" secondAttribute="trailing" id="n4A-8c-Bbr"/>
|
||||
<constraint firstItem="2BE-c3-nQJ" firstAttribute="trailing" secondItem="bT3-3m-qLh" secondAttribute="trailing" constant="16" id="sak-kv-U04"/>
|
||||
<constraint firstItem="pCT-Wh-lut" firstAttribute="leading" secondItem="2BE-c3-nQJ" secondAttribute="leading" constant="30" id="tuy-Pe-AhL"/>
|
||||
<constraint firstItem="pCT-Wh-lut" firstAttribute="top" secondItem="2BE-c3-nQJ" secondAttribute="top" constant="8" id="xC7-C5-Yju"/>
|
||||
</constraints>
|
||||
<viewLayoutGuide key="safeArea" id="2BE-c3-nQJ"/>
|
||||
<constraints>
|
||||
<constraint firstItem="pCT-Wh-lut" firstAttribute="leading" secondItem="2BE-c3-nQJ" secondAttribute="leading" constant="8" id="3cg-0U-ASJ"/>
|
||||
<constraint firstItem="f3d-th-bgU" firstAttribute="leading" secondItem="pCT-Wh-lut" secondAttribute="leading" id="7qA-vV-ocI"/>
|
||||
<constraint firstItem="2BE-c3-nQJ" firstAttribute="trailing" secondItem="pCT-Wh-lut" secondAttribute="trailing" constant="8" id="CAC-UM-SaJ"/>
|
||||
<constraint firstItem="f3d-th-bgU" firstAttribute="trailing" secondItem="pCT-Wh-lut" secondAttribute="trailing" id="Dd7-BF-iOG"/>
|
||||
<constraint firstItem="f3d-th-bgU" firstAttribute="top" secondItem="pCT-Wh-lut" secondAttribute="bottom" constant="8" id="FJ8-nn-ydU"/>
|
||||
<constraint firstItem="2BE-c3-nQJ" firstAttribute="bottom" secondItem="bT3-3m-qLh" secondAttribute="bottom" constant="16" id="I71-6U-jK3"/>
|
||||
<constraint firstItem="pCT-Wh-lut" firstAttribute="top" secondItem="4ID-Zb-OQF" secondAttribute="bottom" constant="16" id="It9-RA-906"/>
|
||||
<constraint firstItem="bT3-3m-qLh" firstAttribute="trailing" secondItem="f3d-th-bgU" secondAttribute="trailing" id="KXf-x4-iZs"/>
|
||||
<constraint firstItem="bT3-3m-qLh" firstAttribute="leading" secondItem="f3d-th-bgU" secondAttribute="leading" id="QlJ-Vh-oi4"/>
|
||||
<constraint firstItem="bT3-3m-qLh" firstAttribute="top" secondItem="f3d-th-bgU" secondAttribute="bottom" constant="20" id="UUO-2F-eE7"/>
|
||||
<constraint firstItem="4ID-Zb-OQF" firstAttribute="trailing" secondItem="2BE-c3-nQJ" secondAttribute="trailing" id="buf-BU-I5b"/>
|
||||
<constraint firstItem="4ID-Zb-OQF" firstAttribute="leading" secondItem="2BE-c3-nQJ" secondAttribute="leading" id="e8D-ji-t64"/>
|
||||
<constraint firstItem="4ID-Zb-OQF" firstAttribute="top" secondItem="2BE-c3-nQJ" secondAttribute="top" id="hL6-gc-S6i"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<extendedEdge key="edgesForExtendedLayout"/>
|
||||
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
|
||||
<size key="freeformSize" width="320" height="480"/>
|
||||
<size key="freeformSize" width="320" height="330"/>
|
||||
<connections>
|
||||
<outlet property="descrizione" destination="f3d-th-bgU" id="3PP-J5-iAi"/>
|
||||
<outlet property="mappa" destination="4ID-Zb-OQF" id="d2K-qy-Q7P"/>
|
||||
<outlet property="onda" destination="bT3-3m-qLh" id="xoD-qM-UAF"/>
|
||||
<outlet property="titolo" destination="pCT-Wh-lut" id="C0V-PC-Sai"/>
|
||||
<outlet property="descriptionLabel" destination="f3d-th-bgU" id="Aym-KJ-DqY"/>
|
||||
<outlet property="mapView" destination="4ID-Zb-OQF" id="x8o-nT-bL4"/>
|
||||
<outlet property="titleLabel" destination="pCT-Wh-lut" id="uIg-dn-Wms"/>
|
||||
<outlet property="waveLabel" destination="bT3-3m-qLh" id="AkJ-nd-d2R"/>
|
||||
</connections>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="vXp-U4-Rya" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>XPC!</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>2.0</string>
|
||||
<string>$(MARKETING_VERSION)</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>$(CURRENT_PROJECT_VERSION)</string>
|
||||
<key>NSAppTransportSecurity</key>
|
||||
|
||||
@@ -2,17 +2,12 @@
|
||||
// NotificationViewController.h
|
||||
// EQNNotificationContent
|
||||
//
|
||||
// Created by Luca Beretta on 03/01/2019.
|
||||
// Copyright © 2019 Luca Beretta. All rights reserved.
|
||||
// Refactored by Andrea Busi on 14/10/2020.
|
||||
// Copyright © 2020 Earthquake Network. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import <MapKit/MapKit.h>
|
||||
|
||||
@interface NotificationViewController : UIViewController
|
||||
@property (weak, nonatomic) IBOutlet UILabel *titolo;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *descrizione;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *onda;
|
||||
@property (weak, nonatomic) IBOutlet MKMapView *mappa;
|
||||
|
||||
@end
|
||||
|
||||
@@ -2,82 +2,164 @@
|
||||
// NotificationViewController.m
|
||||
// EQNNotificationContent
|
||||
//
|
||||
// Created by Luca Beretta on 03/01/2019.
|
||||
// Copyright © 2019 Luca Beretta. All rights reserved.
|
||||
// Refactored by Andrea Busi on 14/10/2020.
|
||||
// Copyright © 2020 Earthquake Network. All rights reserved.
|
||||
//
|
||||
|
||||
#import "NotificationViewController.h"
|
||||
#import <UserNotifications/UserNotifications.h>
|
||||
#import <UserNotificationsUI/UserNotificationsUI.h>
|
||||
#import <MapKit/MapKit.h>
|
||||
#import "PastquakesAnnotation.h"
|
||||
#import "ReteSismicaAnnotation.h"
|
||||
#import "EQNUtility.h"
|
||||
|
||||
@import UserNotifications;
|
||||
@import UserNotificationsUI;
|
||||
@import MapKit;
|
||||
|
||||
@interface NotificationViewController () <UNNotificationContentExtension, MKMapViewDelegate>
|
||||
@property (nonatomic, strong) NSDictionary *info;
|
||||
@property (nonatomic, strong) NSURLSession *session;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *descriptionLabel;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *waveLabel;
|
||||
@property (weak, nonatomic) IBOutlet MKMapView *mapView;
|
||||
|
||||
/// This will be calculated as seismic date + warning time
|
||||
@property (strong, nonatomic) NSDate *userSeismicTimestamp;
|
||||
@property (strong, nonatomic) NSTimer *countdownTimer;
|
||||
@end
|
||||
|
||||
@implementation NotificationViewController
|
||||
|
||||
- (void)viewDidLoad {
|
||||
- (void)setMapView:(MKMapView *)mapView
|
||||
{
|
||||
_mapView = mapView;
|
||||
_mapView.scrollEnabled = NO;
|
||||
_mapView.zoomEnabled = NO;
|
||||
}
|
||||
|
||||
#pragma mark - View Lifecycle
|
||||
|
||||
- (void)viewDidLoad
|
||||
{
|
||||
[super viewDidLoad];
|
||||
// Do any required interface initialization here.
|
||||
|
||||
}
|
||||
|
||||
-(void)didReceiveNotification:(UNNotification *)notification {
|
||||
- (void)didReceiveNotification:(UNNotification *)notification
|
||||
{
|
||||
UNNotificationContent *content = notification.request.content;
|
||||
NSDictionary *userInfo = content.userInfo;
|
||||
|
||||
self.titolo.text = notification.request.content.title;
|
||||
self.descrizione.text = notification.request.content.body;
|
||||
NSDictionary *dict = notification.request.content.userInfo;
|
||||
CLLocation *coordinate = [[CLLocation alloc] initWithLatitude:[dict[@"latitude"] doubleValue] longitude:[dict[@"longitude"] doubleValue]];
|
||||
// set title and description
|
||||
self.titleLabel.text = content.title;
|
||||
self.descriptionLabel.text = content.body;
|
||||
|
||||
// add annotation onthe map
|
||||
CLLocation *coordinate = [[CLLocation alloc] initWithLatitude:[userInfo[@"latitude"] doubleValue]
|
||||
longitude:[userInfo[@"longitude"] doubleValue]];
|
||||
MKCoordinateSpan span = MKCoordinateSpanMake(10.5, 10.5);
|
||||
MKCoordinateRegion region = MKCoordinateRegionMake(coordinate.coordinate, span);
|
||||
self.mappa.delegate = self;
|
||||
[self.mappa setCenterCoordinate:coordinate.coordinate animated:NO];
|
||||
[self.mappa setRegion:region animated:YES];
|
||||
self.mappa.scrollEnabled = NO;
|
||||
[self.mapView setCenterCoordinate:coordinate.coordinate animated:NO];
|
||||
[self.mapView setRegion:region animated:YES];
|
||||
|
||||
if ([dict[@"type"] isEqualToString:@"eqn"]) {
|
||||
|
||||
PastquakesAnnotation *annotation = [[PastquakesAnnotation alloc] initWithTitle:notification.request.content.body location:coordinate.coordinate intensita:[dict[@"intensity"] intValue]];
|
||||
[self.mappa addAnnotation:annotation];
|
||||
|
||||
}
|
||||
else if ([dict[@"type"] isEqualToString:@"manual"]){
|
||||
|
||||
ReteSismicaAnnotation *annotation = [[ReteSismicaAnnotation alloc] initWithTitle:notification.request.content.body location:coordinate.coordinate magnitudo:[dict[@"magnitudo"] intValue]];
|
||||
[self.mappa addAnnotation:annotation];
|
||||
|
||||
if ([userInfo[@"type"] isEqualToString:@"eqn"]) {
|
||||
PastquakesAnnotation *annotation = [[PastquakesAnnotation alloc] initWithTitle:content.body
|
||||
location:coordinate.coordinate
|
||||
intensita:[userInfo[@"intensity"] intValue]];
|
||||
[self.mapView addAnnotation:annotation];
|
||||
|
||||
} else if ([userInfo[@"type"] isEqualToString:@"manual"]){
|
||||
ReteSismicaAnnotation *annotation = [[ReteSismicaAnnotation alloc] initWithTitle:content.body
|
||||
location:coordinate.coordinate
|
||||
magnitudo:[userInfo[@"magnitudo"] intValue]];
|
||||
[self.mapView addAnnotation:annotation];
|
||||
}
|
||||
|
||||
self.onda.text = [NSString stringWithFormat:@"%@ %@ %@", NSLocalizedString(@"Onda sismica in", @""), dict[@"wave_speed"], NSLocalizedString(@"secondi", @"")];
|
||||
|
||||
self.userSeismicTimestamp = [self calculateUserSeismicTimestampWithInfo:userInfo];
|
||||
if (self.userSeismicTimestamp) {
|
||||
// start the countdown
|
||||
self.countdownTimer = [NSTimer scheduledTimerWithTimeInterval:1.0
|
||||
target:self
|
||||
selector:@selector(countdownFired:)
|
||||
userInfo:nil
|
||||
repeats:YES];
|
||||
[self.countdownTimer fire];
|
||||
}
|
||||
}
|
||||
-(MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id<MKAnnotation>)annotation{
|
||||
|
||||
#pragma mark - Private
|
||||
|
||||
- (nullable NSDate *)calculateUserSeismicTimestampWithInfo:(NSDictionary *)info
|
||||
{
|
||||
// dobbiamo calcolare l'ora in cui il sisma arriverà nella posizione dell'utente
|
||||
// per fare questo, il calcolo sarà:
|
||||
// timestamp sisma + warning time
|
||||
|
||||
// ultima posizione nota dell'utente
|
||||
CLLocationManager *manager = [[CLLocationManager alloc] init];
|
||||
CLLocation *lastUserLocation = manager.location;
|
||||
if (!lastUserLocation) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
// posizione sisma
|
||||
double latitude = [info[@"latitude"] doubleValue];
|
||||
double longitude = [info[@"longitude"] doubleValue];
|
||||
CLLocation *location = [[CLLocation alloc] initWithLatitude:latitude longitude:longitude];
|
||||
|
||||
// distanza tra sisma e utente (in km)
|
||||
CLLocationDistance distance = [lastUserLocation distanceFromLocation:location];
|
||||
double userDistance = distance/1000;
|
||||
|
||||
// calcoliamo warning_time
|
||||
double waveSpeed = [info[@"wave_speed"] doubleValue];
|
||||
double warningTime = round(userDistance/waveSpeed - 5);
|
||||
|
||||
// aggiungiamo il warning time al timestamp del sisma
|
||||
NSDate *seismicDate = [EQNUtility getDateFromString:info[@"datetime"]];
|
||||
NSDate *userSeismicDate = [seismicDate dateByAddingTimeInterval:warningTime];
|
||||
|
||||
return userSeismicDate;
|
||||
}
|
||||
|
||||
- (void)countdownFired:(id)sender
|
||||
{
|
||||
NSDate *now = [NSDate date];
|
||||
NSTimeInterval difference = MAX([self.userSeismicTimestamp timeIntervalSinceDate:now], 0);
|
||||
|
||||
self.waveLabel.text = [NSString stringWithFormat:@"%@ %.0f %@", NSLocalizedString(@"alert_wave", @""), difference, NSLocalizedString(@"alert_seconds", @"")];
|
||||
|
||||
if (difference <= 0) {
|
||||
// stop the countdown
|
||||
[self.countdownTimer invalidate];
|
||||
self.countdownTimer = nil;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - MKMapViewDelegate
|
||||
|
||||
- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id<MKAnnotation>)annotation
|
||||
{
|
||||
if ([annotation isKindOfClass:[PastquakesAnnotation class]]) {
|
||||
PastquakesAnnotation *anLocation = (PastquakesAnnotation *)annotation;
|
||||
MKAnnotationView *annotationView = [mapView dequeueReusableAnnotationViewWithIdentifier:IDENTIFIER_ANNOTATION_PASTQUAKES];
|
||||
if (annotationView == nil)
|
||||
if (annotationView == nil) {
|
||||
annotationView = anLocation.annotationView;
|
||||
else
|
||||
} else {
|
||||
annotationView.annotation = anLocation;
|
||||
|
||||
}
|
||||
return annotationView;
|
||||
}
|
||||
else if ([annotation isKindOfClass:[ReteSismicaAnnotation class]]) {
|
||||
|
||||
} else if ([annotation isKindOfClass:[ReteSismicaAnnotation class]]) {
|
||||
ReteSismicaAnnotation *anLocation = (ReteSismicaAnnotation *)annotation;
|
||||
MKAnnotationView *annotationView = [mapView dequeueReusableAnnotationViewWithIdentifier:IDENTIFIER_ANNOTATION_RETESMARTPHONE];
|
||||
if (annotationView == nil)
|
||||
if (annotationView == nil) {
|
||||
annotationView = anLocation.annotationView;
|
||||
else
|
||||
} else {
|
||||
annotationView.annotation = anLocation;
|
||||
|
||||
}
|
||||
return annotationView;
|
||||
}
|
||||
return nil;
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 752 B |
|
After Width: | Height: | Size: 775 B |
|
After Width: | Height: | Size: 749 B |
|
After Width: | Height: | Size: 811 B |
|
After Width: | Height: | Size: 846 B |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 1.7 KiB |