Skip to content

Commit 83f790c

Browse files
committed
Empty out Live Activities files for mac catalyst
* Effectively empty any file referencing ActivityKit in order to support Mac Catalyst builds * See #1446 for details
1 parent 1fe8993 commit 83f790c

File tree

4 files changed

+17
-0
lines changed

4 files changed

+17
-0
lines changed

iOS_SDK/OneSignalSDK/OneSignalLiveActivities/Source/DefaultLiveActivityAttributes.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@
2525
THE SOFTWARE.
2626
*/
2727

28+
// Effectively blanks out this file for Mac Catalyst
29+
#if targetEnvironment(macCatalyst)
30+
#else
31+
2832
/**
2933
A default struct conforming to OneSignalLiveActivityAttributes which is registered with OneSignal as a Live Activity
3034
through `OneSignal.LiveActivities.setupDefault`. The only action required by the customer app is
@@ -74,3 +78,4 @@ public struct DefaultLiveActivityAttributes: OneSignalLiveActivityAttributes {
7478
public var data: [String: AnyCodable]
7579
public var onesignal: OneSignalLiveActivityAttributeData
7680
}
81+
#endif

iOS_SDK/OneSignalSDK/OneSignalLiveActivities/Source/OSLiveActivitiesExtension.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@
2525
THE SOFTWARE.
2626
*/
2727

28+
// Effectively blanks out this file for Mac Catalyst
29+
#if targetEnvironment(macCatalyst)
30+
#else
2831
import OneSignalOSCore
2932
import ActivityKit
3033

@@ -116,3 +119,4 @@ public class LiveActivitySetupOptions: NSObject {
116119
self.enablePushToUpdate = enablePushToUpdate
117120
}
118121
}
122+
#endif

iOS_SDK/OneSignalSDK/OneSignalLiveActivities/Source/OneSignalLiveActivitiesManagerImpl.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@
2525
THE SOFTWARE.
2626
*/
2727

28+
// Effectively blanks out this file for Mac Catalyst
29+
#if targetEnvironment(macCatalyst)
30+
#else
2831
import OneSignalCore
2932
import OneSignalOSCore
3033
import ActivityKit
@@ -238,3 +241,4 @@ public class OneSignalLiveActivitiesManagerImpl: NSObject, OSLiveActivities {
238241
}
239242
}
240243
}
244+
#endif

iOS_SDK/OneSignalSDK/OneSignalLiveActivities/Source/OneSignalLiveActivityAttributes.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@
2525
THE SOFTWARE.
2626
*/
2727

28+
// Effectively blanks out this file for Mac Catalyst
29+
#if targetEnvironment(macCatalyst)
30+
#else
2831
import ActivityKit
2932

3033
/**
@@ -83,3 +86,4 @@ public protocol OneSignalLiveActivityContentState: Decodable, Encodable, Hashabl
8386
public struct OneSignalLiveActivityContentStateData: Decodable, Encodable, Hashable {
8487
public var notificationId: String
8588
}
89+
#endif

0 commit comments

Comments
 (0)