Skip to content

Commit

Permalink
Ignore live activities code for mac catalyst
Browse files Browse the repository at this point in the history
* These codes reference `OneSignalLiveActivitiesManagerImpl` directly which is in a module not available to Mac Catalyst due to ActivityKit dependency
* Therefore, it caused build failures for Mac Catalyst.
* Live Activities does not work for Mac anyway, so just ignore these methods.
  • Loading branch information
nan-li committed Jun 25, 2024
1 parent e7d2ae2 commit f1f15d9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/ios/OneSignalPush.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

Expand All @@ -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;

Expand All @@ -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];
Expand All @@ -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

0 comments on commit f1f15d9

Please sign in to comment.