From e3000dc8830a0b25fab9214bf46b7ab9996cc96f Mon Sep 17 00:00:00 2001 From: Bill Gestrich <3207996+gestrich@users.noreply.github.com> Date: Sun, 17 Dec 2023 10:23:17 -0500 Subject: [PATCH] Support LoopKit Package in Watch targets --- LoopKit/NotificationSettings.swift | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/LoopKit/NotificationSettings.swift b/LoopKit/NotificationSettings.swift index bcad3c2b2..aebe3edab 100644 --- a/LoopKit/NotificationSettings.swift +++ b/LoopKit/NotificationSettings.swift @@ -9,6 +9,7 @@ import Foundation import UserNotifications + public struct NotificationSettings: Equatable { public enum AuthorizationStatus: String, Codable { case notDetermined @@ -61,7 +62,8 @@ public struct NotificationSettings: Equatable { case banner case alert case unknown - + +#if os(iOS) public init(_ alertStyle: UNAlertStyle) { switch alertStyle { case .none: @@ -74,6 +76,7 @@ public struct NotificationSettings: Equatable { self = .unknown } } +#endif } public enum ShowPreviewsSetting: String, Codable { @@ -81,7 +84,8 @@ public struct NotificationSettings: Equatable { case whenAuthenticated case never case unknown - + +#if os(iOS) public init(_ showPreviewsSetting: UNShowPreviewsSetting) { switch showPreviewsSetting { case .always: @@ -94,6 +98,7 @@ public struct NotificationSettings: Equatable { self = .unknown } } +#endif } public enum TemporaryMuteAlertSetting: Codable, Equatable {