diff --git a/example/IonicCapOneSignal/ios/App/ExampleWidget/ExampleWidgetBundle.swift b/example/IonicCapOneSignal/ios/App/ExampleWidget/ExampleWidgetBundle.swift index 71407d0a..a0495876 100644 --- a/example/IonicCapOneSignal/ios/App/ExampleWidget/ExampleWidgetBundle.swift +++ b/example/IonicCapOneSignal/ios/App/ExampleWidget/ExampleWidgetBundle.swift @@ -8,10 +8,11 @@ import WidgetKit import SwiftUI - +#if !targetEnvironment(macCatalyst) @main struct ExampleWidgetBundle: WidgetBundle { var body: some Widget { ExampleWidgetLiveActivity() } } +#endif diff --git a/example/IonicCapOneSignal/ios/App/ExampleWidget/ExampleWidgetLiveActivity.swift b/example/IonicCapOneSignal/ios/App/ExampleWidget/ExampleWidgetLiveActivity.swift index 866ec180..e359a4c7 100644 --- a/example/IonicCapOneSignal/ios/App/ExampleWidget/ExampleWidgetLiveActivity.swift +++ b/example/IonicCapOneSignal/ios/App/ExampleWidget/ExampleWidgetLiveActivity.swift @@ -6,6 +6,7 @@ // Copyright © 2024 The Chromium Authors. All rights reserved. // +#if !targetEnvironment(macCatalyst) import ActivityKit import WidgetKit import SwiftUI @@ -64,3 +65,4 @@ struct ExampleWidgetLiveActivity: Widget { } } } +#endif diff --git a/src/ios/OneSignalPush.m b/src/ios/OneSignalPush.m index 681b0eda..0b618eaf 100644 --- a/src/ios/OneSignalPush.m +++ b/src/ios/OneSignalPush.m @@ -636,6 +636,7 @@ - (void)exitLiveActivity:(CDVInvokedUrlCommand *)command { } - (void)setPushToStartToken:(CDVInvokedUrlCommand *)command { + #if !TARGET_OS_MACCATALYST NSString *activityType = command.arguments[0]; NSString *token = command.arguments[1]; NSError* err=nil; @@ -648,9 +649,11 @@ - (void)setPushToStartToken:(CDVInvokedUrlCommand *)command { } else { [OneSignalLog onesignalLog:ONE_S_LL_ERROR message:[NSString stringWithFormat:@"cannot setPushToStartToken on iOS < 17.2"]]; } + #endif } - (void)removePushToStartToken:(CDVInvokedUrlCommand *)command { + #if !TARGET_OS_MACCATALYST NSString *activityType = command.arguments[0]; NSError* err=nil; @@ -662,9 +665,11 @@ - (void)removePushToStartToken:(CDVInvokedUrlCommand *)command { } else { [OneSignalLog onesignalLog:ONE_S_LL_ERROR message:[NSString stringWithFormat:@"cannot removePushToStartToken on iOS < 17.2"]]; } + #endif } - (void)setupDefaultLiveActivity:(CDVInvokedUrlCommand *)command { + #if !TARGET_OS_MACCATALYST NSDictionary *options = command.arguments[0]; LiveActivitySetupOptions *laOptions = nil; @@ -679,9 +684,11 @@ - (void)setupDefaultLiveActivity:(CDVInvokedUrlCommand *)command { } else { [OneSignalLog onesignalLog:ONE_S_LL_ERROR message:[NSString stringWithFormat:@"cannot setupDefault on iOS < 16.1"]]; } + #endif } - (void)startDefaultLiveActivity:(CDVInvokedUrlCommand *)command { + #if !TARGET_OS_MACCATALYST NSString *activityId = command.arguments[0]; NSDictionary *attributes = command.arguments[1]; NSDictionary *content = command.arguments[2]; @@ -691,5 +698,6 @@ - (void)startDefaultLiveActivity:(CDVInvokedUrlCommand *)command { } else { [OneSignalLog onesignalLog:ONE_S_LL_ERROR message:[NSString stringWithFormat:@"cannot startDefault on iOS < 16.1"]]; } + #endif } @end