diff --git a/examples/RNOneSignalTS/OSConsole.tsx b/examples/RNOneSignalTS/OSConsole.tsx index 7c3794b8..fcebf5eb 100644 --- a/examples/RNOneSignalTS/OSConsole.tsx +++ b/examples/RNOneSignalTS/OSConsole.tsx @@ -9,14 +9,7 @@ */ import React, { useCallback, useRef } from 'react'; -import { - Platform, - SafeAreaView, - ScrollView, - StyleSheet, - Text, - View, -} from 'react-native'; +import { Platform, ScrollView, StyleSheet, Text, View } from 'react-native'; export interface Props { value: string; @@ -30,10 +23,11 @@ const OSConsole: React.FC = ({ value }) => { }, []); return ( - + @@ -47,19 +41,21 @@ const OSConsole: React.FC = ({ value }) => { - + ); }; const styles = StyleSheet.create({ scrollView: { + flex: 1, backgroundColor: '#f8f9fa', }, + scrollViewContent: { + flexGrow: 1, + }, body: { - backgroundColor: 'grey', + backgroundColor: '#f8f9fa', flex: 1, - flexGrow: 1, - flexDirection: 'row', }, console: { flexWrap: 'wrap', @@ -71,11 +67,13 @@ const styles = StyleSheet.create({ flex: 1, flexWrap: 'wrap', fontSize: 10, + color: '#000', }, textAndroid: { flex: 1, flexWrap: 'wrap', fontSize: 10, + color: '#000', }, }); diff --git a/examples/RNOneSignalTS/OSDemo.tsx b/examples/RNOneSignalTS/OSDemo.tsx index f9a39ff2..3b3813f5 100644 --- a/examples/RNOneSignalTS/OSDemo.tsx +++ b/examples/RNOneSignalTS/OSDemo.tsx @@ -2,15 +2,15 @@ import { useFocusEffect } from '@react-navigation/native'; import React, { useCallback, useEffect, useState } from 'react'; import { Alert, - SafeAreaView, ScrollView, StyleSheet, Text, TextInput, + TouchableOpacity, View, } from 'react-native'; import { LogLevel, OneSignal } from 'react-native-onesignal'; -import { renderButtonView } from './Helpers'; +import { SafeAreaView } from 'react-native-safe-area-context'; import OSButtons from './OSButtons'; import OSConsole from './OSConsole'; @@ -233,14 +233,19 @@ const OSDemo: React.FC = () => { }, []); return ( - + OneSignal - {renderButtonView('X', () => { - setConsoleValue(''); - })} + { + setConsoleValue(''); + }} + > + X + **Note**: Make sure you have completed the [Set Up Your Environment](https://reactnative.dev/docs/set-up-your-environment) guide before proceeding. diff --git a/examples/RNOneSignalTS/ios/OneSignalNotificationServiceExtension/Info.plist b/examples/RNOneSignalTS/ios/OneSignalNotificationServiceExtension/Info.plist new file mode 100644 index 00000000..f6cbf49d --- /dev/null +++ b/examples/RNOneSignalTS/ios/OneSignalNotificationServiceExtension/Info.plist @@ -0,0 +1,15 @@ + + + + + NSExtension + + NSExtensionPointIdentifier + com.apple.usernotifications.service + NSExtensionPrincipalClass + $(PRODUCT_MODULE_NAME).NotificationService + + RCTNewArchEnabled + + + diff --git a/examples/RNOneSignalTS/ios/OneSignalNotificationServiceExtension/NotificationService.swift b/examples/RNOneSignalTS/ios/OneSignalNotificationServiceExtension/NotificationService.swift new file mode 100644 index 00000000..ab391a33 --- /dev/null +++ b/examples/RNOneSignalTS/ios/OneSignalNotificationServiceExtension/NotificationService.swift @@ -0,0 +1,32 @@ +import UserNotifications +import OneSignalExtension + +class NotificationService: UNNotificationServiceExtension { + var contentHandler: ((UNNotificationContent) -> Void)? + var receivedRequest: UNNotificationRequest! + var bestAttemptContent: UNMutableNotificationContent? + + // Note this extension only runs when `mutable_content` is set + // Setting an attachment or action buttons automatically sets the property to true + override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) { + self.receivedRequest = request + self.contentHandler = contentHandler + self.bestAttemptContent = (request.content.mutableCopy() as? UNMutableNotificationContent) + + if let bestAttemptContent = bestAttemptContent { + // DEBUGGING: Uncomment the 2 lines below to check this extension is executing +// print("Running NotificationServiceExtension") +// bestAttemptContent.body = "[Modified] " + bestAttemptContent.body + + OneSignalExtension.didReceiveNotificationExtensionRequest(self.receivedRequest, with: bestAttemptContent, withContentHandler: self.contentHandler) + } + } + + override func serviceExtensionTimeWillExpire() { + // Use this as an opportunity to deliver your "best attempt" at modified content, otherwise the original push payload will be used. + if let contentHandler = contentHandler, let bestAttemptContent = bestAttemptContent { + OneSignalExtension.serviceExtensionTimeWillExpireRequest(self.receivedRequest, with: self.bestAttemptContent) + contentHandler(bestAttemptContent) + } + } +} diff --git a/examples/RNOneSignalTS/ios/OneSignalNotificationServiceExtension/OneSignalNotificationServiceExtension.entitlements b/examples/RNOneSignalTS/ios/OneSignalNotificationServiceExtension/OneSignalNotificationServiceExtension.entitlements new file mode 100644 index 00000000..c70461e8 --- /dev/null +++ b/examples/RNOneSignalTS/ios/OneSignalNotificationServiceExtension/OneSignalNotificationServiceExtension.entitlements @@ -0,0 +1,10 @@ + + + + + com.apple.security.application-groups + + group.com.onesignal.example.onesignal + + + diff --git a/examples/RNOneSignalTS/ios/Podfile b/examples/RNOneSignalTS/ios/Podfile index 38d51f94..5a798e5d 100644 --- a/examples/RNOneSignalTS/ios/Podfile +++ b/examples/RNOneSignalTS/ios/Podfile @@ -33,3 +33,7 @@ target 'RNOneSignalTS' do ) end end + +target 'OneSignalNotificationServiceExtension' do + pod 'OneSignalXCFramework', '>= 5.0.0', '< 6.0' +end diff --git a/examples/RNOneSignalTS/ios/Podfile.lock b/examples/RNOneSignalTS/ios/Podfile.lock index 8c28aa1e..68bc7165 100644 --- a/examples/RNOneSignalTS/ios/Podfile.lock +++ b/examples/RNOneSignalTS/ios/Podfile.lock @@ -2527,6 +2527,7 @@ DEPENDENCIES: - fmt (from `../node_modules/react-native/third-party-podspecs/fmt.podspec`) - glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`) - hermes-engine (from `../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec`) + - OneSignalXCFramework (< 6.0, >= 5.0.0) - RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`) - RCTDeprecation (from `../node_modules/react-native/ReactApple/Libraries/RCTFoundation/RCTDeprecation`) - RCTRequired (from `../node_modules/react-native/Libraries/Required`) @@ -2839,6 +2840,6 @@ SPEC CHECKSUMS: SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748 Yoga: 689c8e04277f3ad631e60fe2a08e41d411daf8eb -PODFILE CHECKSUM: 55f78c40d4a0661b8ccbf5604f1cf5b702ca4ea4 +PODFILE CHECKSUM: 6ac3d17bc5c92580526c5376b6d35aacda108018 COCOAPODS: 1.16.2 diff --git a/examples/RNOneSignalTS/ios/RNOneSignalTS.xcodeproj/project.pbxproj b/examples/RNOneSignalTS/ios/RNOneSignalTS.xcodeproj/project.pbxproj index b1e6c3fd..d775577e 100644 --- a/examples/RNOneSignalTS/ios/RNOneSignalTS.xcodeproj/project.pbxproj +++ b/examples/RNOneSignalTS/ios/RNOneSignalTS.xcodeproj/project.pbxproj @@ -3,18 +3,45 @@ archiveVersion = 1; classes = { }; - objectVersion = 54; + objectVersion = 77; objects = { /* Begin PBXBuildFile section */ 0C80B921A6F3F58F76C31292 /* libPods-RNOneSignalTS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5DCACB8F33CDC322A6C60F78 /* libPods-RNOneSignalTS.a */; }; 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; + 71D531BDB059DCF562EBBB5C /* libPods-OneSignalNotificationServiceExtension.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0345CAE37CB3637F1C837F29 /* libPods-OneSignalNotificationServiceExtension.a */; }; 761780ED2CA45674006654EE /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 761780EC2CA45674006654EE /* AppDelegate.swift */; }; 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; }; 8BAB3060F53DE1EC7C3F4C0F /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */; }; + E8EFD7252EE8DE2A00D4BE2B /* OneSignalNotificationServiceExtension.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = E8EFD71E2EE8DE2A00D4BE2B /* OneSignalNotificationServiceExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; /* End PBXBuildFile section */ +/* Begin PBXContainerItemProxy section */ + E8EFD7232EE8DE2A00D4BE2B /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */; + proxyType = 1; + remoteGlobalIDString = E8EFD71D2EE8DE2A00D4BE2B; + remoteInfo = OneSignalNotificationServiceExtension; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + E8EFD72A2EE8DE2A00D4BE2B /* Embed Foundation Extensions */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 13; + files = ( + E8EFD7252EE8DE2A00D4BE2B /* OneSignalNotificationServiceExtension.appex in Embed Foundation Extensions */, + ); + name = "Embed Foundation Extensions"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + /* Begin PBXFileReference section */ + 0345CAE37CB3637F1C837F29 /* libPods-OneSignalNotificationServiceExtension.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-OneSignalNotificationServiceExtension.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 13B07F961A680F5B00A75B9A /* RNOneSignalTS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = RNOneSignalTS.app; sourceTree = BUILT_PRODUCTS_DIR; }; 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = RNOneSignalTS/Images.xcassets; sourceTree = ""; }; 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = RNOneSignalTS/Info.plist; sourceTree = ""; }; @@ -22,12 +49,36 @@ 3B4392A12AC88292D35C810B /* Pods-RNOneSignalTS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNOneSignalTS.debug.xcconfig"; path = "Target Support Files/Pods-RNOneSignalTS/Pods-RNOneSignalTS.debug.xcconfig"; sourceTree = ""; }; 5709B34CF0A7D63546082F79 /* 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 = ""; }; 5DCACB8F33CDC322A6C60F78 /* libPods-RNOneSignalTS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RNOneSignalTS.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + 738FBF223908AF32EAFC2FC9 /* Pods-OneSignalNotificationServiceExtension.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-OneSignalNotificationServiceExtension.release.xcconfig"; path = "Target Support Files/Pods-OneSignalNotificationServiceExtension/Pods-OneSignalNotificationServiceExtension.release.xcconfig"; sourceTree = ""; }; 761780EC2CA45674006654EE /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = AppDelegate.swift; path = RNOneSignalTS/AppDelegate.swift; sourceTree = ""; }; 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = RNOneSignalTS/LaunchScreen.storyboard; sourceTree = ""; }; + 9BB27FA4C31186102C7BEF1F /* Pods-OneSignalNotificationServiceExtension.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-OneSignalNotificationServiceExtension.debug.xcconfig"; path = "Target Support Files/Pods-OneSignalNotificationServiceExtension/Pods-OneSignalNotificationServiceExtension.debug.xcconfig"; sourceTree = ""; }; E816AD882E84A044009D8C37 /* RNOneSignalTS.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; name = RNOneSignalTS.entitlements; path = RNOneSignalTS/RNOneSignalTS.entitlements; sourceTree = ""; }; + E8EFD71E2EE8DE2A00D4BE2B /* OneSignalNotificationServiceExtension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = OneSignalNotificationServiceExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; }; ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; /* End PBXFileReference section */ +/* Begin PBXFileSystemSynchronizedBuildFileExceptionSet section */ + E8EFD7262EE8DE2A00D4BE2B /* Exceptions for "OneSignalNotificationServiceExtension" folder in "OneSignalNotificationServiceExtension" target */ = { + isa = PBXFileSystemSynchronizedBuildFileExceptionSet; + membershipExceptions = ( + Info.plist, + ); + target = E8EFD71D2EE8DE2A00D4BE2B /* OneSignalNotificationServiceExtension */; + }; +/* End PBXFileSystemSynchronizedBuildFileExceptionSet section */ + +/* Begin PBXFileSystemSynchronizedRootGroup section */ + E8EFD71F2EE8DE2A00D4BE2B /* OneSignalNotificationServiceExtension */ = { + isa = PBXFileSystemSynchronizedRootGroup; + exceptions = ( + E8EFD7262EE8DE2A00D4BE2B /* Exceptions for "OneSignalNotificationServiceExtension" folder in "OneSignalNotificationServiceExtension" target */, + ); + path = OneSignalNotificationServiceExtension; + sourceTree = ""; + }; +/* End PBXFileSystemSynchronizedRootGroup section */ + /* Begin PBXFrameworksBuildPhase section */ 13B07F8C1A680F5B00A75B9A /* Frameworks */ = { isa = PBXFrameworksBuildPhase; @@ -37,6 +88,14 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + E8EFD71B2EE8DE2A00D4BE2B /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 71D531BDB059DCF562EBBB5C /* libPods-OneSignalNotificationServiceExtension.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ @@ -58,6 +117,7 @@ children = ( ED297162215061F000B7C4FE /* JavaScriptCore.framework */, 5DCACB8F33CDC322A6C60F78 /* libPods-RNOneSignalTS.a */, + 0345CAE37CB3637F1C837F29 /* libPods-OneSignalNotificationServiceExtension.a */, ); name = Frameworks; sourceTree = ""; @@ -74,6 +134,7 @@ children = ( 13B07FAE1A68108700A75B9A /* RNOneSignalTS */, 832341AE1AAA6A7D00B99B32 /* Libraries */, + E8EFD71F2EE8DE2A00D4BE2B /* OneSignalNotificationServiceExtension */, 83CBBA001A601CBA00E9B192 /* Products */, 2D16E6871FA4F8E400B85C8A /* Frameworks */, BBD78D7AC51CEA395F1C20DB /* Pods */, @@ -87,6 +148,7 @@ isa = PBXGroup; children = ( 13B07F961A680F5B00A75B9A /* RNOneSignalTS.app */, + E8EFD71E2EE8DE2A00D4BE2B /* OneSignalNotificationServiceExtension.appex */, ); name = Products; sourceTree = ""; @@ -96,6 +158,8 @@ children = ( 3B4392A12AC88292D35C810B /* Pods-RNOneSignalTS.debug.xcconfig */, 5709B34CF0A7D63546082F79 /* Pods-RNOneSignalTS.release.xcconfig */, + 9BB27FA4C31186102C7BEF1F /* Pods-OneSignalNotificationServiceExtension.debug.xcconfig */, + 738FBF223908AF32EAFC2FC9 /* Pods-OneSignalNotificationServiceExtension.release.xcconfig */, ); path = Pods; sourceTree = ""; @@ -114,31 +178,57 @@ 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, 00EEFC60759A1932668264C0 /* [CP] Embed Pods Frameworks */, E235C05ADACE081382539298 /* [CP] Copy Pods Resources */, + E8EFD72A2EE8DE2A00D4BE2B /* Embed Foundation Extensions */, ); buildRules = ( ); dependencies = ( + E8EFD7242EE8DE2A00D4BE2B /* PBXTargetDependency */, ); name = RNOneSignalTS; productName = RNOneSignalTS; productReference = 13B07F961A680F5B00A75B9A /* RNOneSignalTS.app */; productType = "com.apple.product-type.application"; }; + E8EFD71D2EE8DE2A00D4BE2B /* OneSignalNotificationServiceExtension */ = { + isa = PBXNativeTarget; + buildConfigurationList = E8EFD7272EE8DE2A00D4BE2B /* Build configuration list for PBXNativeTarget "OneSignalNotificationServiceExtension" */; + buildPhases = ( + 718F79E900F4F05FA94C4348 /* [CP] Check Pods Manifest.lock */, + E8EFD71A2EE8DE2A00D4BE2B /* Sources */, + E8EFD71B2EE8DE2A00D4BE2B /* Frameworks */, + E8EFD71C2EE8DE2A00D4BE2B /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + fileSystemSynchronizedGroups = ( + E8EFD71F2EE8DE2A00D4BE2B /* OneSignalNotificationServiceExtension */, + ); + name = OneSignalNotificationServiceExtension; + productName = OneSignalNotificationServiceExtension; + productReference = E8EFD71E2EE8DE2A00D4BE2B /* OneSignalNotificationServiceExtension.appex */; + productType = "com.apple.product-type.app-extension"; + }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ 83CBB9F71A601CBA00E9B192 /* Project object */ = { isa = PBXProject; attributes = { + LastSwiftUpdateCheck = 2600; LastUpgradeCheck = 1210; TargetAttributes = { 13B07F861A680F5B00A75B9A = { LastSwiftMigration = 1120; }; + E8EFD71D2EE8DE2A00D4BE2B = { + CreatedOnToolsVersion = 26.0.1; + }; }; }; buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "RNOneSignalTS" */; - compatibilityVersion = "Xcode 12.0"; developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( @@ -146,11 +236,13 @@ Base, ); mainGroup = 83CBB9F61A601CBA00E9B192; + preferredProjectObjectVersion = 77; productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( 13B07F861A680F5B00A75B9A /* RNOneSignalTS */, + E8EFD71D2EE8DE2A00D4BE2B /* OneSignalNotificationServiceExtension */, ); }; /* End PBXProject section */ @@ -166,6 +258,13 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + E8EFD71C2EE8DE2A00D4BE2B /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ @@ -202,6 +301,28 @@ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-RNOneSignalTS/Pods-RNOneSignalTS-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; + 718F79E900F4F05FA94C4348 /* [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-OneSignalNotificationServiceExtension-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; + }; C38B50BA6285516D6DCD4F65 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -252,8 +373,23 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + E8EFD71A2EE8DE2A00D4BE2B /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXSourcesBuildPhase section */ +/* Begin PBXTargetDependency section */ + E8EFD7242EE8DE2A00D4BE2B /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = E8EFD71D2EE8DE2A00D4BE2B /* OneSignalNotificationServiceExtension */; + targetProxy = E8EFD7232EE8DE2A00D4BE2B /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + /* Begin XCBuildConfiguration section */ 13B07F941A680F5B00A75B9A /* Debug */ = { isa = XCBuildConfiguration; @@ -457,6 +593,97 @@ }; name = Release; }; + E8EFD7282EE8DE2A00D4BE2B /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9BB27FA4C31186102C7BEF1F /* Pods-OneSignalNotificationServiceExtension.debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + 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_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_ENTITLEMENTS = OneSignalNotificationServiceExtension/OneSignalNotificationServiceExtension.entitlements; + 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 = OneSignalNotificationServiceExtension/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = OneSignalNotificationServiceExtension; + INFOPLIST_KEY_NSHumanReadableCopyright = ""; + IPHONEOS_DEPLOYMENT_TARGET = 26.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@executable_path/../../Frameworks", + ); + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MARKETING_VERSION = 1.0; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = "com.onesignal.example.OneSignalNotificationServiceExtension-RN"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + STRING_CATALOG_GENERATE_SYMBOLS = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; + SWIFT_APPROACHABLE_CONCURRENCY = YES; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + E8EFD7292EE8DE2A00D4BE2B /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 738FBF223908AF32EAFC2FC9 /* Pods-OneSignalNotificationServiceExtension.release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + 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_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_ENTITLEMENTS = OneSignalNotificationServiceExtension/OneSignalNotificationServiceExtension.entitlements; + 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 = OneSignalNotificationServiceExtension/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = OneSignalNotificationServiceExtension; + INFOPLIST_KEY_NSHumanReadableCopyright = ""; + IPHONEOS_DEPLOYMENT_TARGET = 26.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@executable_path/../../Frameworks", + ); + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MARKETING_VERSION = 1.0; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = "com.onesignal.example.OneSignalNotificationServiceExtension-RN"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + STRING_CATALOG_GENERATE_SYMBOLS = YES; + SWIFT_APPROACHABLE_CONCURRENCY = YES; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -478,6 +705,15 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + E8EFD7272EE8DE2A00D4BE2B /* Build configuration list for PBXNativeTarget "OneSignalNotificationServiceExtension" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + E8EFD7282EE8DE2A00D4BE2B /* Debug */, + E8EFD7292EE8DE2A00D4BE2B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; /* End XCConfigurationList section */ }; rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */; diff --git a/examples/RNOneSignalTS/ios/RNOneSignalTS/Info.plist b/examples/RNOneSignalTS/ios/RNOneSignalTS/Info.plist index 0bdd467b..4d7ccbba 100644 --- a/examples/RNOneSignalTS/ios/RNOneSignalTS/Info.plist +++ b/examples/RNOneSignalTS/ios/RNOneSignalTS/Info.plist @@ -35,6 +35,10 @@ RCTNewArchEnabled + UIBackgroundModes + + remote-notification + UILaunchStoryboardName LaunchScreen UIRequiredDeviceCapabilities diff --git a/examples/RNOneSignalTS/ios/RNOneSignalTS/RNOneSignalTS.entitlements b/examples/RNOneSignalTS/ios/RNOneSignalTS/RNOneSignalTS.entitlements index 903def2a..34463649 100644 --- a/examples/RNOneSignalTS/ios/RNOneSignalTS/RNOneSignalTS.entitlements +++ b/examples/RNOneSignalTS/ios/RNOneSignalTS/RNOneSignalTS.entitlements @@ -4,5 +4,9 @@ aps-environment development + com.apple.security.application-groups + + group.com.onesignal.example.onesignal + diff --git a/examples/RNOneSignalTS/setup.sh b/examples/RNOneSignalTS/setup.sh index 5f97ffbf..5be48f0c 100755 --- a/examples/RNOneSignalTS/setup.sh +++ b/examples/RNOneSignalTS/setup.sh @@ -16,6 +16,11 @@ bun i # Reinstall pods to pick up the updated native module if [ -d "ios" ]; then cd ios + echo "Updating pods" pod install + + echo "Updating OneSignalXCFramework" + pod update OneSignalXCFramework + cd .. fi