From 4ef314795fa03c2352cf5b758bdd23760e3d104f Mon Sep 17 00:00:00 2001 From: Fadi George Date: Thu, 13 Aug 2026 21:26:24 -0700 Subject: [PATCH 1/4] chore(demo): rename framework and add Catalyst support --- examples/demo/App.xcodeproj/project.pbxproj | 89 ++++++++++++++------- 1 file changed, 61 insertions(+), 28 deletions(-) diff --git a/examples/demo/App.xcodeproj/project.pbxproj b/examples/demo/App.xcodeproj/project.pbxproj index ab0de05ff..12d27e0d1 100644 --- a/examples/demo/App.xcodeproj/project.pbxproj +++ b/examples/demo/App.xcodeproj/project.pbxproj @@ -53,7 +53,7 @@ 8068AFC608E7E82F06733BE7 /* OneSignalCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2C1B9BE42E81492B9DB61343 /* OneSignalCore.framework */; }; 80E3E2B5438CFEBE1316FA84 /* OneSignalCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2C1B9BE42E81492B9DB61343 /* OneSignalCore.framework */; }; 837FCE7A095ED1D7CCFEACF3 /* InAppSection.swift in Sources */ = {isa = PBXBuildFile; fileRef = B76FFAF18177241F4A47FE23 /* InAppSection.swift */; }; - 8E57965CF0E9F1C341E61996 /* OneSignal-Dynamic.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 25848A5B7E93DCA744373200 /* OneSignal-Dynamic.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 8E57965CF0E9F1C341E61996 /* OneSignalFramework.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 25848A5B7E93DCA744373200 /* OneSignalFramework.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 8EA2FF24D93691FDC1661913 /* CustomEventsSection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B6FF0BC430F5A2B89215967 /* CustomEventsSection.swift */; }; 902A116B26B8ECAD8EE29C95 /* ToggleRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 911376C90AA43F41478596FE /* ToggleRow.swift */; }; 93104E0838915DD6194805D5 /* Secrets.plist in Resources */ = {isa = PBXBuildFile; fileRef = 6B00BC406653BC6B08ECCE26 /* Secrets.plist */; }; @@ -74,7 +74,7 @@ CAB90AEC123A57B401881DBC /* OneSignalOSCore.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 1636BCBAB444EAC7BB34CEDE /* OneSignalOSCore.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; CE2C54D552E42C2538FB95C4 /* UserSection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9E2383E8AA63BF04ADA2CF0D /* UserSection.swift */; }; D154E0266C8AB372F928D42A /* OneSignalLocation.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = FE9834773C437CC373607693 /* OneSignalLocation.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - D65AC6EC014557264E7A3697 /* OneSignal-Dynamic.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 25848A5B7E93DCA744373200 /* OneSignal-Dynamic.framework */; }; + D65AC6EC014557264E7A3697 /* OneSignalFramework.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 25848A5B7E93DCA744373200 /* OneSignalFramework.framework */; }; DBDA727D6317A3CCC73A1699 /* LiveActivitySection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27856D76807C31B23CD10CFD /* LiveActivitySection.swift */; }; E3725231A3FD5F5A88BAA758 /* MultiPairInputDialog.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4072202943CA64D2CBC38CB5 /* MultiPairInputDialog.swift */; }; E5671E3A84219D49E45F8DCF /* KeyValueRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5984B93007C6B85AFE09045A /* KeyValueRow.swift */; }; @@ -298,7 +298,7 @@ D154E0266C8AB372F928D42A /* OneSignalLocation.framework in Embed Frameworks */, C6E9E2C6716059856A1AC571 /* OneSignalInAppMessages.framework in Embed Frameworks */, 9FCE157075859B954814F6B7 /* OneSignalLiveActivities.framework in Embed Frameworks */, - 8E57965CF0E9F1C341E61996 /* OneSignal-Dynamic.framework in Embed Frameworks */, + 8E57965CF0E9F1C341E61996 /* OneSignalFramework.framework in Embed Frameworks */, ); name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; @@ -327,7 +327,7 @@ 4078B5F096680AFA83D1CB85 /* OutcomesSection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OutcomesSection.swift; sourceTree = ""; }; 432444EA41C495988DFAB422 /* TrackEventDialog.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TrackEventDialog.swift; sourceTree = ""; }; 497484E7C094D645338BD404 /* SectionCard.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SectionCard.swift; sourceTree = ""; }; - 49D88A349FD70A9153DD2C03 /* App.app */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.application; path = App.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 49D88A349FD70A9153DD2C03 /* App.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = App.app; sourceTree = BUILT_PRODUCTS_DIR; }; 4B6FF0BC430F5A2B89215967 /* CustomEventsSection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomEventsSection.swift; sourceTree = ""; }; 5984B93007C6B85AFE09045A /* KeyValueRow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeyValueRow.swift; sourceTree = ""; }; 5C0EE23773C63B6EC3FB563A /* LocationSection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocationSection.swift; sourceTree = ""; }; @@ -344,8 +344,8 @@ 9E2383E8AA63BF04ADA2CF0D /* UserSection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserSection.swift; sourceTree = ""; }; A20B46F63592FC67B655BEB8 /* NotificationService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationService.swift; sourceTree = ""; }; A42B5EDA3264E3D00A5CB265 /* PushSection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PushSection.swift; sourceTree = ""; }; - AB92C9C455B15E0B571A1C66 /* OneSignalWidget.appex */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = "wrapper.app-extension"; path = OneSignalWidget.appex; sourceTree = BUILT_PRODUCTS_DIR; }; - B24E059F4DF6ABED55BA3183 /* OneSignalNotificationServiceExtension.appex */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = "wrapper.app-extension"; path = OneSignalNotificationServiceExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; }; + AB92C9C455B15E0B571A1C66 /* OneSignalWidget.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = OneSignalWidget.appex; sourceTree = BUILT_PRODUCTS_DIR; }; + B24E059F4DF6ABED55BA3183 /* OneSignalNotificationServiceExtension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = OneSignalNotificationServiceExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; }; B3E7F504B0421F2B6247E2F5 /* Theme.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Theme.swift; sourceTree = ""; }; B76FFAF18177241F4A47FE23 /* InAppSection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InAppSection.swift; sourceTree = ""; }; BDB04A33912347325A0155D6 /* App.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = App.swift; sourceTree = ""; }; @@ -387,7 +387,7 @@ 68BC99D15FDCB26EB35EBB07 /* OneSignalLocation.framework in Frameworks */, C31F603E294D69E30CE65EA3 /* OneSignalInAppMessages.framework in Frameworks */, E72F68A7DB51347AB8B10FA7 /* OneSignalLiveActivities.framework in Frameworks */, - D65AC6EC014557264E7A3697 /* OneSignal-Dynamic.framework in Frameworks */, + D65AC6EC014557264E7A3697 /* OneSignalFramework.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -419,6 +419,7 @@ C83678AA9260FD8491BCC58F /* OneSignalWidget */, E9C3DB3EC6D7655028A9C0D3 /* Products */, E81A0E25363045BA30E3D600 /* Projects */, + E80C82F0302EA91C00ABB67A /* Recovered References */, ); sourceTree = ""; }; @@ -470,16 +471,16 @@ 54D70151146ED2430545164A /* Products */ = { isa = PBXGroup; children = ( + 25848A5B7E93DCA744373200 /* OneSignalFramework.framework */, 2C1B9BE42E81492B9DB61343 /* OneSignalCore.framework */, + B2F82BD207897EB78739182A /* OneSignalExtension.framework */, + EF49509A218369322ECFA3B9 /* OneSignalUser.framework */, 1636BCBAB444EAC7BB34CEDE /* OneSignalOSCore.framework */, EC2530FFC78AECEAF6A7E1B7 /* OneSignalOutcomes.framework */, 283B132CEE12D26D1FA1AADF /* OneSignalNotifications.framework */, - EF49509A218369322ECFA3B9 /* OneSignalUser.framework */, - B2F82BD207897EB78739182A /* OneSignalExtension.framework */, FE9834773C437CC373607693 /* OneSignalLocation.framework */, 919F0D129D0FA271E24F0BBD /* OneSignalInAppMessages.framework */, F5EBC48D807036E572D97F0E /* OneSignalLiveActivities.framework */, - 25848A5B7E93DCA744373200 /* OneSignal-Dynamic.framework */, ); name = Products; sourceTree = ""; @@ -537,6 +538,14 @@ path = OneSignalNotificationServiceExtension; sourceTree = ""; }; + E80C82F0302EA91C00ABB67A /* Recovered References */ = { + isa = PBXGroup; + children = ( + "TEMP_28AA92EA-E2C8-4969-80AB-657A0AF14B2F" /* Build.xcconfig */, + ); + name = "Recovered References"; + sourceTree = ""; + }; E81A0E25363045BA30E3D600 /* Projects */ = { isa = PBXGroup; children = ( @@ -567,14 +576,6 @@ path = Views; sourceTree = ""; }; - "TEMP_D8085C8F-3CA5-457D-9FB3-7C8E9DA8B66A" /* demo */ = { - isa = PBXGroup; - children = ( - "TEMP_28AA92EA-E2C8-4969-80AB-657A0AF14B2F" /* Build.xcconfig */, - ); - path = demo; - sourceTree = ""; - }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -660,8 +661,6 @@ attributes = { BuildIndependentTargetsInParallel = YES; LastUpgradeCheck = 1430; - TargetAttributes = { - }; }; buildConfigurationList = B3FD05C59F197F398A0B04AB /* Build configuration list for PBXProject "App" */; developmentRegion = en; @@ -698,10 +697,10 @@ remoteRef = 8B6EE756CF7175F38D5B5B4B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 25848A5B7E93DCA744373200 /* OneSignal-Dynamic.framework */ = { + 25848A5B7E93DCA744373200 /* OneSignalFramework.framework */ = { isa = PBXReferenceProxy; fileType = wrapper.framework; - path = "OneSignal-Dynamic.framework"; + path = OneSignalFramework.framework; remoteRef = 25CC6D5CA1E9DA9142715E8A /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -947,11 +946,17 @@ DEVELOPMENT_TEAM = 99SW8E36CT; INFOPLIST_FILE = OneSignalWidget/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 16.2; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@executable_path/../../Frameworks", + ); PRODUCT_BUNDLE_IDENTIFIER = com.onesignal.example.LA; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = iphoneos; SKIP_INSTALL = YES; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; + SUPPORTS_MACCATALYST = YES; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -967,10 +972,15 @@ ENABLE_USER_SCRIPT_SANDBOXING = NO; INFOPLIST_FILE = App/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 16.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); PRODUCT_BUNDLE_IDENTIFIER = com.onesignal.example; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; + SUPPORTS_MACCATALYST = YES; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -1047,13 +1057,19 @@ "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 99SW8E36CT; INFOPLIST_FILE = OneSignalNotificationServiceExtension/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 16.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@executable_path/../../Frameworks", + ); PRODUCT_BUNDLE_IDENTIFIER = com.onesignal.example.NSE; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "Appium Demo - NSE"; SDKROOT = iphoneos; SKIP_INSTALL = YES; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; + SUPPORTS_MACCATALYST = YES; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; @@ -1071,12 +1087,17 @@ ENABLE_USER_SCRIPT_SANDBOXING = NO; INFOPLIST_FILE = App/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 16.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); PRODUCT_BUNDLE_IDENTIFIER = com.onesignal.example; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "Appium Demo - Main"; SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; + SUPPORTS_MACCATALYST = YES; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; @@ -1093,13 +1114,19 @@ "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 99SW8E36CT; INFOPLIST_FILE = OneSignalWidget/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 16.2; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@executable_path/../../Frameworks", + ); PRODUCT_BUNDLE_IDENTIFIER = com.onesignal.example.LA; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "Appium Demo - Live Activity"; SDKROOT = iphoneos; SKIP_INSTALL = YES; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; + SUPPORTS_MACCATALYST = YES; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; @@ -1112,11 +1139,17 @@ DEVELOPMENT_TEAM = 99SW8E36CT; INFOPLIST_FILE = OneSignalNotificationServiceExtension/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 16.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@executable_path/../../Frameworks", + ); PRODUCT_BUNDLE_IDENTIFIER = com.onesignal.example.NSE; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = iphoneos; SKIP_INSTALL = YES; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; + SUPPORTS_MACCATALYST = YES; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; From 2dc947f0798eaa8c161a4e5853d7054a87c709ab Mon Sep 17 00:00:00 2001 From: Fadi George Date: Thu, 13 Aug 2026 22:16:00 -0700 Subject: [PATCH 2/4] chore(demo): add Mac Catalyst support --- examples/demo/App.xcodeproj/project.pbxproj | 107 +++++++----------- .../App/Services/LiveActivityController.swift | 6 + .../OneSignalWidgetBundle.swift | 4 + .../OneSignalWidgetLiveActivity.swift | 42 ++++++- examples/demo/project.yml | 2 + 5 files changed, 92 insertions(+), 69 deletions(-) diff --git a/examples/demo/App.xcodeproj/project.pbxproj b/examples/demo/App.xcodeproj/project.pbxproj index 12d27e0d1..09279596c 100644 --- a/examples/demo/App.xcodeproj/project.pbxproj +++ b/examples/demo/App.xcodeproj/project.pbxproj @@ -53,7 +53,7 @@ 8068AFC608E7E82F06733BE7 /* OneSignalCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2C1B9BE42E81492B9DB61343 /* OneSignalCore.framework */; }; 80E3E2B5438CFEBE1316FA84 /* OneSignalCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2C1B9BE42E81492B9DB61343 /* OneSignalCore.framework */; }; 837FCE7A095ED1D7CCFEACF3 /* InAppSection.swift in Sources */ = {isa = PBXBuildFile; fileRef = B76FFAF18177241F4A47FE23 /* InAppSection.swift */; }; - 8E57965CF0E9F1C341E61996 /* OneSignalFramework.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 25848A5B7E93DCA744373200 /* OneSignalFramework.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 8E57965CF0E9F1C341E61996 /* OneSignal-Dynamic.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 25848A5B7E93DCA744373200 /* OneSignal-Dynamic.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 8EA2FF24D93691FDC1661913 /* CustomEventsSection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B6FF0BC430F5A2B89215967 /* CustomEventsSection.swift */; }; 902A116B26B8ECAD8EE29C95 /* ToggleRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 911376C90AA43F41478596FE /* ToggleRow.swift */; }; 93104E0838915DD6194805D5 /* Secrets.plist in Resources */ = {isa = PBXBuildFile; fileRef = 6B00BC406653BC6B08ECCE26 /* Secrets.plist */; }; @@ -74,7 +74,7 @@ CAB90AEC123A57B401881DBC /* OneSignalOSCore.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 1636BCBAB444EAC7BB34CEDE /* OneSignalOSCore.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; CE2C54D552E42C2538FB95C4 /* UserSection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9E2383E8AA63BF04ADA2CF0D /* UserSection.swift */; }; D154E0266C8AB372F928D42A /* OneSignalLocation.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = FE9834773C437CC373607693 /* OneSignalLocation.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - D65AC6EC014557264E7A3697 /* OneSignalFramework.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 25848A5B7E93DCA744373200 /* OneSignalFramework.framework */; }; + D65AC6EC014557264E7A3697 /* OneSignal-Dynamic.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 25848A5B7E93DCA744373200 /* OneSignal-Dynamic.framework */; }; DBDA727D6317A3CCC73A1699 /* LiveActivitySection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27856D76807C31B23CD10CFD /* LiveActivitySection.swift */; }; E3725231A3FD5F5A88BAA758 /* MultiPairInputDialog.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4072202943CA64D2CBC38CB5 /* MultiPairInputDialog.swift */; }; E5671E3A84219D49E45F8DCF /* KeyValueRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5984B93007C6B85AFE09045A /* KeyValueRow.swift */; }; @@ -298,7 +298,7 @@ D154E0266C8AB372F928D42A /* OneSignalLocation.framework in Embed Frameworks */, C6E9E2C6716059856A1AC571 /* OneSignalInAppMessages.framework in Embed Frameworks */, 9FCE157075859B954814F6B7 /* OneSignalLiveActivities.framework in Embed Frameworks */, - 8E57965CF0E9F1C341E61996 /* OneSignalFramework.framework in Embed Frameworks */, + 8E57965CF0E9F1C341E61996 /* OneSignal-Dynamic.framework in Embed Frameworks */, ); name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; @@ -327,7 +327,7 @@ 4078B5F096680AFA83D1CB85 /* OutcomesSection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OutcomesSection.swift; sourceTree = ""; }; 432444EA41C495988DFAB422 /* TrackEventDialog.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TrackEventDialog.swift; sourceTree = ""; }; 497484E7C094D645338BD404 /* SectionCard.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SectionCard.swift; sourceTree = ""; }; - 49D88A349FD70A9153DD2C03 /* App.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = App.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 49D88A349FD70A9153DD2C03 /* App.app */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.application; path = App.app; sourceTree = BUILT_PRODUCTS_DIR; }; 4B6FF0BC430F5A2B89215967 /* CustomEventsSection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomEventsSection.swift; sourceTree = ""; }; 5984B93007C6B85AFE09045A /* KeyValueRow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeyValueRow.swift; sourceTree = ""; }; 5C0EE23773C63B6EC3FB563A /* LocationSection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocationSection.swift; sourceTree = ""; }; @@ -344,8 +344,8 @@ 9E2383E8AA63BF04ADA2CF0D /* UserSection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserSection.swift; sourceTree = ""; }; A20B46F63592FC67B655BEB8 /* NotificationService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationService.swift; sourceTree = ""; }; A42B5EDA3264E3D00A5CB265 /* PushSection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PushSection.swift; sourceTree = ""; }; - AB92C9C455B15E0B571A1C66 /* OneSignalWidget.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = OneSignalWidget.appex; sourceTree = BUILT_PRODUCTS_DIR; }; - B24E059F4DF6ABED55BA3183 /* OneSignalNotificationServiceExtension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = OneSignalNotificationServiceExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; }; + AB92C9C455B15E0B571A1C66 /* OneSignalWidget.appex */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = "wrapper.app-extension"; path = OneSignalWidget.appex; sourceTree = BUILT_PRODUCTS_DIR; }; + B24E059F4DF6ABED55BA3183 /* OneSignalNotificationServiceExtension.appex */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = "wrapper.app-extension"; path = OneSignalNotificationServiceExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; }; B3E7F504B0421F2B6247E2F5 /* Theme.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Theme.swift; sourceTree = ""; }; B76FFAF18177241F4A47FE23 /* InAppSection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InAppSection.swift; sourceTree = ""; }; BDB04A33912347325A0155D6 /* App.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = App.swift; sourceTree = ""; }; @@ -360,7 +360,7 @@ E194A3F19072CB17A8F1A12E /* SmsSection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SmsSection.swift; sourceTree = ""; }; ECAC7EF0B67920F9FEC4F129 /* TagsSection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TagsSection.swift; sourceTree = ""; }; F46DFACB9F304B9374F3C570 /* ToastView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ToastView.swift; sourceTree = ""; }; - "TEMP_28AA92EA-E2C8-4969-80AB-657A0AF14B2F" /* Build.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Build.xcconfig; sourceTree = ""; }; + "TEMP_0E1FE525-4849-45DE-A712-899A0C859B23" /* Build.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Build.xcconfig; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -387,7 +387,7 @@ 68BC99D15FDCB26EB35EBB07 /* OneSignalLocation.framework in Frameworks */, C31F603E294D69E30CE65EA3 /* OneSignalInAppMessages.framework in Frameworks */, E72F68A7DB51347AB8B10FA7 /* OneSignalLiveActivities.framework in Frameworks */, - D65AC6EC014557264E7A3697 /* OneSignalFramework.framework in Frameworks */, + D65AC6EC014557264E7A3697 /* OneSignal-Dynamic.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -419,7 +419,6 @@ C83678AA9260FD8491BCC58F /* OneSignalWidget */, E9C3DB3EC6D7655028A9C0D3 /* Products */, E81A0E25363045BA30E3D600 /* Projects */, - E80C82F0302EA91C00ABB67A /* Recovered References */, ); sourceTree = ""; }; @@ -471,16 +470,16 @@ 54D70151146ED2430545164A /* Products */ = { isa = PBXGroup; children = ( - 25848A5B7E93DCA744373200 /* OneSignalFramework.framework */, 2C1B9BE42E81492B9DB61343 /* OneSignalCore.framework */, - B2F82BD207897EB78739182A /* OneSignalExtension.framework */, - EF49509A218369322ECFA3B9 /* OneSignalUser.framework */, 1636BCBAB444EAC7BB34CEDE /* OneSignalOSCore.framework */, EC2530FFC78AECEAF6A7E1B7 /* OneSignalOutcomes.framework */, 283B132CEE12D26D1FA1AADF /* OneSignalNotifications.framework */, + EF49509A218369322ECFA3B9 /* OneSignalUser.framework */, + B2F82BD207897EB78739182A /* OneSignalExtension.framework */, FE9834773C437CC373607693 /* OneSignalLocation.framework */, 919F0D129D0FA271E24F0BBD /* OneSignalInAppMessages.framework */, F5EBC48D807036E572D97F0E /* OneSignalLiveActivities.framework */, + 25848A5B7E93DCA744373200 /* OneSignal-Dynamic.framework */, ); name = Products; sourceTree = ""; @@ -538,14 +537,6 @@ path = OneSignalNotificationServiceExtension; sourceTree = ""; }; - E80C82F0302EA91C00ABB67A /* Recovered References */ = { - isa = PBXGroup; - children = ( - "TEMP_28AA92EA-E2C8-4969-80AB-657A0AF14B2F" /* Build.xcconfig */, - ); - name = "Recovered References"; - sourceTree = ""; - }; E81A0E25363045BA30E3D600 /* Projects */ = { isa = PBXGroup; children = ( @@ -576,6 +567,14 @@ path = Views; sourceTree = ""; }; + "TEMP_99839FD6-FA1F-4A7A-8510-1B74D1DAA81F" /* demo */ = { + isa = PBXGroup; + children = ( + "TEMP_0E1FE525-4849-45DE-A712-899A0C859B23" /* Build.xcconfig */, + ); + path = demo; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -661,6 +660,8 @@ attributes = { BuildIndependentTargetsInParallel = YES; LastUpgradeCheck = 1430; + TargetAttributes = { + }; }; buildConfigurationList = B3FD05C59F197F398A0B04AB /* Build configuration list for PBXProject "App" */; developmentRegion = en; @@ -697,10 +698,10 @@ remoteRef = 8B6EE756CF7175F38D5B5B4B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 25848A5B7E93DCA744373200 /* OneSignalFramework.framework */ = { + 25848A5B7E93DCA744373200 /* OneSignal-Dynamic.framework */ = { isa = PBXReferenceProxy; fileType = wrapper.framework; - path = OneSignalFramework.framework; + path = "OneSignal-Dynamic.framework"; remoteRef = 25CC6D5CA1E9DA9142715E8A /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -939,31 +940,25 @@ /* Begin XCBuildConfiguration section */ 0D2EF3911CA89837C30DB0D1 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = "TEMP_28AA92EA-E2C8-4969-80AB-657A0AF14B2F" /* Build.xcconfig */; + baseConfigurationReference = "TEMP_0E1FE525-4849-45DE-A712-899A0C859B23" /* Build.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground; DEVELOPMENT_TEAM = 99SW8E36CT; INFOPLIST_FILE = OneSignalWidget/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 16.2; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@executable_path/../../Frameworks", - ); + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.onesignal.example.LA; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = iphoneos; SKIP_INSTALL = YES; - SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; - SUPPORTS_MACCATALYST = YES; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; }; 4A0C935808978B5A7673E412 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = "TEMP_28AA92EA-E2C8-4969-80AB-657A0AF14B2F" /* Build.xcconfig */; + baseConfigurationReference = "TEMP_0E1FE525-4849-45DE-A712-899A0C859B23" /* Build.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_ENTITLEMENTS = App.entitlements; @@ -972,15 +967,10 @@ ENABLE_USER_SCRIPT_SANDBOXING = NO; INFOPLIST_FILE = App/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 16.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.onesignal.example; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = iphoneos; - SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; - SUPPORTS_MACCATALYST = YES; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -1022,6 +1012,7 @@ COPY_PHASE_STRIP = NO; CURRENT_PROJECT_VERSION = 1; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DERIVE_MACCATALYST_PRODUCT_BUNDLE_IDENTIFIER = YES; DEVELOPMENT_TEAM = ""; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; @@ -1040,6 +1031,7 @@ MTL_FAST_MATH = YES; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = iphoneos; + SUPPORTS_MACCATALYST = YES; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_OPTIMIZATION_LEVEL = "-O"; SWIFT_VERSION = 5.9; @@ -1048,7 +1040,7 @@ }; D0E56A85F1C385808720F94B /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = "TEMP_28AA92EA-E2C8-4969-80AB-657A0AF14B2F" /* Build.xcconfig */; + baseConfigurationReference = "TEMP_0E1FE525-4849-45DE-A712-899A0C859B23" /* Build.xcconfig */; buildSettings = { CODE_SIGN_ENTITLEMENTS = OneSignalNotificationServiceExtension/OneSignalNotificationServiceExtension.entitlements; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; @@ -1057,26 +1049,20 @@ "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 99SW8E36CT; INFOPLIST_FILE = OneSignalNotificationServiceExtension/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 16.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@executable_path/../../Frameworks", - ); + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.onesignal.example.NSE; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "Appium Demo - NSE"; SDKROOT = iphoneos; SKIP_INSTALL = YES; - SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; - SUPPORTS_MACCATALYST = YES; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; }; EB1CC3A930E09FEBECF9195D /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = "TEMP_28AA92EA-E2C8-4969-80AB-657A0AF14B2F" /* Build.xcconfig */; + baseConfigurationReference = "TEMP_0E1FE525-4849-45DE-A712-899A0C859B23" /* Build.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_ENTITLEMENTS = App.entitlements; @@ -1087,24 +1073,19 @@ ENABLE_USER_SCRIPT_SANDBOXING = NO; INFOPLIST_FILE = App/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 16.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.onesignal.example; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "Appium Demo - Main"; SDKROOT = iphoneos; - SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; - SUPPORTS_MACCATALYST = YES; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; }; F305A3E63851EE49DA2D190E /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = "TEMP_28AA92EA-E2C8-4969-80AB-657A0AF14B2F" /* Build.xcconfig */; + baseConfigurationReference = "TEMP_0E1FE525-4849-45DE-A712-899A0C859B23" /* Build.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground; @@ -1114,42 +1095,30 @@ "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 99SW8E36CT; INFOPLIST_FILE = OneSignalWidget/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 16.2; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@executable_path/../../Frameworks", - ); + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.onesignal.example.LA; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "Appium Demo - Live Activity"; SDKROOT = iphoneos; SKIP_INSTALL = YES; - SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; - SUPPORTS_MACCATALYST = YES; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; }; F5FD25168D9B32A08A468069 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = "TEMP_28AA92EA-E2C8-4969-80AB-657A0AF14B2F" /* Build.xcconfig */; + baseConfigurationReference = "TEMP_0E1FE525-4849-45DE-A712-899A0C859B23" /* Build.xcconfig */; buildSettings = { CODE_SIGN_ENTITLEMENTS = OneSignalNotificationServiceExtension/OneSignalNotificationServiceExtension.entitlements; DEVELOPMENT_TEAM = 99SW8E36CT; INFOPLIST_FILE = OneSignalNotificationServiceExtension/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 16.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@executable_path/../../Frameworks", - ); + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.onesignal.example.NSE; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = iphoneos; SKIP_INSTALL = YES; - SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; - SUPPORTS_MACCATALYST = YES; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -1191,6 +1160,7 @@ COPY_PHASE_STRIP = NO; CURRENT_PROJECT_VERSION = 1; DEBUG_INFORMATION_FORMAT = dwarf; + DERIVE_MACCATALYST_PRODUCT_BUNDLE_IDENTIFIER = YES; DEVELOPMENT_TEAM = ""; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; @@ -1216,6 +1186,7 @@ ONLY_ACTIVE_ARCH = YES; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = iphoneos; + SUPPORTS_MACCATALYST = YES; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.9; diff --git a/examples/demo/App/Services/LiveActivityController.swift b/examples/demo/App/Services/LiveActivityController.swift index 8d00a542d..94c6cee21 100644 --- a/examples/demo/App/Services/LiveActivityController.swift +++ b/examples/demo/App/Services/LiveActivityController.swift @@ -27,7 +27,9 @@ import Foundation import OneSignalFramework +#if !targetEnvironment(macCatalyst) import OneSignalLiveActivities +#endif /// Order tracking phases used by the Live Activity demo enum LiveActivityStatus: String, CaseIterable, Identifiable { @@ -76,7 +78,9 @@ enum LiveActivityController { @available(iOS 16.1, *) static func setup() { + #if !targetEnvironment(macCatalyst) OneSignal.LiveActivities.setupDefault() + #endif } @available(iOS 16.1, *) @@ -85,6 +89,7 @@ enum LiveActivityController { orderNumber: String, status: LiveActivityStatus ) { + #if !targetEnvironment(macCatalyst) let attributes: [String: Any] = [ "orderNumber": orderNumber ] @@ -98,6 +103,7 @@ enum LiveActivityController { attributes: attributes, content: content ) + #endif } static func update(appId: String, activityId: String, status: LiveActivityStatus) async -> Bool { diff --git a/examples/demo/OneSignalWidget/OneSignalWidgetBundle.swift b/examples/demo/OneSignalWidget/OneSignalWidgetBundle.swift index 063a36e0c..4db76db04 100644 --- a/examples/demo/OneSignalWidget/OneSignalWidgetBundle.swift +++ b/examples/demo/OneSignalWidget/OneSignalWidgetBundle.swift @@ -31,8 +31,12 @@ import SwiftUI @main struct OneSignalWidgetBundle: WidgetBundle { var body: some Widget { + #if targetEnvironment(macCatalyst) + OneSignalWidgetPlaceholder() + #else if #available(iOS 16.2, *) { OneSignalWidgetLiveActivity() } + #endif } } diff --git a/examples/demo/OneSignalWidget/OneSignalWidgetLiveActivity.swift b/examples/demo/OneSignalWidget/OneSignalWidgetLiveActivity.swift index cf4a029d3..181af0ea4 100644 --- a/examples/demo/OneSignalWidget/OneSignalWidgetLiveActivity.swift +++ b/examples/demo/OneSignalWidget/OneSignalWidgetLiveActivity.swift @@ -25,9 +25,48 @@ * THE SOFTWARE. */ -import ActivityKit import WidgetKit import SwiftUI + +#if targetEnvironment(macCatalyst) +private struct CatalystPlaceholderEntry: TimelineEntry { + let date: Date +} + +private struct CatalystPlaceholderProvider: TimelineProvider { + func placeholder(in context: Context) -> CatalystPlaceholderEntry { + CatalystPlaceholderEntry(date: Date()) + } + + func getSnapshot( + in context: Context, + completion: @escaping (CatalystPlaceholderEntry) -> Void + ) { + completion(CatalystPlaceholderEntry(date: Date())) + } + + func getTimeline( + in context: Context, + completion: @escaping (Timeline) -> Void + ) { + completion(Timeline(entries: [CatalystPlaceholderEntry(date: Date())], policy: .never)) + } +} + +struct OneSignalWidgetPlaceholder: Widget { + var body: some WidgetConfiguration { + StaticConfiguration( + kind: "com.onesignal.example.catalyst-placeholder", + provider: CatalystPlaceholderProvider() + ) { _ in + Text("OneSignal") + } + .configurationDisplayName("OneSignal") + .description("Live Activities are unavailable on Mac Catalyst.") + } +} +#else +import ActivityKit import OneSignalLiveActivities /// Live Activity widget that renders the order tracking flow used by the demo. @@ -173,3 +212,4 @@ struct DeliveryProgressBar: View { .frame(height: 6) } } +#endif diff --git a/examples/demo/project.yml b/examples/demo/project.yml index fe654b541..666776158 100644 --- a/examples/demo/project.yml +++ b/examples/demo/project.yml @@ -18,6 +18,8 @@ settings: CODE_SIGN_STYLE: Automatic DEVELOPMENT_TEAM: "" GENERATE_INFOPLIST_FILE: NO + SUPPORTS_MACCATALYST: YES + DERIVE_MACCATALYST_PRODUCT_BUNDLE_IDENTIFIER: YES projectReferences: OneSignalSDK: path: ../../iOS_SDK/OneSignalSDK/OneSignal.xcodeproj From 7664bd5c12d30009d70f6f091a9850f90a638969 Mon Sep 17 00:00:00 2001 From: Fadi George Date: Thu, 13 Aug 2026 22:48:26 -0700 Subject: [PATCH 3/4] fix(storage): create directory before atomic write --- .../Source/OSResilientStorage.swift | 28 +++++++++++++++---- .../OSResilientStorageTests.swift | 12 ++++++++ 2 files changed, 35 insertions(+), 5 deletions(-) diff --git a/iOS_SDK/OneSignalSDK/OneSignalOSCore/Source/OSResilientStorage.swift b/iOS_SDK/OneSignalSDK/OneSignalOSCore/Source/OSResilientStorage.swift index 21f3b07ae..c9dc9f260 100644 --- a/iOS_SDK/OneSignalSDK/OneSignalOSCore/Source/OSResilientStorage.swift +++ b/iOS_SDK/OneSignalSDK/OneSignalOSCore/Source/OSResilientStorage.swift @@ -59,27 +59,45 @@ public final class OSResilientStorage: NSObject { /// the NSE can read the same file. Falls back to the app's private /// Application Support directory when no App Group is entitled. private static func fileURL() -> URL? { - let fm = FileManager.default + let fileManager = FileManager.default let groupName = OneSignalUserDefaults.appGroupName() - if let container = fm.containerURL(forSecurityApplicationGroupIdentifier: groupName) { - return container.appendingPathComponent(fileName) + if let container = fileManager.containerURL(forSecurityApplicationGroupIdentifier: groupName) { + do { + return try preparedFileURL(in: container, fileManager: fileManager) + } catch { + OneSignalLog.onesignalLog( + .LL_WARN, + message: "OSResilientStorage could not prepare the App Group container: \(error)" + ) + } } do { - let support = try fm.url( + let support = try fileManager.url( for: .applicationSupportDirectory, in: .userDomainMask, appropriateFor: nil, create: true ) - return support.appendingPathComponent(fileName) + return try preparedFileURL(in: support, fileManager: fileManager) } catch { OneSignalLog.onesignalLog(.LL_ERROR, message: "OSResilientStorage could not resolve a container URL: \(error)") return nil } } + static func preparedFileURL( + in directory: URL, + fileManager: FileManager = .default + ) throws -> URL { + try fileManager.createDirectory( + at: directory, + withIntermediateDirectories: true + ) + return directory.appendingPathComponent(fileName) + } + /// Reads the cache file. Caller is responsible for queue-serialization. /// Returns an empty dict if the file is missing or unreadable. private static func loadUnsafe() -> [String: String] { diff --git a/iOS_SDK/OneSignalSDK/OneSignalOSCoreTests/OSResilientStorageTests.swift b/iOS_SDK/OneSignalSDK/OneSignalOSCoreTests/OSResilientStorageTests.swift index af6f527d6..cf7ebade7 100644 --- a/iOS_SDK/OneSignalSDK/OneSignalOSCoreTests/OSResilientStorageTests.swift +++ b/iOS_SDK/OneSignalSDK/OneSignalOSCoreTests/OSResilientStorageTests.swift @@ -64,6 +64,18 @@ final class OSResilientStorageTests: XCTestCase { XCTAssertNil(OSResilientStorage.string(forKey: "never_written_\(UUID().uuidString)")) } + func testPreparedFileURL_createsMissingContainerForAtomicWrites() throws { + let root = FileManager.default.temporaryDirectory + .appendingPathComponent(UUID().uuidString, isDirectory: true) + let container = root.appendingPathComponent("group.example", isDirectory: true) + defer { try? FileManager.default.removeItem(at: root) } + + let fileURL = try OSResilientStorage.preparedFileURL(in: container) + try Data("value".utf8).write(to: fileURL, options: .atomic) + + XCTAssertTrue(FileManager.default.fileExists(atPath: fileURL.path)) + } + func testSetWithNil_removesKey() { OSResilientStorage.setString("alpha", forKey: keyA) XCTAssertEqual(OSResilientStorage.string(forKey: keyA), "alpha") From 864c6aa25040671182a47a2aa0183594bbe7a9c1 Mon Sep 17 00:00:00 2001 From: Fadi George Date: Thu, 13 Aug 2026 22:50:25 -0700 Subject: [PATCH 4/4] fix(live-activities): stub out on Mac Catalyst --- iOS_SDK/OneSignalSDK/Source/OneSignal.m | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/iOS_SDK/OneSignalSDK/Source/OneSignal.m b/iOS_SDK/OneSignalSDK/Source/OneSignal.m index 0b3313bf8..0a1bd38ec 100755 --- a/iOS_SDK/OneSignalSDK/Source/OneSignal.m +++ b/iOS_SDK/OneSignalSDK/Source/OneSignal.m @@ -26,6 +26,7 @@ */ #import +#import #import "OneSignalFramework.h" #import #import "OneSignalInternal.h" @@ -206,6 +207,9 @@ + (void)logout { } + (Class)LiveActivities { +#if TARGET_OS_MACCATALYST + return [OSStubLiveActivities liveActivities]; +#else let oneSignalLiveActivities = NSClassFromString(ONE_SIGNAL_LIVE_ACTIVITIES_CLASS_NAME); if (oneSignalLiveActivities != nil && [oneSignalLiveActivities respondsToSelector:@selector(liveActivities)]) { return [oneSignalLiveActivities performSelector:@selector(liveActivities)]; @@ -213,6 +217,7 @@ + (void)logout { [OneSignalLog onesignalLog:ONE_S_LL_ERROR message:@"oneSignalLiveActivities not found. In order to use OneSignal's LiveActivities features the OneSignalLiveActivities module must be added."]; return [OSStubLiveActivities liveActivities]; } +#endif } + (Class)Location { @@ -440,12 +445,16 @@ + (void)startUserManager { } + (void)startLiveActivitiesManager { +#if TARGET_OS_MACCATALYST + return; +#else let oneSignalLiveActivities = NSClassFromString(ONE_SIGNAL_LIVE_ACTIVITIES_CLASS_NAME); if (oneSignalLiveActivities != nil && [oneSignalLiveActivities respondsToSelector:@selector(start)]) { [oneSignalLiveActivities performSelector:@selector(start)]; } else { [OneSignalLog onesignalLog:ONE_S_LL_ERROR message:@"oneSignalLiveActivities not found. In order to use OneSignal's LiveActivities features the OneSignalLiveActivities module must be added."]; } +#endif } + (void)delayInitializationForPrivacyConsent {