Skip to content

Commit 60d5930

Browse files
committed
Ignore live activities code for mac catalyst
1 parent 47faaad commit 60d5930

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

ios/RCTOneSignal/RCTOneSignalEventEmitter.m

+8-4
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,8 @@ + (void)sendEventWithName:(NSString *)name withBody:(NSDictionary *)body {
133133

134134
RCT_EXPORT_METHOD(setPushToStartToken:(NSString *)activityType
135135
withToken:(NSString *)token) {
136+
#if !TARGET_OS_MACCATALYST
136137
NSError* err=nil;
137-
138138
if (@available(iOS 17.2, *)) {
139139
[OneSignalLiveActivitiesManagerImpl setPushToStartToken:activityType withToken:token error:&err];
140140
if (err) {
@@ -143,11 +143,12 @@ + (void)sendEventWithName:(NSString *)name withBody:(NSDictionary *)body {
143143
} else {
144144
[OneSignalLog onesignalLog:ONE_S_LL_ERROR message:[NSString stringWithFormat:@"cannot setPushToStartToken on iOS < 17.2"]];
145145
}
146+
#endif
146147
}
147148

148149
RCT_EXPORT_METHOD(removePushToStartToken:(NSString *)activityType) {
150+
#if !TARGET_OS_MACCATALYST
149151
NSError* err=nil;
150-
151152
if (@available(iOS 17.2, *)) {
152153
[OneSignalLiveActivitiesManagerImpl removePushToStartToken:activityType error:&err];
153154
if (err) {
@@ -156,11 +157,12 @@ + (void)sendEventWithName:(NSString *)name withBody:(NSDictionary *)body {
156157
} else {
157158
[OneSignalLog onesignalLog:ONE_S_LL_ERROR message:[NSString stringWithFormat:@"cannot removePushToStartToken on iOS < 17.2"]];
158159
}
160+
#endif
159161
}
160162

161163
RCT_EXPORT_METHOD(setupDefaultLiveActivity:(NSDictionary * _Nullable)options) {
164+
#if !TARGET_OS_MACCATALYST
162165
LiveActivitySetupOptions *laOptions = nil;
163-
164166
if (options != nil) {
165167
laOptions = [LiveActivitySetupOptions alloc];
166168
[laOptions setEnablePushToStart:[options[@"enablePushToStart"] boolValue]];
@@ -172,17 +174,19 @@ + (void)sendEventWithName:(NSString *)name withBody:(NSDictionary *)body {
172174
} else {
173175
[OneSignalLog onesignalLog:ONE_S_LL_ERROR message:[NSString stringWithFormat:@"cannot setupDefault on iOS < 16.1"]];
174176
}
177+
#endif
175178
}
176179

177180
RCT_EXPORT_METHOD(startDefaultLiveActivity:(NSString *)activityId
178181
withAttributes:(NSDictionary * _Nonnull)attributes
179182
withContent:(NSDictionary * _Nonnull)content) {
180-
183+
#if !TARGET_OS_MACCATALYST
181184
if (@available(iOS 16.1, *)) {
182185
[OneSignalLiveActivitiesManagerImpl startDefault:activityId attributes:attributes content:content];
183186
} else {
184187
[OneSignalLog onesignalLog:ONE_S_LL_ERROR message:[NSString stringWithFormat:@"cannot startDefault on iOS < 16.1"]];
185188
}
189+
#endif
186190
}
187191

188192
RCT_EXPORT_METHOD(setPrivacyConsentGiven:(BOOL)granted) {

0 commit comments

Comments
 (0)