@@ -28,8 +28,7 @@ final class AppCoordinator: CoordinatorType {
2828
2929 init ? ( appWindow: UIWindow ? , dependencyContainer: DependencyContainer ) {
3030 self . dependencyContainer = dependencyContainer
31- RealmLocalStorage . setupEncryption ( )
32-
31+
3332 guard let window = appWindow else {
3433 Fatal . execute ( " Window doesn't exists " )
3534 }
@@ -49,16 +48,15 @@ final class AppCoordinator: CoordinatorType {
4948 window. makeKeyAndVisible ( )
5049
5150 updateReminder ( )
51+ configureJSBridge ( with: rootViewController)
5252
53- if #available( iOS 13 . 5 , * ) {
54- configureJSBridge ( with: rootViewController)
55- }
5653
5754 if #available( iOS 13 . 5 , * ) {
5855 // Don't register bg task on iPad devices that are not supported by EN
5956 guard UIDevice . current. model == " iPhone " else { return }
6057 dependencyContainer. backgroundTaskService. scheduleExposureTask ( )
6158 }
59+
6260 }
6361
6462 private func updateReminder( ) {
@@ -109,14 +107,16 @@ final class AppCoordinator: CoordinatorType {
109107 self . noInternetAlert = noInternetAlert
110108 }
111109
112- @available ( iOS 13 . 5 , * )
113110 private func configureJSBridge( with viewController: UIViewController ) {
114- let factory : ExposureNotificationJSBridgeFactory = dependencyContainer
111+ if #available( iOS 13 . 5 , * ) {
112+ let factory : ExposureNotificationJSBridgeFactory = dependencyContainer
113+ dependencyContainer. jsBridge. registerExposureNotification (
114+ with: factory. makeExposureNotificationJSBridge ( with: viewController) ,
115+ diagnosisKeysUploadService: dependencyContainer. diagnosisKeysUploadService
116+ )
117+ }
115118
116- dependencyContainer. jsBridge. registerExposureNotification (
117- with: factory. makeExposureNotificationJSBridge ( with: viewController) ,
118- diagnosisKeysUploadService: dependencyContainer. diagnosisKeysUploadService
119- )
119+ dependencyContainer. jsBridge. register ( districtService: dependencyContainer. districtsService)
120120 }
121121
122122 @objc
0 commit comments