Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Ignore Live Activities code for Mac Catalyst #1005

Merged
merged 2 commits into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@

import WidgetKit
import SwiftUI

#if !targetEnvironment(macCatalyst)
@main
struct ExampleWidgetBundle: WidgetBundle {
var body: some Widget {
ExampleWidgetLiveActivity()
}
}
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
// Copyright © 2024 The Chromium Authors. All rights reserved.
//

#if !targetEnvironment(macCatalyst)
import ActivityKit
import WidgetKit
import SwiftUI
Expand Down Expand Up @@ -64,3 +65,4 @@ struct ExampleWidgetLiveActivity: Widget {
}
}
}
#endif
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
Loading