diff --git a/Sources/EQNNotificationService/NotificationService.swift b/Sources/EQNNotificationService/NotificationService.swift index 778d184..be38ba0 100644 --- a/Sources/EQNNotificationService/NotificationService.swift +++ b/Sources/EQNNotificationService/NotificationService.swift @@ -11,9 +11,6 @@ import Shogun class NotificationService: UNNotificationServiceExtension { - // riportiamo queste costanti dall'app bundle, per non dover referenziare file in ObjC - private static let EQNUserDefaultAppGroupSuite = "group.com.finazzi.distquake" - private static let NOTIFICHE_ALLERA_SISMICA_CRITICAL_ALERTS = "NOTIFICHE_ALLERA_SISMICA_CRITICAL_ALERTS" private static let EQNSoundNotification = UNNotificationSoundName("alert_sound.wav") @@ -41,8 +38,7 @@ class NotificationService: UNNotificationServiceExtension { switch notificationType.lowercased() { case "eqn": // check if user has enabled critical alerts - let sharedDefaults = UserDefaults(suiteName: Self.EQNUserDefaultAppGroupSuite) - let criticalAlertsEnabled = sharedDefaults?.bool(forKey: Self.NOTIFICHE_ALLERA_SISMICA_CRITICAL_ALERTS) ?? false + let criticalAlertsEnabled = UserDefaults.appGroup?.bool(forKey: UserDefaults.AllertaSismicaCriticalAlerts) ?? false // !!WORKAROUND // this is a workaround to use critical alerts with legacy FCM api diff --git a/Sources/Earthquake Network.xcodeproj/project.pbxproj b/Sources/Earthquake Network.xcodeproj/project.pbxproj index b38686a..f3004b2 100644 --- a/Sources/Earthquake Network.xcodeproj/project.pbxproj +++ b/Sources/Earthquake Network.xcodeproj/project.pbxproj @@ -8,6 +8,7 @@ /* Begin PBXBuildFile section */ 6502470D2A612E4A001AC512 /* Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6502470C2A612E4A001AC512 /* Constants.swift */; }; + 6502470E2A6136F0001AC512 /* Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6502470C2A612E4A001AC512 /* Constants.swift */; }; 650B23AB2632CCD3007AE752 /* UIView+EQNExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 650B23AA2632CCD3007AE752 /* UIView+EQNExtensions.swift */; }; 651901B925F5358700CAFF20 /* EQNMapAnnotationSeismic.swift in Sources */ = {isa = PBXBuildFile; fileRef = 651901B825F5358700CAFF20 /* EQNMapAnnotationSeismic.swift */; }; 6525A82625E13FD4008FE0D0 /* SeismicNetworkAdvertiseTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6525A82525E13FD4008FE0D0 /* SeismicNetworkAdvertiseTableViewCell.swift */; }; @@ -1567,6 +1568,7 @@ buildActionMask = 2147483647; files = ( 65FFDC95292F672B00EA821B /* NotificationService.swift in Sources */, + 6502470E2A6136F0001AC512 /* Constants.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; };