Skip to content

Commit f6b3826

Browse files
committed
Fix settings storage on simulators
1 parent b1bdab3 commit f6b3826

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

Loop/Managers/LoopAppManager.swift

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ import MockKit
1515
import HealthKit
1616
import WidgetKit
1717

18+
#if targetEnvironment(simulator)
19+
enum SimulatorError: Error {
20+
case remoteNotificationsNotAvailable
21+
}
22+
#endif
23+
1824
public protocol AlertPresenter: AnyObject {
1925
/// Present the alert view controller, with or without animation.
2026
/// - Parameters:
@@ -102,10 +108,13 @@ class LoopAppManager: NSObject {
102108

103109
if FeatureFlags.remoteOverridesEnabled {
104110
DispatchQueue.main.async {
111+
#if targetEnvironment(simulator)
112+
self.remoteNotificationRegistrationDidFinish(.failure(SimulatorError.remoteNotificationsNotAvailable))
113+
#else
105114
UIApplication.shared.registerForRemoteNotifications()
115+
#endif
106116
}
107117
}
108-
109118
self.state = state.next
110119
}
111120

0 commit comments

Comments
 (0)