diff --git a/examples/RNOneSignalTS/ios/Podfile b/examples/RNOneSignalTS/ios/Podfile index b33e170b..cd6453ac 100644 --- a/examples/RNOneSignalTS/ios/Podfile +++ b/examples/RNOneSignalTS/ios/Podfile @@ -23,6 +23,10 @@ target 'RNOneSignalTS' do # end end +target 'RNOneSignalWidgetExtension' do + pod 'OneSignalXCFramework', '>= 5.0.2', '< 6.0.0' +end + target 'RNOneSignalTS-tvOS' do # Pods for RNOneSignalTS-tvOS diff --git a/examples/RNOneSignalTS/ios/Podfile.lock b/examples/RNOneSignalTS/ios/Podfile.lock index 09fdf3c2..a828f3da 100644 --- a/examples/RNOneSignalTS/ios/Podfile.lock +++ b/examples/RNOneSignalTS/ios/Podfile.lock @@ -10,26 +10,48 @@ PODS: - React-jsi (= 0.64.4) - ReactCommon/turbomodule/core (= 0.64.4) - glog (0.3.5) - - OneSignalXCFramework (5.0.0-beta-01): - - OneSignalXCFramework/OneSignalCore (= 5.0.0-beta-01) - - OneSignalXCFramework/OneSignalExtension (= 5.0.0-beta-01) - - OneSignalXCFramework/OneSignalNotifications (= 5.0.0-beta-01) - - OneSignalXCFramework/OneSignalOSCore (= 5.0.0-beta-01) - - OneSignalXCFramework/OneSignalOutcomes (= 5.0.0-beta-01) - - OneSignalXCFramework/OneSignalUser (= 5.0.0-beta-01) - - OneSignalXCFramework/OneSignalCore (5.0.0-beta-01) - - OneSignalXCFramework/OneSignalExtension (5.0.0-beta-01): + - OneSignalXCFramework (5.2.0): + - OneSignalXCFramework/OneSignalComplete (= 5.2.0) + - OneSignalXCFramework/OneSignal (5.2.0): - OneSignalXCFramework/OneSignalCore + - OneSignalXCFramework/OneSignalExtension + - OneSignalXCFramework/OneSignalLiveActivities + - OneSignalXCFramework/OneSignalNotifications + - OneSignalXCFramework/OneSignalOSCore + - OneSignalXCFramework/OneSignalOutcomes + - OneSignalXCFramework/OneSignalUser + - OneSignalXCFramework/OneSignalComplete (5.2.0): + - OneSignalXCFramework/OneSignal + - OneSignalXCFramework/OneSignalInAppMessages + - OneSignalXCFramework/OneSignalLocation + - OneSignalXCFramework/OneSignalCore (5.2.0) + - OneSignalXCFramework/OneSignalExtension (5.2.0): + - OneSignalXCFramework/OneSignalCore + - OneSignalXCFramework/OneSignalOutcomes + - OneSignalXCFramework/OneSignalInAppMessages (5.2.0): + - OneSignalXCFramework/OneSignalCore + - OneSignalXCFramework/OneSignalNotifications + - OneSignalXCFramework/OneSignalOSCore - OneSignalXCFramework/OneSignalOutcomes - - OneSignalXCFramework/OneSignalNotifications (5.0.0-beta-01): + - OneSignalXCFramework/OneSignalUser + - OneSignalXCFramework/OneSignalLiveActivities (5.2.0): + - OneSignalXCFramework/OneSignalCore + - OneSignalXCFramework/OneSignalOSCore + - OneSignalXCFramework/OneSignalUser + - OneSignalXCFramework/OneSignalLocation (5.2.0): + - OneSignalXCFramework/OneSignalCore + - OneSignalXCFramework/OneSignalNotifications + - OneSignalXCFramework/OneSignalOSCore + - OneSignalXCFramework/OneSignalUser + - OneSignalXCFramework/OneSignalNotifications (5.2.0): - OneSignalXCFramework/OneSignalCore - OneSignalXCFramework/OneSignalExtension - OneSignalXCFramework/OneSignalOutcomes - - OneSignalXCFramework/OneSignalOSCore (5.0.0-beta-01): + - OneSignalXCFramework/OneSignalOSCore (5.2.0): - OneSignalXCFramework/OneSignalCore - - OneSignalXCFramework/OneSignalOutcomes (5.0.0-beta-01): + - OneSignalXCFramework/OneSignalOutcomes (5.2.0): - OneSignalXCFramework/OneSignalCore - - OneSignalXCFramework/OneSignalUser (5.0.0-beta-01): + - OneSignalXCFramework/OneSignalUser (5.2.0): - OneSignalXCFramework/OneSignalCore - OneSignalXCFramework/OneSignalNotifications - OneSignalXCFramework/OneSignalOSCore @@ -227,8 +249,8 @@ PODS: - React-jsi (= 0.64.4) - React-perflogger (= 0.64.4) - React-jsinspector (0.64.4) - - react-native-onesignal (4.5.0): - - OneSignalXCFramework (= 5.0.0-beta-01) + - react-native-onesignal (5.1.2): + - OneSignalXCFramework (= 5.2.0) - React (< 1.0.0, >= 0.13.0) - React-perflogger (0.64.4) - React-RCTActionSheet (0.64.4): @@ -301,6 +323,7 @@ DEPENDENCIES: - FBLazyVector (from `../node_modules/react-native/Libraries/FBLazyVector`) - FBReactNativeSpec (from `../node_modules/react-native/React/FBReactNativeSpec`) - glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`) + - OneSignalXCFramework (< 6.0.0, >= 5.0.2) - RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`) - RCTRequired (from `../node_modules/react-native/Libraries/RCTRequired`) - RCTTypeSafety (from `../node_modules/react-native/Libraries/TypeSafety`) @@ -398,9 +421,9 @@ SPEC CHECKSUMS: boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c DoubleConversion: cf9b38bf0b2d048436d9a82ad2abe1404f11e7de FBLazyVector: fa8275d5086566e22a26ddc385ab5772e7f9b1bd - FBReactNativeSpec: 799cb1402acc2a3e73cb23b36dae1513cd34e35d + FBReactNativeSpec: 342841ad3cdf88a10071a3507d3708b236cee677 glog: 73c2498ac6884b13ede40eda8228cb1eee9d9d62 - OneSignalXCFramework: 7d3eb90c3e78908b0d72aa88600bfdab694460ec + OneSignalXCFramework: bdf74fdc06888f9466dc21e826fe1549ed143095 RCT-Folly: ec7a233ccc97cc556cf7237f0db1ff65b986f27c RCTRequired: f85fa00af016059cf88b90b8f8ff9a6af9e4b6c3 RCTTypeSafety: 5279aaf0fb1ad715cbbbbee32d5c98c72598bc9c @@ -412,7 +435,7 @@ SPEC CHECKSUMS: React-jsi: 64f80675a66899bf0f4a58b8e3908966fa516234 React-jsiexecutor: 8c077bef1c64430b6034f27df1000d194551e2eb React-jsinspector: d4f6973dd474357dbaaf6f52f31ffc713bf3e766 - react-native-onesignal: 039457cc04ef4e56c30069c4f3a1f3e893986abf + react-native-onesignal: be215738778e57af4c6da177d548e7983052d3fd React-perflogger: 5a890ca0911669421b7611661e9b58f91c805f5c React-RCTActionSheet: bd180e0879f8424a73650c5c28fbef4f3b5b27fb React-RCTAnimation: 1004d2b4be1f2cedfdc4cb2326adc95b989e6c6b @@ -427,6 +450,6 @@ SPEC CHECKSUMS: ReactCommon: b4a65d2d6e9eeffd4b32dde1245962b3f43907d0 Yoga: d1fc3575b8b68891ff5ef3c276daa855e841eb32 -PODFILE CHECKSUM: f9cd8e12615dff6738f284cf82df8cb563bf51cf +PODFILE CHECKSUM: f48dbc25fab0526ba40a2fa6aadce3376f5c6602 -COCOAPODS: 1.11.3 +COCOAPODS: 1.15.2 diff --git a/examples/RNOneSignalTS/ios/RNOneSignalTS.xcodeproj/project.pbxproj b/examples/RNOneSignalTS/ios/RNOneSignalTS.xcodeproj/project.pbxproj index 4ce04e86..3112eb92 100644 --- a/examples/RNOneSignalTS/ios/RNOneSignalTS.xcodeproj/project.pbxproj +++ b/examples/RNOneSignalTS/ios/RNOneSignalTS.xcodeproj/project.pbxproj @@ -11,11 +11,18 @@ 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; }; 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; + 253695C4E9A699005F42621D /* libPods-RNOneSignalWidgetExtension.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 61034C424A27BFA51ECE7842 /* libPods-RNOneSignalWidgetExtension.a */; }; 29BEA1DBD99B294F68C30F74 /* libPods-RNOneSignalTS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A9C6834BD4C5D01D66A88E4 /* libPods-RNOneSignalTS.a */; }; 2D02E4BC1E0B4A80006451C7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; }; 2D02E4BD1E0B4A84006451C7 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 2D02E4BF1E0B4AB3006451C7 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; 2DCD954D1E0B4F2C00145EB5 /* RNOneSignalTSTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* RNOneSignalTSTests.m */; }; + 47D8EDE32BDC200D00C1DFB8 /* WidgetKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 47D8EDE22BDC200D00C1DFB8 /* WidgetKit.framework */; }; + 47D8EDE52BDC200D00C1DFB8 /* SwiftUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 47D8EDE42BDC200D00C1DFB8 /* SwiftUI.framework */; }; + 47D8EDE82BDC200D00C1DFB8 /* RNOneSignalWidgetBundle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47D8EDE72BDC200D00C1DFB8 /* RNOneSignalWidgetBundle.swift */; }; + 47D8EDEA2BDC200D00C1DFB8 /* RNOneSignalWidgetLiveActivity.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47D8EDE92BDC200D00C1DFB8 /* RNOneSignalWidgetLiveActivity.swift */; }; + 47D8EDEE2BDC200E00C1DFB8 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 47D8EDED2BDC200E00C1DFB8 /* Assets.xcassets */; }; + 47D8EDF22BDC200E00C1DFB8 /* RNOneSignalWidgetExtension.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = 47D8EDE12BDC200D00C1DFB8 /* RNOneSignalWidgetExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; 498F06C29F943469E4545E09 /* libPods-RNOneSignalTS-RNOneSignalTSTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B0F4647666F7BF086F879F61 /* libPods-RNOneSignalTS-RNOneSignalTSTests.a */; }; 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; }; E59362D331330C433770475D /* libPods-RNOneSignalTS-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 731F649974B0D3A78561EBEB /* libPods-RNOneSignalTS-tvOS.a */; }; @@ -37,10 +44,32 @@ remoteGlobalIDString = 2D02E47A1E0B4A5D006451C7; remoteInfo = "RNOneSignalTS-tvOS"; }; + 47D8EDF02BDC200E00C1DFB8 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 47D8EDE02BDC200D00C1DFB8; + remoteInfo = RNOneSignalWidgetExtension; + }; /* End PBXContainerItemProxy section */ +/* Begin PBXCopyFilesBuildPhase section */ + 47D8EDF32BDC200E00C1DFB8 /* Embed Foundation Extensions */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 13; + files = ( + 47D8EDF22BDC200E00C1DFB8 /* RNOneSignalWidgetExtension.appex in Embed Foundation Extensions */, + ); + name = "Embed Foundation Extensions"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + /* Begin PBXFileReference section */ 008F07F21AC5B25A0029DE68 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = main.jsbundle; sourceTree = ""; }; + 00BDEDC593673D3A90947A63 /* Pods-RNOneSignalWidgetExtension.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNOneSignalWidgetExtension.debug.xcconfig"; path = "Target Support Files/Pods-RNOneSignalWidgetExtension/Pods-RNOneSignalWidgetExtension.debug.xcconfig"; sourceTree = ""; }; 00E356EE1AD99517003FC87E /* RNOneSignalTSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RNOneSignalTSTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 00E356F21AD99517003FC87E /* RNOneSignalTSTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNOneSignalTSTests.m; sourceTree = ""; }; @@ -55,9 +84,19 @@ 2D02E47B1E0B4A5D006451C7 /* RNOneSignalTS-tvOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "RNOneSignalTS-tvOS.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 2D02E4901E0B4A5D006451C7 /* RNOneSignalTS-tvOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "RNOneSignalTS-tvOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 36D4E6F2A4B2D0FD6204CDC5 /* Pods-RNOneSignalTS-tvOSTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNOneSignalTS-tvOSTests.debug.xcconfig"; path = "Target Support Files/Pods-RNOneSignalTS-tvOSTests/Pods-RNOneSignalTS-tvOSTests.debug.xcconfig"; sourceTree = ""; }; + 47D8EDE12BDC200D00C1DFB8 /* RNOneSignalWidgetExtension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = RNOneSignalWidgetExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; }; + 47D8EDE22BDC200D00C1DFB8 /* WidgetKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WidgetKit.framework; path = System/Library/Frameworks/WidgetKit.framework; sourceTree = SDKROOT; }; + 47D8EDE42BDC200D00C1DFB8 /* SwiftUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SwiftUI.framework; path = System/Library/Frameworks/SwiftUI.framework; sourceTree = SDKROOT; }; + 47D8EDE72BDC200D00C1DFB8 /* RNOneSignalWidgetBundle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RNOneSignalWidgetBundle.swift; sourceTree = ""; }; + 47D8EDE92BDC200D00C1DFB8 /* RNOneSignalWidgetLiveActivity.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RNOneSignalWidgetLiveActivity.swift; sourceTree = ""; }; + 47D8EDED2BDC200E00C1DFB8 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 47D8EDEF2BDC200E00C1DFB8 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 47D8EDF72BDC206D00C1DFB8 /* OneSignalLiveActivities.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = OneSignalLiveActivities.xcframework; path = "../../../../onesignal-ios-sdk/iOS_SDK/OneSignalSDK/OneSignal_LiveActivities/OneSignalLiveActivities.xcframework"; sourceTree = ""; }; 4D0B08EF16DFB3514375DEA2 /* Pods-RNOneSignalTS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNOneSignalTS.release.xcconfig"; path = "Target Support Files/Pods-RNOneSignalTS/Pods-RNOneSignalTS.release.xcconfig"; sourceTree = ""; }; 5B888D71258AA3AB00DE2069 /* RNOneSignalTS.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; name = RNOneSignalTS.entitlements; path = RNOneSignalTS/RNOneSignalTS.entitlements; sourceTree = ""; }; 5E39C0CF1D4B9C731BDF0E2B /* Pods-RNOneSignalTS-tvOS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNOneSignalTS-tvOS.release.xcconfig"; path = "Target Support Files/Pods-RNOneSignalTS-tvOS/Pods-RNOneSignalTS-tvOS.release.xcconfig"; sourceTree = ""; }; + 61034C424A27BFA51ECE7842 /* libPods-RNOneSignalWidgetExtension.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RNOneSignalWidgetExtension.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + 71DAE3F4B0D815B08FEFC968 /* Pods-RNOneSignalWidgetExtension.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNOneSignalWidgetExtension.release.xcconfig"; path = "Target Support Files/Pods-RNOneSignalWidgetExtension/Pods-RNOneSignalWidgetExtension.release.xcconfig"; sourceTree = ""; }; 731F649974B0D3A78561EBEB /* libPods-RNOneSignalTS-tvOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RNOneSignalTS-tvOS.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = RNOneSignalTS/LaunchScreen.storyboard; sourceTree = ""; }; 87C7E919B1029F3FE8F8EFD4 /* libPods-RNOneSignalTS-tvOSTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RNOneSignalTS-tvOSTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -103,6 +142,16 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 47D8EDDE2BDC200D00C1DFB8 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 47D8EDE52BDC200D00C1DFB8 /* SwiftUI.framework in Frameworks */, + 47D8EDE32BDC200D00C1DFB8 /* WidgetKit.framework in Frameworks */, + 253695C4E9A699005F42621D /* libPods-RNOneSignalWidgetExtension.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ @@ -141,16 +190,31 @@ 2D16E6871FA4F8E400B85C8A /* Frameworks */ = { isa = PBXGroup; children = ( + 47D8EDF72BDC206D00C1DFB8 /* OneSignalLiveActivities.xcframework */, ED297162215061F000B7C4FE /* JavaScriptCore.framework */, ED2971642150620600B7C4FE /* JavaScriptCore.framework */, 0A9C6834BD4C5D01D66A88E4 /* libPods-RNOneSignalTS.a */, B0F4647666F7BF086F879F61 /* libPods-RNOneSignalTS-RNOneSignalTSTests.a */, 731F649974B0D3A78561EBEB /* libPods-RNOneSignalTS-tvOS.a */, 87C7E919B1029F3FE8F8EFD4 /* libPods-RNOneSignalTS-tvOSTests.a */, + 47D8EDE22BDC200D00C1DFB8 /* WidgetKit.framework */, + 47D8EDE42BDC200D00C1DFB8 /* SwiftUI.framework */, + 61034C424A27BFA51ECE7842 /* libPods-RNOneSignalWidgetExtension.a */, ); name = Frameworks; sourceTree = ""; }; + 47D8EDE62BDC200D00C1DFB8 /* RNOneSignalWidget */ = { + isa = PBXGroup; + children = ( + 47D8EDE72BDC200D00C1DFB8 /* RNOneSignalWidgetBundle.swift */, + 47D8EDE92BDC200D00C1DFB8 /* RNOneSignalWidgetLiveActivity.swift */, + 47D8EDED2BDC200E00C1DFB8 /* Assets.xcassets */, + 47D8EDEF2BDC200E00C1DFB8 /* Info.plist */, + ); + path = RNOneSignalWidget; + sourceTree = ""; + }; 832341AE1AAA6A7D00B99B32 /* Libraries */ = { isa = PBXGroup; children = ( @@ -164,6 +228,7 @@ 13B07FAE1A68108700A75B9A /* RNOneSignalTS */, 832341AE1AAA6A7D00B99B32 /* Libraries */, 00E356EF1AD99517003FC87E /* RNOneSignalTSTests */, + 47D8EDE62BDC200D00C1DFB8 /* RNOneSignalWidget */, 83CBBA001A601CBA00E9B192 /* Products */, 2D16E6871FA4F8E400B85C8A /* Frameworks */, 8FFF12E89EE080FB55269932 /* Pods */, @@ -180,6 +245,7 @@ 00E356EE1AD99517003FC87E /* RNOneSignalTSTests.xctest */, 2D02E47B1E0B4A5D006451C7 /* RNOneSignalTS-tvOS.app */, 2D02E4901E0B4A5D006451C7 /* RNOneSignalTS-tvOSTests.xctest */, + 47D8EDE12BDC200D00C1DFB8 /* RNOneSignalWidgetExtension.appex */, ); name = Products; sourceTree = ""; @@ -195,6 +261,8 @@ 5E39C0CF1D4B9C731BDF0E2B /* Pods-RNOneSignalTS-tvOS.release.xcconfig */, 36D4E6F2A4B2D0FD6204CDC5 /* Pods-RNOneSignalTS-tvOSTests.debug.xcconfig */, 885D3FE2ACBD052AC8EF22FC /* Pods-RNOneSignalTS-tvOSTests.release.xcconfig */, + 00BDEDC593673D3A90947A63 /* Pods-RNOneSignalWidgetExtension.debug.xcconfig */, + 71DAE3F4B0D815B08FEFC968 /* Pods-RNOneSignalWidgetExtension.release.xcconfig */, ); path = Pods; sourceTree = ""; @@ -235,10 +303,12 @@ 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, 258A29E138A5D5C56B8AB2B5 /* [CP] Copy Pods Resources */, BF08836FBCCF6DF73FFD31DC /* [CP] Embed Pods Frameworks */, + 47D8EDF32BDC200E00C1DFB8 /* Embed Foundation Extensions */, ); buildRules = ( ); dependencies = ( + 47D8EDF12BDC200E00C1DFB8 /* PBXTargetDependency */, ); name = RNOneSignalTS; productName = RNOneSignalTS; @@ -284,12 +354,31 @@ productReference = 2D02E4901E0B4A5D006451C7 /* RNOneSignalTS-tvOSTests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; + 47D8EDE02BDC200D00C1DFB8 /* RNOneSignalWidgetExtension */ = { + isa = PBXNativeTarget; + buildConfigurationList = 47D8EDF62BDC200E00C1DFB8 /* Build configuration list for PBXNativeTarget "RNOneSignalWidgetExtension" */; + buildPhases = ( + 800906FA7CF5F140E441461B /* [CP] Check Pods Manifest.lock */, + 47D8EDDD2BDC200D00C1DFB8 /* Sources */, + 47D8EDDE2BDC200D00C1DFB8 /* Frameworks */, + 47D8EDDF2BDC200D00C1DFB8 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = RNOneSignalWidgetExtension; + productName = RNOneSignalWidgetExtension; + productReference = 47D8EDE12BDC200D00C1DFB8 /* RNOneSignalWidgetExtension.appex */; + productType = "com.apple.product-type.app-extension"; + }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ 83CBB9F71A601CBA00E9B192 /* Project object */ = { isa = PBXProject; attributes = { + LastSwiftUpdateCheck = 1530; LastUpgradeCheck = 1130; TargetAttributes = { 00E356ED1AD99517003FC87E = { @@ -312,6 +401,11 @@ ProvisioningStyle = Automatic; TestTargetID = 2D02E47A1E0B4A5D006451C7; }; + 47D8EDE02BDC200D00C1DFB8 = { + CreatedOnToolsVersion = 15.3; + DevelopmentTeam = 99SW8E36CT; + ProvisioningStyle = Automatic; + }; }; }; buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "RNOneSignalTS" */; @@ -331,6 +425,7 @@ 00E356ED1AD99517003FC87E /* RNOneSignalTSTests */, 2D02E47A1E0B4A5D006451C7 /* RNOneSignalTS-tvOS */, 2D02E48F1E0B4A5D006451C7 /* RNOneSignalTS-tvOSTests */, + 47D8EDE02BDC200D00C1DFB8 /* RNOneSignalWidgetExtension */, ); }; /* End PBXProject section */ @@ -367,6 +462,14 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 47D8EDDF2BDC200D00C1DFB8 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 47D8EDEE2BDC200E00C1DFB8 /* Assets.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ @@ -467,9 +570,12 @@ ); inputPaths = ( "${PODS_ROOT}/Target Support Files/Pods-RNOneSignalTS-RNOneSignalTSTests/Pods-RNOneSignalTS-RNOneSignalTSTests-frameworks.sh", - "${PODS_XCFRAMEWORKS_BUILD_DIR}/OneSignalXCFramework/OneSignalFramework.framework/OneSignalFramework", + "${PODS_XCFRAMEWORKS_BUILD_DIR}/OneSignalXCFramework/OneSignal/OneSignalFramework.framework/OneSignalFramework", "${PODS_XCFRAMEWORKS_BUILD_DIR}/OneSignalXCFramework/OneSignalCore/OneSignalCore.framework/OneSignalCore", "${PODS_XCFRAMEWORKS_BUILD_DIR}/OneSignalXCFramework/OneSignalExtension/OneSignalExtension.framework/OneSignalExtension", + "${PODS_XCFRAMEWORKS_BUILD_DIR}/OneSignalXCFramework/OneSignalInAppMessages/OneSignalInAppMessages.framework/OneSignalInAppMessages", + "${PODS_XCFRAMEWORKS_BUILD_DIR}/OneSignalXCFramework/OneSignalLiveActivities/OneSignalLiveActivities.framework/OneSignalLiveActivities", + "${PODS_XCFRAMEWORKS_BUILD_DIR}/OneSignalXCFramework/OneSignalLocation/OneSignalLocation.framework/OneSignalLocation", "${PODS_XCFRAMEWORKS_BUILD_DIR}/OneSignalXCFramework/OneSignalNotifications/OneSignalNotifications.framework/OneSignalNotifications", "${PODS_XCFRAMEWORKS_BUILD_DIR}/OneSignalXCFramework/OneSignalOSCore/OneSignalOSCore.framework/OneSignalOSCore", "${PODS_XCFRAMEWORKS_BUILD_DIR}/OneSignalXCFramework/OneSignalOutcomes/OneSignalOutcomes.framework/OneSignalOutcomes", @@ -480,6 +586,9 @@ "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/OneSignalFramework.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/OneSignalCore.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/OneSignalExtension.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/OneSignalInAppMessages.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/OneSignalLiveActivities.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/OneSignalLocation.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/OneSignalNotifications.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/OneSignalOSCore.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/OneSignalOutcomes.framework", @@ -534,6 +643,28 @@ shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; + 800906FA7CF5F140E441461B /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-RNOneSignalWidgetExtension-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; 985973970AD5AD54BC615F13 /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -559,9 +690,12 @@ ); inputPaths = ( "${PODS_ROOT}/Target Support Files/Pods-RNOneSignalTS/Pods-RNOneSignalTS-frameworks.sh", - "${PODS_XCFRAMEWORKS_BUILD_DIR}/OneSignalXCFramework/OneSignalFramework.framework/OneSignalFramework", + "${PODS_XCFRAMEWORKS_BUILD_DIR}/OneSignalXCFramework/OneSignal/OneSignalFramework.framework/OneSignalFramework", "${PODS_XCFRAMEWORKS_BUILD_DIR}/OneSignalXCFramework/OneSignalCore/OneSignalCore.framework/OneSignalCore", "${PODS_XCFRAMEWORKS_BUILD_DIR}/OneSignalXCFramework/OneSignalExtension/OneSignalExtension.framework/OneSignalExtension", + "${PODS_XCFRAMEWORKS_BUILD_DIR}/OneSignalXCFramework/OneSignalInAppMessages/OneSignalInAppMessages.framework/OneSignalInAppMessages", + "${PODS_XCFRAMEWORKS_BUILD_DIR}/OneSignalXCFramework/OneSignalLiveActivities/OneSignalLiveActivities.framework/OneSignalLiveActivities", + "${PODS_XCFRAMEWORKS_BUILD_DIR}/OneSignalXCFramework/OneSignalLocation/OneSignalLocation.framework/OneSignalLocation", "${PODS_XCFRAMEWORKS_BUILD_DIR}/OneSignalXCFramework/OneSignalNotifications/OneSignalNotifications.framework/OneSignalNotifications", "${PODS_XCFRAMEWORKS_BUILD_DIR}/OneSignalXCFramework/OneSignalOSCore/OneSignalOSCore.framework/OneSignalOSCore", "${PODS_XCFRAMEWORKS_BUILD_DIR}/OneSignalXCFramework/OneSignalOutcomes/OneSignalOutcomes.framework/OneSignalOutcomes", @@ -572,6 +706,9 @@ "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/OneSignalFramework.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/OneSignalCore.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/OneSignalExtension.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/OneSignalInAppMessages.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/OneSignalLiveActivities.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/OneSignalLocation.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/OneSignalNotifications.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/OneSignalOSCore.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/OneSignalOutcomes.framework", @@ -657,6 +794,15 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 47D8EDDD2BDC200D00C1DFB8 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 47D8EDE82BDC200D00C1DFB8 /* RNOneSignalWidgetBundle.swift in Sources */, + 47D8EDEA2BDC200D00C1DFB8 /* RNOneSignalWidgetLiveActivity.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ @@ -670,6 +816,11 @@ target = 2D02E47A1E0B4A5D006451C7 /* RNOneSignalTS-tvOS */; targetProxy = 2D02E4911E0B4A5D006451C7 /* PBXContainerItemProxy */; }; + 47D8EDF12BDC200E00C1DFB8 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 47D8EDE02BDC200D00C1DFB8 /* RNOneSignalWidgetExtension */; + targetProxy = 47D8EDF02BDC200E00C1DFB8 /* PBXContainerItemProxy */; + }; /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ @@ -722,6 +873,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 0A7DFFDE8B0834B951B8FAB1 /* Pods-RNOneSignalTS.debug.xcconfig */; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = RNOneSignalTS/RNOneSignalTS.entitlements; @@ -747,6 +899,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 4D0B08EF16DFB3514375DEA2 /* Pods-RNOneSignalTS.release.xcconfig */; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = RNOneSignalTS/RNOneSignalTS.entitlements; @@ -880,6 +1033,99 @@ }; name = Release; }; + 47D8EDF42BDC200E00C1DFB8 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 00BDEDC593673D3A90947A63 /* Pods-RNOneSignalWidgetExtension.debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + DEVELOPMENT_TEAM = 99SW8E36CT; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = RNOneSignalWidget/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = RNOneSignalWidget; + INFOPLIST_KEY_NSHumanReadableCopyright = ""; + IPHONEOS_DEPLOYMENT_TARGET = 17.4; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; + LIBRARY_SEARCH_PATHS = ( + "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"", + "\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.5/$(PLATFORM_NAME)\"", + "\"$(inherited)\"", + ); + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MARKETING_VERSION = 1.0; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + OTHER_LDFLAGS = ""; + PRODUCT_BUNDLE_IDENTIFIER = com.onesignal.example.RNOneSignalWidget; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 47D8EDF52BDC200E00C1DFB8 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 71DAE3F4B0D815B08FEFC968 /* Pods-RNOneSignalWidgetExtension.release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_STYLE = Automatic; + COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEVELOPMENT_TEAM = 99SW8E36CT; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = RNOneSignalWidget/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = RNOneSignalWidget; + INFOPLIST_KEY_NSHumanReadableCopyright = ""; + IPHONEOS_DEPLOYMENT_TARGET = 17.4; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; + LIBRARY_SEARCH_PATHS = ( + "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"", + "\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.5/$(PLATFORM_NAME)\"", + "\"$(inherited)\"", + ); + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MARKETING_VERSION = 1.0; + MTL_FAST_MATH = YES; + OTHER_LDFLAGS = ""; + PRODUCT_BUNDLE_IDENTIFIER = com.onesignal.example.RNOneSignalWidget; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; 83CBBA201A601CBA00E9B192 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -1032,6 +1278,15 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + 47D8EDF62BDC200E00C1DFB8 /* Build configuration list for PBXNativeTarget "RNOneSignalWidgetExtension" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 47D8EDF42BDC200E00C1DFB8 /* Debug */, + 47D8EDF52BDC200E00C1DFB8 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "RNOneSignalTS" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/examples/RNOneSignalTS/ios/RNOneSignalTS/Info.plist b/examples/RNOneSignalTS/ios/RNOneSignalTS/Info.plist index 900cddea..7a74d71c 100644 --- a/examples/RNOneSignalTS/ios/RNOneSignalTS/Info.plist +++ b/examples/RNOneSignalTS/ios/RNOneSignalTS/Info.plist @@ -45,6 +45,8 @@ Your message goes here NSLocationWhenInUseUsageDescription Your message goes here + NSSupportsLiveActivities + UIBackgroundModes remote-notification diff --git a/examples/RNOneSignalTS/ios/RNOneSignalWidget/Assets.xcassets/AccentColor.colorset/Contents.json b/examples/RNOneSignalTS/ios/RNOneSignalWidget/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 00000000..eb878970 --- /dev/null +++ b/examples/RNOneSignalTS/ios/RNOneSignalWidget/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/examples/RNOneSignalTS/ios/RNOneSignalWidget/Assets.xcassets/AppIcon.appiconset/Contents.json b/examples/RNOneSignalTS/ios/RNOneSignalWidget/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..13613e3e --- /dev/null +++ b/examples/RNOneSignalTS/ios/RNOneSignalWidget/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,13 @@ +{ + "images" : [ + { + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/examples/RNOneSignalTS/ios/RNOneSignalWidget/Assets.xcassets/Contents.json b/examples/RNOneSignalTS/ios/RNOneSignalWidget/Assets.xcassets/Contents.json new file mode 100644 index 00000000..73c00596 --- /dev/null +++ b/examples/RNOneSignalTS/ios/RNOneSignalWidget/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/examples/RNOneSignalTS/ios/RNOneSignalWidget/Assets.xcassets/WidgetBackground.colorset/Contents.json b/examples/RNOneSignalTS/ios/RNOneSignalWidget/Assets.xcassets/WidgetBackground.colorset/Contents.json new file mode 100644 index 00000000..eb878970 --- /dev/null +++ b/examples/RNOneSignalTS/ios/RNOneSignalWidget/Assets.xcassets/WidgetBackground.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/examples/RNOneSignalTS/ios/RNOneSignalWidget/Assets.xcassets/onesignaldemo.imageset/Contents.json b/examples/RNOneSignalTS/ios/RNOneSignalWidget/Assets.xcassets/onesignaldemo.imageset/Contents.json new file mode 100644 index 00000000..0eddeb7c --- /dev/null +++ b/examples/RNOneSignalTS/ios/RNOneSignalWidget/Assets.xcassets/onesignaldemo.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "onesignal-logo.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/examples/RNOneSignalTS/ios/RNOneSignalWidget/Assets.xcassets/onesignaldemo.imageset/onesignal-logo.png b/examples/RNOneSignalTS/ios/RNOneSignalWidget/Assets.xcassets/onesignaldemo.imageset/onesignal-logo.png new file mode 100644 index 00000000..ba97c7a7 Binary files /dev/null and b/examples/RNOneSignalTS/ios/RNOneSignalWidget/Assets.xcassets/onesignaldemo.imageset/onesignal-logo.png differ diff --git a/examples/RNOneSignalTS/ios/RNOneSignalWidget/Info.plist b/examples/RNOneSignalTS/ios/RNOneSignalWidget/Info.plist new file mode 100644 index 00000000..0f118fb7 --- /dev/null +++ b/examples/RNOneSignalTS/ios/RNOneSignalWidget/Info.plist @@ -0,0 +1,11 @@ + + + + + NSExtension + + NSExtensionPointIdentifier + com.apple.widgetkit-extension + + + diff --git a/examples/RNOneSignalTS/ios/RNOneSignalWidget/RNOneSignalWidgetBundle.swift b/examples/RNOneSignalTS/ios/RNOneSignalWidget/RNOneSignalWidgetBundle.swift new file mode 100644 index 00000000..ce557273 --- /dev/null +++ b/examples/RNOneSignalTS/ios/RNOneSignalWidget/RNOneSignalWidgetBundle.swift @@ -0,0 +1,16 @@ +// +// RNOneSignalWidgetBundle.swift +// RNOneSignalWidget +// +// Created by Brian Smith on 4/26/24. +// + +import WidgetKit +import SwiftUI + +@main +struct RNOneSignalWidgetBundle: WidgetBundle { + var body: some Widget { + RNOneSignalWidgetLiveActivity() + } +} diff --git a/examples/RNOneSignalTS/ios/RNOneSignalWidget/RNOneSignalWidgetLiveActivity.swift b/examples/RNOneSignalTS/ios/RNOneSignalWidget/RNOneSignalWidgetLiveActivity.swift new file mode 100644 index 00000000..9910d4d3 --- /dev/null +++ b/examples/RNOneSignalTS/ios/RNOneSignalWidget/RNOneSignalWidgetLiveActivity.swift @@ -0,0 +1,65 @@ +// +// RNOneSignalWidgetLiveActivity.swift +// RNOneSignalWidget +// +// Created by Brian Smith on 4/26/24. +// + +import ActivityKit +import WidgetKit +import SwiftUI +import OneSignalLiveActivities + +struct RNOneSignalWidgetLiveActivity: Widget { + var body: some WidgetConfiguration { + ActivityConfiguration(for: DefaultLiveActivityAttributes.self) { context in + // Lock screen/banner UI goes here\VStack(alignment: .leading) { + VStack { + Spacer() + Text("REACT: " + (context.attributes.data["title"]?.asString() ?? "")).font(.headline) + Spacer() + HStack { + Spacer() + Label { + Text(context.state.data["message"]?.asDict()?["en"]?.asString() ?? "") + } icon: { + Image("onesignaldemo") + .resizable() + .scaledToFit() + .frame(width: 40.0, height: 40.0) + } + Spacer() + } + Text("INT: " + String(context.state.data["intValue"]?.asInt() ?? 0)) + Text("DBL: " + String(context.state.data["doubleValue"]?.asDouble() ?? 0.0)) + Text("BOL: " + String(context.state.data["boolValue"]?.asBool() ?? false)) + Spacer() + } + .activitySystemActionForegroundColor(.black) + .activityBackgroundTint(.white) + } dynamicIsland: { _ in + DynamicIsland { + // Expanded UI goes here. Compose the expanded UI through + // various regions, like leading/trailing/center/bottom + DynamicIslandExpandedRegion(.leading) { + Text("Leading") + } + DynamicIslandExpandedRegion(.trailing) { + Text("Trailing") + } + DynamicIslandExpandedRegion(.bottom) { + Text("Bottom") + // more content + } + } compactLeading: { + Text("L") + } compactTrailing: { + Text("T") + } minimal: { + Text("Min") + } + .widgetURL(URL(string: "http://www.apple.com")) + .keylineTint(Color.red) + } + } +} diff --git a/examples/RNOneSignalTS/src/OSButtons.tsx b/examples/RNOneSignalTS/src/OSButtons.tsx index 5d6d3b48..da16d5bb 100644 --- a/examples/RNOneSignalTS/src/OSButtons.tsx +++ b/examples/RNOneSignalTS/src/OSButtons.tsx @@ -181,6 +181,79 @@ class OSButtons extends React.Component { ]; } + createLiveActivitiesFields() { + const {loggingFunction} = this.props; + + const startDefaultLiveActivity = renderButtonView( + 'Start Default Live Activity', + async () => { + loggingFunction('Starting live activity'); + await OneSignal.LiveActivities.startDefault( + this.props.inputFieldValue, + {title: 'Welcome!'}, + { + message: {en: 'Hello World!'}, + intValue: 3, + doubleValue: 3.14, + boolValue: true, + }, + ); + loggingFunction('Live Activity started'); + }, + ); + + // In a real app the below methods would call a bridge to perform a live + // activity function, the data then passed back to RN, and subsequently + // passed over to the OneSignal SDK. + const enterLiveActivity = renderButtonView( + 'Enter Live Activity', + async () => { + loggingFunction('Entering live activity'); + await OneSignal.LiveActivities.enter( + this.props.inputFieldValue, + 'FAKE_TOKEN', + ); + }, + ); + + const exitLiveActivity = renderButtonView( + 'Exit Live Activity', + async () => { + loggingFunction('Exiting live activity'); + await OneSignal.LiveActivities.exit(this.props.inputFieldValue); + }, + ); + + const setPushToStartLiveActivity = renderButtonView( + 'Set Push-To-Start Live Activity', + async () => { + loggingFunction('Set pushToStart token'); + await OneSignal.LiveActivities.setPushToStartToken( + this.props.inputFieldValue, + 'FAKE_TOKEN', + ); + }, + ); + + const removePushToStartLiveActivity = renderButtonView( + 'Remove Push-To-Start Live Activity', + async () => { + loggingFunction('Remove pushToStart token'); + await OneSignal.LiveActivities.removePushToStartToken( + this.props.inputFieldValue, + ); + }, + ); + + return [ + startDefaultLiveActivity, + enterLiveActivity, + exitLiveActivity, + setPushToStartLiveActivity, + removePushToStartLiveActivity, + ]; + } + createSessionFields() { const {loggingFunction} = this.props; @@ -484,6 +557,10 @@ class OSButtons extends React.Component { {this.createNotificationFields()} + Live Activities + + {this.createLiveActivitiesFields()} + Session diff --git a/examples/RNOneSignalTS/src/OSDemo.tsx b/examples/RNOneSignalTS/src/OSDemo.tsx index 94f2dbf1..b6a330b6 100644 --- a/examples/RNOneSignalTS/src/OSDemo.tsx +++ b/examples/RNOneSignalTS/src/OSDemo.tsx @@ -33,6 +33,12 @@ class OSDemo extends React.Component { OneSignal.initialize(APP_ID); OneSignal.Debug.setLogLevel(LogLevel.Verbose); + OneSignal.LiveActivities.setupDefault(); + // OneSignal.LiveActivities.setupDefault({ + // enablePushToStart: false, + // enablePushToUpdate: true, + // }); + OneSignal.Notifications.addEventListener( 'foregroundWillDisplay', (event) => { diff --git a/ios/RCTOneSignal/RCTOneSignalEventEmitter.m b/ios/RCTOneSignal/RCTOneSignalEventEmitter.m index 152c91e8..4221cea4 100644 --- a/ios/RCTOneSignal/RCTOneSignalEventEmitter.m +++ b/ios/RCTOneSignal/RCTOneSignalEventEmitter.m @@ -1,5 +1,6 @@ #import "RCTOneSignalEventEmitter.h" #import +#import "OneSignalLiveActivities/OneSignalLiveActivities-Swift.h" #import "RCTOneSignal.h" #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdeprecated-declarations" @@ -130,6 +131,60 @@ + (void)sendEventWithName:(NSString *)name withBody:(NSDictionary *)body { }]; } +RCT_EXPORT_METHOD(setPushToStartToken:(NSString *)activityType + withToken:(NSString *)token) { + NSError* err=nil; + + if (@available(iOS 17.2, *)) { + [OneSignalLiveActivitiesManagerImpl setPushToStartToken:activityType withToken:token error:&err]; + if (err) { + [OneSignalLog onesignalLog:ONE_S_LL_ERROR message:[NSString stringWithFormat:@"activityType must be the name of your ActivityAttributes struct"]]; + } + } else { + [OneSignalLog onesignalLog:ONE_S_LL_ERROR message:[NSString stringWithFormat:@"cannot setPushToStartToken on iOS < 17.2"]]; + } +} + +RCT_EXPORT_METHOD(removePushToStartToken:(NSString *)activityType) { + NSError* err=nil; + + if (@available(iOS 17.2, *)) { + [OneSignalLiveActivitiesManagerImpl removePushToStartToken:activityType error:&err]; + if (err) { + [OneSignalLog onesignalLog:ONE_S_LL_ERROR message:[NSString stringWithFormat:@"activityType must be the name of your ActivityAttributes struct"]]; + } + } else { + [OneSignalLog onesignalLog:ONE_S_LL_ERROR message:[NSString stringWithFormat:@"cannot removePushToStartToken on iOS < 17.2"]]; + } +} + +RCT_EXPORT_METHOD(setupDefaultLiveActivity:(NSDictionary * _Nullable)options) { + LiveActivitySetupOptions *laOptions = nil; + + if (options != nil) { + laOptions = [LiveActivitySetupOptions alloc]; + [laOptions setEnablePushToStart:[options[@"enablePushToStart"] boolValue]]; + [laOptions setEnablePushToUpdate:[options[@"enablePushToUpdate"] boolValue]]; + } + + if (@available(iOS 16.1, *)) { + [OneSignalLiveActivitiesManagerImpl setupDefaultWithOptions:laOptions]; + } else { + [OneSignalLog onesignalLog:ONE_S_LL_ERROR message:[NSString stringWithFormat:@"cannot setupDefault on iOS < 16.1"]]; + } +} + +RCT_EXPORT_METHOD(startDefaultLiveActivity:(NSString *)activityId + withAttributes:(NSDictionary * _Nonnull)attributes + withContent:(NSDictionary * _Nonnull)content) { + + if (@available(iOS 16.1, *)) { + [OneSignalLiveActivitiesManagerImpl startDefault:activityId attributes:attributes content:content]; + } else { + [OneSignalLog onesignalLog:ONE_S_LL_ERROR message:[NSString stringWithFormat:@"cannot startDefault on iOS < 16.1"]]; + } +} + RCT_EXPORT_METHOD(setPrivacyConsentGiven:(BOOL)granted) { dispatch_async(dispatch_get_main_queue(), ^{ [OneSignal setConsentGiven:granted]; diff --git a/react-native-onesignal.podspec b/react-native-onesignal.podspec index 38937f3d..b14ce53b 100644 --- a/react-native-onesignal.podspec +++ b/react-native-onesignal.podspec @@ -22,5 +22,5 @@ Pod::Spec.new do |s| # pod 'React', :path => '../node_modules/react-native/' # The Native OneSignal-iOS-SDK XCFramework from cocoapods. - s.dependency 'OneSignalXCFramework', '5.1.6' + s.dependency 'OneSignalXCFramework', '5.2.0' end diff --git a/src/index.ts b/src/index.ts index aed685c6..426544a6 100644 --- a/src/index.ts +++ b/src/index.ts @@ -26,6 +26,7 @@ import { } from './models/Subscription'; import { UserState, UserChangedState } from './models/User'; import NotificationWillDisplayEvent from './events/NotificationWillDisplayEvent'; +import { LiveActivitySetupOptions } from './models/LiveActivities'; import { InAppMessage, InAppMessageEventTypeMap, @@ -156,8 +157,13 @@ export namespace OneSignal { export namespace LiveActivities { /** - * Associates a temporary push token with an Activity ID on the OneSignal server. - */ + * Indicate this device has exited a live activity, identified within OneSignal by the `activityId`. + * + * Only applies to iOS + * + * @param activityId: The activity identifier the live activity on this device will receive updates for. + * @param token: The activity's update token to receive the updates. + **/ export function enter( activityId: string, token: string, @@ -176,8 +182,12 @@ export namespace OneSignal { } /** - * Deletes activityId associated temporary push token on the OneSignal server. - */ + * Indicate this device has exited a live activity, identified within OneSignal by the `activityId`. + * + * Only applies to iOS + * + * @param activityId: The activity identifier the live activity on this device will no longer receive updates for. + **/ export function exit(activityId: string, handler?: Function) { if (!isNativeModuleLoaded(RNOneSignal)) return; @@ -185,11 +195,93 @@ export namespace OneSignal { handler = () => {}; } - // Only Available on iOS if (Platform.OS === 'ios') { RNOneSignal.exitLiveActivity(activityId, handler); } } + + /** + * Indicate this device is capable of receiving pushToStart live activities for the + * `activityType`. The `activityType` **must** be the name of the struct conforming + * to `ActivityAttributes` that will be used to start the live activity. + * + * Only applies to iOS + * + * @param activityType: The name of the specific `ActivityAttributes` structure tied + * to the live activity. + * @param token: The activity type's pushToStart token. + */ + export function setPushToStartToken(activityType: string, token: string) { + if (!isNativeModuleLoaded(RNOneSignal)) return; + + if (Platform.OS === 'ios') { + RNOneSignal.setPushToStartToken(activityType, token); + } + } + + /** + * Indicate this device is no longer capable of receiving pushToStart live activities + * for the `activityType`. The `activityType` **must** be the name of the struct conforming + * to `ActivityAttributes` that will be used to start the live activity. + * + * Only applies to iOS + * + * @param activityType: The name of the specific `ActivityAttributes` structure tied + * to the live activity. + */ + export function removePushToStartToken(activityType: string) { + if (!isNativeModuleLoaded(RNOneSignal)) return; + + if (Platform.OS === 'ios') { + RNOneSignal.removePushToStartToken(activityType); + } + } + + /** + * Enable the OneSignalSDK to setup the default`DefaultLiveActivityAttributes` structure, + * which conforms to the `OneSignalLiveActivityAttributes`. When using this function, the + * widget attributes are owned by the OneSignal SDK, which will allow the SDK to handle the + * entire lifecycle of the live activity. All that is needed from an app-perspective is to + * create a Live Activity widget in a widget extension, with a `ActivityConfiguration` for + * `DefaultLiveActivityAttributes`. This is most useful for users that (1) only have one Live + * Activity widget and (2) are using a cross-platform framework and do not want to create the + * cross-platform <-> iOS native bindings to manage ActivityKit. + * + * Only applies to iOS + * + * @param options: An optional structure to provide for more granular setup options. + */ + export function setupDefault(options?: LiveActivitySetupOptions) { + if (!isNativeModuleLoaded(RNOneSignal)) return; + + if (Platform.OS === 'ios') { + RNOneSignal.setupDefaultLiveActivity(options); + } + } + + /** + * Start a new LiveActivity that is modelled by the default`DefaultLiveActivityAttributes` + * structure. The `DefaultLiveActivityAttributes` is initialized with the dynamic `attributes` + * and `content` passed in. + * + * Only applies to iOS + * + * @param activityId: The activity identifier the live activity on this device will be started + * and eligible to receive updates for. + * @param attributes: A dynamic type containing the static attributes passed into `DefaultLiveActivityAttributes`. + * @param content: A dynamic type containing the content attributes passed into `DefaultLiveActivityAttributes`. + */ + export function startDefault( + activityId: string, + attributes: object, + content: object, + ) { + if (!isNativeModuleLoaded(RNOneSignal)) return; + + if (Platform.OS === 'ios') { + RNOneSignal.startDefaultLiveActivity(activityId, attributes, content); + } + } } export namespace User { diff --git a/src/models/LiveActivities.ts b/src/models/LiveActivities.ts new file mode 100644 index 00000000..191a94bb --- /dev/null +++ b/src/models/LiveActivities.ts @@ -0,0 +1,15 @@ +/** + * The setup options for `OneSignal.LiveActivities.setupDefault`. + */ +export type LiveActivitySetupOptions = { + /** + * When true, OneSignal will listen for pushToStart tokens for the `OneSignalLiveActivityAttributes` structure. + */ + enablePushToStart: boolean; + + /** + * When true, OneSignal will listen for pushToUpdate tokens for each start live activity that uses the + * `OneSignalLiveActivityAttributes` structure. + */ + enablePushToUpdate: boolean; +};