Skip to content

Commit 2969f2e

Browse files
committed
Link plugin extender and clean up pbxproj
1 parent 9e54a01 commit 2969f2e

File tree

2 files changed

+37
-14
lines changed

2 files changed

+37
-14
lines changed

example/ios/AirshipExample.xcodeproj/project.pbxproj

+12-14
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
6308C1832D80AA8500296239 /* ExampleWidgetsLiveActivity.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6308C17B2D80AA8500296239 /* ExampleWidgetsLiveActivity.swift */; };
2020
6308C1842D80AA8500296239 /* ExampleWidgetsAttributes.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6308C1792D80AA8500296239 /* ExampleWidgetsAttributes.swift */; };
2121
6308C18A2D80AA9200296239 /* NotificationService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6308C1872D80AA9200296239 /* NotificationService.swift */; };
22+
6308C18E2D80B00300296239 /* AirshipPluginExtender.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6308C18D2D80B00300296239 /* AirshipPluginExtender.swift */; };
2223
761780ED2CA45674006654EE /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 761780EC2CA45674006654EE /* AppDelegate.swift */; };
2324
81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; };
2425
A4685ED317A73D5118DD4DCF /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */; };
@@ -76,6 +77,7 @@
7677
6308C1852D80AA9200296239 /* AirshipExampleNotificationServiceExtension.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = AirshipExampleNotificationServiceExtension.entitlements; sourceTree = "<group>"; };
7778
6308C1862D80AA9200296239 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
7879
6308C1872D80AA9200296239 /* NotificationService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationService.swift; sourceTree = "<group>"; };
80+
6308C18D2D80B00300296239 /* AirshipPluginExtender.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AirshipPluginExtender.swift; sourceTree = "<group>"; };
7981
761780EC2CA45674006654EE /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = AppDelegate.swift; path = AirshipExample/AppDelegate.swift; sourceTree = "<group>"; };
8082
81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = AirshipExample/LaunchScreen.storyboard; sourceTree = "<group>"; };
8183
ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
@@ -165,6 +167,7 @@
165167
isa = PBXGroup;
166168
children = (
167169
13B07FAE1A68108700A75B9A /* AirshipExample */,
170+
6308C18D2D80B00300296239 /* AirshipPluginExtender.swift */,
168171
832341AE1AAA6A7D00B99B32 /* Libraries */,
169172
6308C1882D80AA9200296239 /* AirshipExampleNotificationServiceExtension */,
170173
6308C17D2D80AA8500296239 /* ExampleWidgets */,
@@ -407,6 +410,7 @@
407410
files = (
408411
761780ED2CA45674006654EE /* AppDelegate.swift in Sources */,
409412
6308C1842D80AA8500296239 /* ExampleWidgetsAttributes.swift in Sources */,
413+
6308C18E2D80B00300296239 /* AirshipPluginExtender.swift in Sources */,
410414
);
411415
runOnlyForDeploymentPostprocessing = 0;
412416
};
@@ -600,9 +604,9 @@
600604
GCC_C_LANGUAGE_STANDARD = gnu17;
601605
GENERATE_INFOPLIST_FILE = YES;
602606
INFOPLIST_FILE = ExampleWidgets/Info.plist;
603-
INFOPLIST_KEY_CFBundleDisplayName = ExampleWidgetExtension;
607+
INFOPLIST_KEY_CFBundleDisplayName = ExampleWidgets;
604608
INFOPLIST_KEY_NSHumanReadableCopyright = "";
605-
IPHONEOS_DEPLOYMENT_TARGET = 18.2;
609+
IPHONEOS_DEPLOYMENT_TARGET = 16.6;
606610
LD_RUNPATH_SEARCH_PATHS = (
607611
"$(inherited)",
608612
"@executable_path/Frameworks",
@@ -612,7 +616,7 @@
612616
MARKETING_VERSION = 1.0;
613617
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
614618
MTL_FAST_MATH = YES;
615-
PRODUCT_BUNDLE_IDENTIFIER = com.urbanairship.richpush.LiveActivity;
619+
PRODUCT_BUNDLE_IDENTIFIER = com.urbanairship.richpush.ExampleWidgets;
616620
PRODUCT_NAME = "$(TARGET_NAME)";
617621
SKIP_INSTALL = YES;
618622
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)";
@@ -644,9 +648,9 @@
644648
GCC_C_LANGUAGE_STANDARD = gnu17;
645649
GENERATE_INFOPLIST_FILE = YES;
646650
INFOPLIST_FILE = ExampleWidgets/Info.plist;
647-
INFOPLIST_KEY_CFBundleDisplayName = ExampleWidgetExtension;
651+
INFOPLIST_KEY_CFBundleDisplayName = ExampleWidgets;
648652
INFOPLIST_KEY_NSHumanReadableCopyright = "";
649-
IPHONEOS_DEPLOYMENT_TARGET = 18.2;
653+
IPHONEOS_DEPLOYMENT_TARGET = 16.6;
650654
LD_RUNPATH_SEARCH_PATHS = (
651655
"$(inherited)",
652656
"@executable_path/Frameworks",
@@ -655,7 +659,7 @@
655659
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
656660
MARKETING_VERSION = 1.0;
657661
MTL_FAST_MATH = YES;
658-
PRODUCT_BUNDLE_IDENTIFIER = com.urbanairship.richpush.LiveActivity;
662+
PRODUCT_BUNDLE_IDENTIFIER = com.urbanairship.richpush.ExampleWidgets;
659663
PRODUCT_NAME = "$(TARGET_NAME)";
660664
SKIP_INSTALL = YES;
661665
SWIFT_COMPILATION_MODE = wholemodule;
@@ -734,10 +738,7 @@
734738
"-DFOLLY_CFG_NO_COROUTINES=1",
735739
"-DFOLLY_HAVE_CLOCK_GETTIME=1",
736740
);
737-
OTHER_LDFLAGS = (
738-
"$(inherited)",
739-
" ",
740-
);
741+
OTHER_LDFLAGS = "$(inherited) ";
741742
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
742743
SDKROOT = iphoneos;
743744
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) DEBUG";
@@ -806,10 +807,7 @@
806807
"-DFOLLY_CFG_NO_COROUTINES=1",
807808
"-DFOLLY_HAVE_CLOCK_GETTIME=1",
808809
);
809-
OTHER_LDFLAGS = (
810-
"$(inherited)",
811-
" ",
812-
);
810+
OTHER_LDFLAGS = "$(inherited) ";
813811
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
814812
SDKROOT = iphoneos;
815813
USE_HERMES = true;
+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import Foundation
2+
import AirshipKit
3+
import AirshipFrameworkProxy
4+
import ActivityKit
5+
6+
@objc(AirshipPluginExtender)
7+
public class AirshipPluginExtender: NSObject, AirshipPluginExtenderProtocol {
8+
9+
/// Called on the same run loop when Airship takesOff.
10+
@MainActor
11+
public static func onAirshipReady() {
12+
13+
if #available(iOS 16.1, *) {
14+
// Throws if setup is called more than once
15+
try? LiveActivityManager.shared.setup { configurator in
16+
17+
// Register each activity type
18+
await configurator.register(forType: Activity<ExampleWidgetsAttributes>.self) { attributes in
19+
// Track this property as the Airship name for updates
20+
attributes.name
21+
}
22+
}
23+
}
24+
}
25+
}

0 commit comments

Comments
 (0)