diff --git a/benchmarks/ios/BenchmarkRunner.xcodeproj/project.pbxproj b/benchmarks/ios/BenchmarkRunner.xcodeproj/project.pbxproj index d845ae407..0d0f5fdb7 100644 --- a/benchmarks/ios/BenchmarkRunner.xcodeproj/project.pbxproj +++ b/benchmarks/ios/BenchmarkRunner.xcodeproj/project.pbxproj @@ -17,9 +17,11 @@ 043403262DCB9CD700803AF8 /* BenchmarkVitals.mm in Sources */ = {isa = PBXBuildFile; fileRef = 043403242DCB9CD700803AF8 /* BenchmarkVitals.mm */; }; 04576C962DCBAF900078DCAB /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 04576C952DCBAF900078DCAB /* main.m */; }; 04726DD72F46402A008D1A48 /* TracerProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04726DD62F46402A008D1A48 /* TracerProvider.swift */; }; - 0C80B921A6F3F58F76C31292 /* libPods-BenchmarkRunner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5DCACB8F33CDC322A6C60F78 /* libPods-BenchmarkRunner.a */; }; + 10520E8C306BAEDB00BBFBFF /* OpenTelemetryApi in Frameworks */ = {isa = PBXBuildFile; productRef = 10520E8B306BAEDB00BBFBFF /* OpenTelemetryApi */; }; + 10520E8E306BAEDB00BBFBFF /* OpenTelemetrySdk in Frameworks */ = {isa = PBXBuildFile; productRef = 10520E8D306BAEDB00BBFBFF /* OpenTelemetrySdk */; }; 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 20A397FC280595A8A9851556 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */; }; + 52040CC80A3CB0E4C3A131B0 /* Pods_BenchmarkRunner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7E927512A5C6D462705AE797 /* Pods_BenchmarkRunner.framework */; }; 761780ED2CA45674006654EE /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 761780EC2CA45674006654EE /* AppDelegate.swift */; }; 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; }; /* End PBXBuildFile section */ @@ -42,8 +44,8 @@ 13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = PrivacyInfo.xcprivacy; path = BenchmarkRunner/PrivacyInfo.xcprivacy; sourceTree = ""; }; 3B4392A12AC88292D35C810B /* Pods-BenchmarkRunner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BenchmarkRunner.debug.xcconfig"; path = "Target Support Files/Pods-BenchmarkRunner/Pods-BenchmarkRunner.debug.xcconfig"; sourceTree = ""; }; 5709B34CF0A7D63546082F79 /* Pods-BenchmarkRunner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BenchmarkRunner.release.xcconfig"; path = "Target Support Files/Pods-BenchmarkRunner/Pods-BenchmarkRunner.release.xcconfig"; sourceTree = ""; }; - 5DCACB8F33CDC322A6C60F78 /* libPods-BenchmarkRunner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-BenchmarkRunner.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 761780EC2CA45674006654EE /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = AppDelegate.swift; path = BenchmarkRunner/AppDelegate.swift; sourceTree = ""; }; + 7E927512A5C6D462705AE797 /* Pods_BenchmarkRunner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_BenchmarkRunner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = BenchmarkRunner/LaunchScreen.storyboard; sourceTree = ""; }; ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; /* End PBXFileReference section */ @@ -53,7 +55,9 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 0C80B921A6F3F58F76C31292 /* libPods-BenchmarkRunner.a in Frameworks */, + 10520E8E306BAEDB00BBFBFF /* OpenTelemetrySdk in Frameworks */, + 52040CC80A3CB0E4C3A131B0 /* Pods_BenchmarkRunner.framework in Frameworks */, + 10520E8C306BAEDB00BBFBFF /* OpenTelemetryApi in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -110,7 +114,7 @@ isa = PBXGroup; children = ( ED297162215061F000B7C4FE /* JavaScriptCore.framework */, - 5DCACB8F33CDC322A6C60F78 /* libPods-BenchmarkRunner.a */, + 7E927512A5C6D462705AE797 /* Pods_BenchmarkRunner.framework */, ); name = Frameworks; sourceTree = ""; @@ -174,6 +178,10 @@ dependencies = ( ); name = BenchmarkRunner; + packageProductDependencies = ( + 10520E8B306BAEDB00BBFBFF /* OpenTelemetryApi */, + 10520E8D306BAEDB00BBFBFF /* OpenTelemetrySdk */, + ); productName = BenchmarkRunner; productReference = 13B07F961A680F5B00A75B9A /* BenchmarkRunner.app */; productType = "com.apple.product-type.application"; @@ -200,6 +208,9 @@ Base, ); mainGroup = 83CBB9F61A601CBA00E9B192; + packageReferences = ( + 10520E8A306BAEDB00BBFBFF /* XCRemoteSwiftPackageReference "opentelemetry-swift-core" */, + ); productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */; projectDirPath = ""; projectRoot = ""; @@ -574,6 +585,17 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers", + "${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core", + "${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon-Samples/ReactCommon_Samples.framework/Headers", + "${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon-Samples/ReactCommon_Samples.framework/Headers/platform/ios", + "${PODS_CONFIGURATION_BUILD_DIR}/React-Fabric/React_Fabric.framework/Headers/react/renderer/components/view/platform/cxx", + "${PODS_CONFIGURATION_BUILD_DIR}/React-NativeModulesApple/React_NativeModulesApple.framework/Headers", + "${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers", + "${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers/react/renderer/graphics/platform/ios", + ); IPHONEOS_DEPLOYMENT_TARGET = 15.1; LD_RUNPATH_SEARCH_PATHS = ( /usr/lib/swift, @@ -647,6 +669,17 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers", + "${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core", + "${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon-Samples/ReactCommon_Samples.framework/Headers", + "${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon-Samples/ReactCommon_Samples.framework/Headers/platform/ios", + "${PODS_CONFIGURATION_BUILD_DIR}/React-Fabric/React_Fabric.framework/Headers/react/renderer/components/view/platform/cxx", + "${PODS_CONFIGURATION_BUILD_DIR}/React-NativeModulesApple/React_NativeModulesApple.framework/Headers", + "${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers", + "${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers/react/renderer/graphics/platform/ios", + ); IPHONEOS_DEPLOYMENT_TARGET = 15.1; LD_RUNPATH_SEARCH_PATHS = ( /usr/lib/swift, @@ -699,6 +732,30 @@ defaultConfigurationName = Release; }; /* End XCConfigurationList section */ + +/* Begin XCRemoteSwiftPackageReference section */ + 10520E8A306BAEDB00BBFBFF /* XCRemoteSwiftPackageReference "opentelemetry-swift-core" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/open-telemetry/opentelemetry-swift-core"; + requirement = { + kind = upToNextMinorVersion; + minimumVersion = 2.5.0; + }; + }; +/* End XCRemoteSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + 10520E8B306BAEDB00BBFBFF /* OpenTelemetryApi */ = { + isa = XCSwiftPackageProductDependency; + package = 10520E8A306BAEDB00BBFBFF /* XCRemoteSwiftPackageReference "opentelemetry-swift-core" */; + productName = OpenTelemetryApi; + }; + 10520E8D306BAEDB00BBFBFF /* OpenTelemetrySdk */ = { + isa = XCSwiftPackageProductDependency; + package = 10520E8A306BAEDB00BBFBFF /* XCRemoteSwiftPackageReference "opentelemetry-swift-core" */; + productName = OpenTelemetrySdk; + }; +/* End XCSwiftPackageProductDependency section */ }; rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */; } diff --git a/benchmarks/ios/BenchmarkRunner.xcworkspace/xcshareddata/swiftpm/Package.resolved b/benchmarks/ios/BenchmarkRunner.xcworkspace/xcshareddata/swiftpm/Package.resolved new file mode 100644 index 000000000..3c0312e44 --- /dev/null +++ b/benchmarks/ios/BenchmarkRunner.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -0,0 +1,42 @@ +{ + "originHash" : "ecc3edec2d3d8492b2aafc6cd36445ca859b5fde20181e9e4a9c7d388015e111", + "pins" : [ + { + "identity" : "dd-sdk-ios", + "kind" : "remoteSourceControl", + "location" : "https://github.com/DataDog/dd-sdk-ios.git", + "state" : { + "revision" : "9a66954568bbbeee46eca36082a51b3dad581ae3", + "version" : "3.16.0" + } + }, + { + "identity" : "kscrash", + "kind" : "remoteSourceControl", + "location" : "https://github.com/kstenerud/KSCrash.git", + "state" : { + "revision" : "3f77f379c2db001e0c261c2a51b7e2b115d31f91", + "version" : "2.6.0" + } + }, + { + "identity" : "opentelemetry-swift-core", + "kind" : "remoteSourceControl", + "location" : "https://github.com/open-telemetry/opentelemetry-swift-core", + "state" : { + "revision" : "06f8a460a66f813758d22f09025d85df45450a63", + "version" : "2.5.1" + } + }, + { + "identity" : "swift-atomics", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-atomics.git", + "state" : { + "revision" : "0442cb5a3f98ab802acb777929fdb446bda11a34", + "version" : "1.3.1" + } + } + ], + "version" : 3 +} diff --git a/benchmarks/ios/BenchmarkRunner/PrivacyInfo.xcprivacy b/benchmarks/ios/BenchmarkRunner/PrivacyInfo.xcprivacy index bad327615..41b8317f0 100644 --- a/benchmarks/ios/BenchmarkRunner/PrivacyInfo.xcprivacy +++ b/benchmarks/ios/BenchmarkRunner/PrivacyInfo.xcprivacy @@ -6,18 +6,18 @@ NSPrivacyAccessedAPIType - NSPrivacyAccessedAPICategoryUserDefaults + NSPrivacyAccessedAPICategoryFileTimestamp NSPrivacyAccessedAPITypeReasons - CA92.1 + C617.1 NSPrivacyAccessedAPIType - NSPrivacyAccessedAPICategoryFileTimestamp + NSPrivacyAccessedAPICategoryUserDefaults NSPrivacyAccessedAPITypeReasons - C617.1 + CA92.1 diff --git a/benchmarks/ios/Podfile b/benchmarks/ios/Podfile index 92841ceb1..829d1b642 100644 --- a/benchmarks/ios/Podfile +++ b/benchmarks/ios/Podfile @@ -10,11 +10,9 @@ require Pod::Executable.execute_command('node', ['-p', platform :ios, min_ios_version_supported prepare_react_native_project! -linkage = ENV['USE_FRAMEWORKS'] -if linkage != nil - Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green - use_frameworks! :linkage => linkage.to_sym -end +# The Datadog podspecs resolve the native iOS SDK through Swift Package Manager, which requires +# pods to be linked as dynamic frameworks. +use_frameworks! :linkage => :dynamic target 'BenchmarkRunner' do config = use_native_modules! @@ -25,9 +23,15 @@ target 'BenchmarkRunner' do :app_path => "#{Pod::Config.instance.installation_root}/.." ) - # OpenTelemetrySdk is needed by the BenchmarkVitals code (metrics exporter, meter provider). - # OpenTelemetryApi is already pulled in transitively via DatadogTrace, but OpenTelemetrySdk is not. - pod 'OpenTelemetry-Swift-Sdk', '~> 2.5.0' + # OpenTelemetryApi and OpenTelemetrySdk are needed by the BenchmarkVitals code (metrics exporter, + # meter provider). They are not declared here: DatadogTrace already resolves + # opentelemetry-swift-core through SwiftPM, and both are products of that same package, so the + # BenchmarkRunner target links them directly from it. + # + # Pulling OpenTelemetrySdk from CocoaPods instead would bring a second copy of the OpenTelemetryApi + # module into the build -- one from the pod, one from SwiftPM -- which makes Xcode's explicit + # module scanner emit "is missing a dependency on 'OpenTelemetryApi'" warnings across every target + # that touches it. post_install do |installer| # https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/react_native_pods.rb#L197-L202 diff --git a/benchmarks/ios/Podfile.lock b/benchmarks/ios/Podfile.lock index 88e1885e4..2c9b34420 100644 --- a/benchmarks/ios/Podfile.lock +++ b/benchmarks/ios/Podfile.lock @@ -1,26 +1,6 @@ PODS: - boost (1.84.0) - - DatadogCore (3.16.0): - - DatadogInternal (= 3.16.0) - - DatadogCrashReporting (3.16.0): - - DatadogInternal (= 3.16.0) - - KSCrash/Filters (= 2.5.1) - - KSCrash/Recording (= 2.5.1) - - DatadogFlags (3.16.0): - - DatadogInternal (= 3.16.0) - - DatadogInternal (3.16.0) - - DatadogLogs (3.16.0): - - DatadogInternal (= 3.16.0) - - DatadogRUM (3.16.0): - - DatadogInternal (= 3.16.0) - DatadogSDKReactNative (3.9.0): - - DatadogCore (= 3.16.0) - - DatadogCrashReporting (= 3.16.0) - - DatadogFlags (= 3.16.0) - - DatadogLogs (= 3.16.0) - - DatadogRUM (= 3.16.0) - - DatadogTrace (= 3.16.0) - - DatadogWebViewTracking (= 3.16.0) - DoubleConversion - glog - hermes-engine @@ -43,7 +23,6 @@ PODS: - Yoga - DatadogSDKReactNativeSessionReplay (3.9.0): - DatadogSDKReactNative - - DatadogSessionReplay (= 3.16.0) - DoubleConversion - glog - hermes-engine @@ -58,6 +37,7 @@ PODS: - React-ImageManager - React-NativeModulesApple - React-RCTFabric + - React-RCTText - React-rendererdebug - React-utils - ReactCodegen @@ -65,9 +45,7 @@ PODS: - ReactCommon/turbomodule/core - Yoga - DatadogSDKReactNativeWebView (3.9.0): - - DatadogInternal (= 3.16.0) - DatadogSDKReactNative - - DatadogWebViewTracking (= 3.16.0) - DoubleConversion - glog - hermes-engine @@ -80,6 +58,7 @@ PODS: - React-featureflags - React-graphics - React-ImageManager + - react-native-webview - React-NativeModulesApple - React-RCTFabric - React-rendererdebug @@ -88,13 +67,6 @@ PODS: - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - Yoga - - DatadogSessionReplay (3.16.0): - - DatadogInternal (= 3.16.0) - - DatadogTrace (3.16.0): - - DatadogInternal (= 3.16.0) - - OpenTelemetry-Swift-Api (~> 2.5.0) - - DatadogWebViewTracking (3.16.0): - - DatadogInternal (= 3.16.0) - DoubleConversion (1.1.6) - fast_float (6.1.4) - FBLazyVector (0.78.2) @@ -103,20 +75,6 @@ PODS: - hermes-engine (0.78.2): - hermes-engine/Pre-built (= 0.78.2) - hermes-engine/Pre-built (0.78.2) - - KSCrash/Core (2.5.1) - - KSCrash/Filters (2.5.1): - - KSCrash/Recording - - KSCrash/RecordingCore - - KSCrash/ReportingCore - - KSCrash/Recording (2.5.1): - - KSCrash/RecordingCore - - KSCrash/RecordingCore (2.5.1): - - KSCrash/Core - - KSCrash/ReportingCore (2.5.1): - - KSCrash/Core - - OpenTelemetry-Swift-Api (2.5.1) - - OpenTelemetry-Swift-Sdk (2.5.1): - - OpenTelemetry-Swift-Api (= 2.5.1) - RCT-Folly (2024.11.18.00): - boost - DoubleConversion @@ -1891,7 +1849,6 @@ 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`) - - OpenTelemetry-Swift-Sdk (~> 2.5.0) - RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`) - RCT-Folly/Fabric (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`) - RCTDeprecation (from `../node_modules/react-native/ReactApple/Libraries/RCTFoundation/RCTDeprecation`) @@ -1963,18 +1920,6 @@ DEPENDENCIES: SPEC REPOS: https://github.com/CocoaPods/Specs.git: - - DatadogCore - - DatadogCrashReporting - - DatadogFlags - - DatadogInternal - - DatadogLogs - - DatadogRUM - - DatadogSessionReplay - - DatadogTrace - - DatadogWebViewTracking - - KSCrash - - OpenTelemetry-Swift-Api - - OpenTelemetry-Swift-Sdk - SocketRocket EXTERNAL SOURCES: @@ -2134,27 +2079,15 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: boost: 7e761d76ca2ce687f7cc98e698152abd03a18f90 - DatadogCore: 7eed8fbaaa1575503c389f343c230858343c8baf - DatadogCrashReporting: 04f3c3a5bfd9921aef4d44b4ab80accb39c84ddb - DatadogFlags: 033cf48e769c271843e77068c015519880011866 - DatadogInternal: e5a4652ee266986e29c6b8491aff7f78dc3b731d - DatadogLogs: 52792add5827042f619771a23656e2bfb6b0f4e7 - DatadogRUM: b78d608e013f39c5679ed31ad97dad323c6113e8 - DatadogSDKReactNative: 45d497eeef512ab483054d033affa166bce15722 - DatadogSDKReactNativeSessionReplay: b78202de431d881190c5b8c62dfe75d31a06e232 - DatadogSDKReactNativeWebView: be9a4c687dcb10d9d3ca1e234ea102f6c3bf8106 - DatadogSessionReplay: 932b2077b1a5367de1450479d72093621b9fd618 - DatadogTrace: 5ef84e254e2e1d337bc52e0cdf16396ca102aeb1 - DatadogWebViewTracking: e0470157f55a83680a549d79ba2985e0d17465db + DatadogSDKReactNative: 625c5d19a50227bb96959703619fed06d13dee89 + DatadogSDKReactNativeSessionReplay: 4fe2c3e274def3ecb04435a87630c923673fce0e + DatadogSDKReactNativeWebView: 57eefb783b439f9d098bd681a252e1bda7fea8ed DoubleConversion: cb417026b2400c8f53ae97020b2be961b59470cb fast_float: 06eeec4fe712a76acc9376682e4808b05ce978b6 FBLazyVector: e32d34492c519a2194ec9d7f5e7a79d11b73f91c fmt: a40bb5bd0294ea969aaaba240a927bd33d878cdd glog: eb93e2f488219332457c3c4eafd2738ddc7e80b8 hermes-engine: 2771b98fb813fdc6f92edd7c9c0035ecabf9fee7 - KSCrash: 8c4464fd5da7de520f2ce4a00fdf63f169a80f18 - OpenTelemetry-Swift-Api: 3be9043f6288eb4ac3cbe7548b5bd45fb4ed5849 - OpenTelemetry-Swift-Sdk: d9fa7bc839350f5a81467a5e877f727a8a77712d RCT-Folly: e78785aa9ba2ed998ea4151e314036f6c49e6d82 RCTDeprecation: be794de7dc6ed8f9f7fbf525f86e7651b8b68746 RCTRequired: a83787b092ec554c2eb6019ff3f5b8d125472b3b @@ -2164,39 +2097,39 @@ SPEC CHECKSUMS: React-Core: 88e817c42de035378cc71e009193b9a044d3f595 React-CoreModules: dcf764d71efb4f75d38fcae8d4513b6729f49360 React-cxxreact: 8cdcc937c5fbc406fe843a381102fd69440ca78a - React-debug: 440175830c448e7e53e61ebb8d8468c3256b645e - React-defaultsnativemodule: 4824bcd7b96ee2d75c28b1ca21f58976867f5535 - React-domnativemodule: a421118b475618961cf282e8ea85347cc9bb453c - React-Fabric: 6ac7de06009eb96b609a770b17abba6e460b5f45 - React-FabricComponents: e3bc2680a5a9a4917ff0c8d7f390688c30ef753c - React-FabricImage: 8bad558dec7478077974caa96acc79692d6b71f5 - React-featureflags: b9cf9b35baca1c7f20c06a104ffc325a02752faa - React-featureflagsnativemodule: dc93d81da9f41f7132e24455ec8b4b60802fd5b0 - React-graphics: aaa5a38bea15d7b895b210d95d554af45a07002a + React-debug: 0a9fb34ecb645333d905645dabdcfdc945626078 + React-defaultsnativemodule: b5b92d4b4716825afa8c848b793fc7efdf8aeb5a + React-domnativemodule: 073b3161e1b49dfe9045884369ae1ec2b987de26 + React-Fabric: f62d9ce5c158ae40c2a7b2805b7c055297c9dad7 + React-FabricComponents: 4c48b1052f8f6c3b03c3c3e2a231f1abd6d89703 + React-FabricImage: 5ad03b0081353e1e047ae3471bb129c521bf02b1 + React-featureflags: 1bfa283a0e6f26eac629e8cef2add1b2670b6f4e + React-featureflagsnativemodule: 7dc781f04bbd4b394fccb85e187bdda954362bca + React-graphics: 7eefc878da8a522942358f53abd6a7170d757bf3 React-hermes: 08ad9fb832d1b9faef391be17309aa6a69fad23b - React-idlecallbacksnativemodule: aacea33ef6c511a9781f9286cc7cdf93f39bba14 - React-ImageManager: c596c3b658c9c14607f9183ed0f635c8dd77987c - React-jserrorhandler: 987609b2f16b7d79d63fcd621bf0110dd7400b35 + React-idlecallbacksnativemodule: 4a5d5ee0f8d7a9fa94ebd1426d349e866c223979 + React-ImageManager: ce227ed251701b3f37e25a2beede459078fcd82c + React-jserrorhandler: 6e5ffaef9b3364351ef6ef58d6665beabf615a0e React-jsi: afa286d7e0c102c2478dc420d4f8935e13c973fc React-jsiexecutor: 08f5b512b4db9e2f147416d60a0a797576b9cfef - React-jsinspector: 5a94bcae66e3637711c4d96a00038ab9ec935bf5 - React-jsinspectortracing: a12589a0adbb2703cbc4380dabe9a58800810923 - React-jsitracing: 0b1a403d7757cec66b7dd8b308d04db85eef75f3 + React-jsinspector: ebe0817345b1c0194ed5c64185269b9668fadf9a + React-jsinspectortracing: 6f251cb68796f3496698127deabe5b0bbbb89b52 + React-jsitracing: 4c3fd6a14f560c52c167254a07029bcf9b60f3d8 React-logger: 304814ae37503c8eb54359851cc55bd4f936b39c - React-Mapbuffer: b588d1ca18d2ce626f868f04ab12d8b1f004f12c - React-microtasksnativemodule: 11831d070aa47755bb5739069eb04ec621fec548 + React-Mapbuffer: 8ba61e036d346d363ad208cfb1dea6c7fce0dce0 + React-microtasksnativemodule: feb934d19767f38faf9f9f0efb7cc1dcdf2d11b7 react-native-config: 3367df9c1f25bb96197007ec531c7087ed4554c3 - react-native-safe-area-context: 9b169299f9dc95f1d7fe1dd266fde53bd899cd0c - react-native-slider: 27263d134d55db948a4706f1e47d0ec88fb354dd - react-native-webview: be9957759cb73cb64f2ed5359e32a85f1f5bdff8 - React-NativeModulesApple: 79a4404ac301b40bec3b367879c5e9a9ce81683c + react-native-safe-area-context: 4da09dc73a70ad08307a6c09f61c7b03fbd45699 + react-native-slider: 01962232986a825f44af5e3537c2defe90ced096 + react-native-webview: f3180bd28381ba09520b01f36fd84d377f6ebc49 + React-NativeModulesApple: 55d6d890aa60200292a90cc1ca6c53409650f48f React-perflogger: 0ea25c109dba33d47dec36b2634bf7ea67c1a555 - React-performancetimeline: f74480de6efbcd8541c34317c0baedb433f27296 + React-performancetimeline: 21656d07aede48ca0c8c3ca7d0e755eaa17f697c React-RCTActionSheet: 2ef95837e89b9b154f13cd8401f9054fc3076aff React-RCTAnimation: 33d960d7f58a81779eea6dea47ad0364c67e1517 React-RCTAppDelegate: 85c13403fd6f6b6cc630428d52bd8bd76a670dc9 React-RCTBlob: 74c986a02d951931d2f6ed0e07ed5a7eb385bfc0 - React-RCTFabric: 384a8fea4f22fc0f21299d771971862883ba630a + React-RCTFabric: 384a6e22644799f66f545bf0de4618f4652c791f React-RCTFBReactNativeSpec: eb1c3ec5149f76133593a516ff9d5efe32ebcecd React-RCTImage: 2c58b5ddeb3c65e52f942bbe13ff9c59bd649b09 React-RCTLinking: b6b14f8a3e62c02fc627ac4f3fb0c7bd941f907c @@ -2204,25 +2137,25 @@ SPEC CHECKSUMS: React-RCTSettings: 8148f6be0ccc0cfe6e313417ebf8a479caaa2146 React-RCTText: 64114531ad1359e4e02a4a8af60df606dbbabc25 React-RCTVibration: f4859417a7dd859b6bf18b1aba897e52beb72ef6 - React-rendererconsistency: 5ac4164ec18cfdd76ed5f864dbfdc56a5a948bc9 - React-rendererdebug: 3dc1d97bbee0c0c13191e501a96ed9325bbd920e - React-rncore: 0bace3b991d8843bb5b57c5f2301ec6e9c94718b - React-RuntimeApple: 1e1e0a0c6086bc8c3b07e8f1a2f6ca99b50419a0 - React-RuntimeCore: d39322c59bef2a4b343fda663d20649f29f57fcc + React-rendererconsistency: 80ffb3fc9635edb785c19f06eb1ba9e1d3b85ea6 + React-rendererdebug: ea9b0383484ade00d675582d7848be6a86c3feb5 + React-rncore: 7c0b895671632ea5eb84edb85f48e180816e9e33 + React-RuntimeApple: 8e0654961ab947d3febc60f77a4d9fe97e135d0a + React-RuntimeCore: b194b603daafd68b140ab4c871f1556efc2c69bc React-runtimeexecutor: 876dfc1d8daa819dfd039c40f78f277c5a3e66a6 - React-RuntimeHermes: 44f5f2baf039f249b31ea4f3e224484fd1731e0e - React-runtimescheduler: 3b3c5b50743bb8743ca49b9e5a70c2c385f156e1 - React-timing: 1ee3572c398f5579c9df5bf76aacddf5683ff74e - React-utils: 0cfb7c7fb37d4e5f31cc18ffc7426be0ae6bf907 + React-RuntimeHermes: f337612527ff2ca8bb86a861be4636f177bc3bbb + React-runtimescheduler: 307946600cf701b3ffe38b454d1d1a710e8e74e7 + React-timing: 96e060d0d0bf18522d363716623ed2c61f7107c7 + React-utils: 8adf5864fc96ef51957fee06a3e43ed26559d8a7 ReactAppDependencyProvider: b48473fe434569ff8f6cb6ed4421217ebcbda878 - ReactCodegen: 653a0d8532d8c7dab50c391392044d98e20c9f79 - ReactCommon: 547db015202a80a5b3e7e041586ea54c4a087180 - RNCPicker: ffbd7b9fc7c1341929e61dbef6219f7860f57418 - RNScreens: 0f01bbed9bd8045a8d58e4b46993c28c7f498f3c - RNSVG: 082ae2874b288a96c95326c4f6029793f7009d4b + ReactCodegen: 699df724d2244b1f6b87bce12580aabb172cc52a + ReactCommon: 8fdc2d8511f4099f25d5929f7fa4284c14a7e509 + RNCPicker: 4f336c7d99a43802c0e2b51c8cbe0c32b1e3d3e3 + RNScreens: ef58b1f3077f7ee62b58f958536ee5ccb52d96b5 + RNSVG: 02ef1157622e9e59e31c257e48a0dc943411c7bf SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748 - Yoga: e14bad835e12b6c7e2260fc320bd00e0f4b45add + Yoga: 6eb60fc2c0eef63e7d2ef4a56e0a3353534143a2 -PODFILE CHECKSUM: d0574c1c0410627561bf4b1b55d0f1754283e022 +PODFILE CHECKSUM: 26bbffd54a9dc71f8787dc1ed59dcb5c1fc2e42e COCOAPODS: 1.16.2 diff --git a/bump-native-dd-sdk.sh b/bump-native-dd-sdk.sh index fabaf9600..d7d01d6ab 100755 --- a/bump-native-dd-sdk.sh +++ b/bump-native-dd-sdk.sh @@ -22,9 +22,10 @@ podspec_files=( "packages/core/DatadogSDKReactNative.podspec" "packages/react-native-session-replay/DatadogSDKReactNativeSessionReplay.podspec" "packages/react-native-webview/DatadogSDKReactNativeWebView.podspec" + "packages/internal-testing-tools/DatadogInternalTesting.podspec" ) -ios_pattern="('Datadog[^']+', ')[0-9.]+'" +ios_pattern="(datadog_ios_version = ')[0-9.]+'" android_pattern='(com\.datadoghq:dd-sdk-android-[^:"]+):[0-9.]+' if [[ "$sdk" == "ios" ]]; then diff --git a/example-new-architecture/ios/DdSdkReactNativeExample.xcodeproj/project.pbxproj b/example-new-architecture/ios/DdSdkReactNativeExample.xcodeproj/project.pbxproj index ce12a7261..17db66bd7 100644 --- a/example-new-architecture/ios/DdSdkReactNativeExample.xcodeproj/project.pbxproj +++ b/example-new-architecture/ios/DdSdkReactNativeExample.xcodeproj/project.pbxproj @@ -10,7 +10,7 @@ 13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.mm */; }; 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; - 23A157380019DD81E7B34848 /* libPods-DdSdkReactNativeExample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 61EAA7FCAAF9DA56562AE2DD /* libPods-DdSdkReactNativeExample.a */; }; + 4BBE00300BC79AB67EE46771 /* Pods_DdSdkReactNativeExample.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 65BB5462DD7E7ABA0036E297 /* Pods_DdSdkReactNativeExample.framework */; }; 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; }; E05973ABEC106467505BAF84 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 91A6167299744A7A5E90FD00 /* PrivacyInfo.xcprivacy */; }; /* End PBXBuildFile section */ @@ -25,7 +25,7 @@ 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = DdSdkReactNativeExample/Info.plist; sourceTree = ""; }; 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = DdSdkReactNativeExample/main.m; sourceTree = ""; }; 340C792A76F8AD30116CC14F /* Pods-DdSdkReactNativeExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-DdSdkReactNativeExample.debug.xcconfig"; path = "Target Support Files/Pods-DdSdkReactNativeExample/Pods-DdSdkReactNativeExample.debug.xcconfig"; sourceTree = ""; }; - 61EAA7FCAAF9DA56562AE2DD /* libPods-DdSdkReactNativeExample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-DdSdkReactNativeExample.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + 65BB5462DD7E7ABA0036E297 /* Pods_DdSdkReactNativeExample.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_DdSdkReactNativeExample.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = DdSdkReactNativeExample/LaunchScreen.storyboard; sourceTree = ""; }; 91A6167299744A7A5E90FD00 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xml; name = PrivacyInfo.xcprivacy; path = DdSdkReactNativeExample/PrivacyInfo.xcprivacy; sourceTree = ""; }; E9E5D75547DBA2BF3A3DDBA3 /* Pods-DdSdkReactNativeExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-DdSdkReactNativeExample.release.xcconfig"; path = "Target Support Files/Pods-DdSdkReactNativeExample/Pods-DdSdkReactNativeExample.release.xcconfig"; sourceTree = ""; }; @@ -37,7 +37,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 23A157380019DD81E7B34848 /* libPods-DdSdkReactNativeExample.a in Frameworks */, + 4BBE00300BC79AB67EE46771 /* Pods_DdSdkReactNativeExample.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -79,7 +79,7 @@ isa = PBXGroup; children = ( ED297162215061F000B7C4FE /* JavaScriptCore.framework */, - 61EAA7FCAAF9DA56562AE2DD /* libPods-DdSdkReactNativeExample.a */, + 65BB5462DD7E7ABA0036E297 /* Pods_DdSdkReactNativeExample.framework */, ); name = Frameworks; sourceTree = ""; @@ -402,6 +402,17 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers", + "${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core", + "${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon-Samples/ReactCommon_Samples.framework/Headers", + "${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon-Samples/ReactCommon_Samples.framework/Headers/platform/ios", + "${PODS_CONFIGURATION_BUILD_DIR}/React-Fabric/React_Fabric.framework/Headers/react/renderer/components/view/platform/cxx", + "${PODS_CONFIGURATION_BUILD_DIR}/React-NativeModulesApple/React_NativeModulesApple.framework/Headers", + "${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers", + "${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers/react/renderer/graphics/platform/ios", + ); IPHONEOS_DEPLOYMENT_TARGET = 15.1; LD = ""; LDPLUSPLUS = ""; @@ -482,6 +493,17 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers", + "${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core", + "${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon-Samples/ReactCommon_Samples.framework/Headers", + "${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon-Samples/ReactCommon_Samples.framework/Headers/platform/ios", + "${PODS_CONFIGURATION_BUILD_DIR}/React-Fabric/React_Fabric.framework/Headers/react/renderer/components/view/platform/cxx", + "${PODS_CONFIGURATION_BUILD_DIR}/React-NativeModulesApple/React_NativeModulesApple.framework/Headers", + "${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers", + "${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers/react/renderer/graphics/platform/ios", + ); IPHONEOS_DEPLOYMENT_TARGET = 15.1; LD = ""; LDPLUSPLUS = ""; diff --git a/example-new-architecture/ios/DdSdkReactNativeExample.xcworkspace/xcshareddata/swiftpm/Package.resolved b/example-new-architecture/ios/DdSdkReactNativeExample.xcworkspace/xcshareddata/swiftpm/Package.resolved new file mode 100644 index 000000000..3c0312e44 --- /dev/null +++ b/example-new-architecture/ios/DdSdkReactNativeExample.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -0,0 +1,42 @@ +{ + "originHash" : "ecc3edec2d3d8492b2aafc6cd36445ca859b5fde20181e9e4a9c7d388015e111", + "pins" : [ + { + "identity" : "dd-sdk-ios", + "kind" : "remoteSourceControl", + "location" : "https://github.com/DataDog/dd-sdk-ios.git", + "state" : { + "revision" : "9a66954568bbbeee46eca36082a51b3dad581ae3", + "version" : "3.16.0" + } + }, + { + "identity" : "kscrash", + "kind" : "remoteSourceControl", + "location" : "https://github.com/kstenerud/KSCrash.git", + "state" : { + "revision" : "3f77f379c2db001e0c261c2a51b7e2b115d31f91", + "version" : "2.6.0" + } + }, + { + "identity" : "opentelemetry-swift-core", + "kind" : "remoteSourceControl", + "location" : "https://github.com/open-telemetry/opentelemetry-swift-core", + "state" : { + "revision" : "06f8a460a66f813758d22f09025d85df45450a63", + "version" : "2.5.1" + } + }, + { + "identity" : "swift-atomics", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-atomics.git", + "state" : { + "revision" : "0442cb5a3f98ab802acb777929fdb446bda11a34", + "version" : "1.3.1" + } + } + ], + "version" : 3 +} diff --git a/example-new-architecture/ios/DdSdkReactNativeExample/PrivacyInfo.xcprivacy b/example-new-architecture/ios/DdSdkReactNativeExample/PrivacyInfo.xcprivacy index bad327615..41b8317f0 100644 --- a/example-new-architecture/ios/DdSdkReactNativeExample/PrivacyInfo.xcprivacy +++ b/example-new-architecture/ios/DdSdkReactNativeExample/PrivacyInfo.xcprivacy @@ -6,18 +6,18 @@ NSPrivacyAccessedAPIType - NSPrivacyAccessedAPICategoryUserDefaults + NSPrivacyAccessedAPICategoryFileTimestamp NSPrivacyAccessedAPITypeReasons - CA92.1 + C617.1 NSPrivacyAccessedAPIType - NSPrivacyAccessedAPICategoryFileTimestamp + NSPrivacyAccessedAPICategoryUserDefaults NSPrivacyAccessedAPITypeReasons - C617.1 + CA92.1 diff --git a/example-new-architecture/ios/Podfile b/example-new-architecture/ios/Podfile index a08a06fde..48dbc648d 100644 --- a/example-new-architecture/ios/Podfile +++ b/example-new-architecture/ios/Podfile @@ -10,11 +10,13 @@ require Pod::Executable.execute_command('node', ['-p', platform :ios, min_ios_version_supported prepare_react_native_project! -linkage = ENV['USE_FRAMEWORKS'] -if linkage != nil - Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green - use_frameworks! :linkage => linkage.to_sym -end +# The Datadog podspecs resolve the native iOS SDK through Swift Package Manager, which requires +# pods to be linked as dynamic frameworks: dd-sdk-ios declares its SPM products without an explicit +# `type:`, so SwiftPM builds them as static libraries, and combining those with CocoaPods' default +# static linkage produces duplicate symbols at link time. Dynamic frameworks are the only +# combination that works -- see https://github.com/facebook/react-native/pull/44627 for the full +# matrix. +use_frameworks! :linkage => :dynamic target 'DdSdkReactNativeExample' do pod 'DatadogSDKReactNative', :path => '../../packages/core/DatadogSDKReactNative.podspec', :testspecs => ['Tests'] @@ -35,13 +37,6 @@ target 'DdSdkReactNativeExample' do :mac_catalyst_enabled => false ) - # Enable `DD_SDK_COMPILED_FOR_TESTING` condition when compiling `DatadogSDK` dependency: - datadog_sdk_target = installer.pods_project.targets.detect {|t| ["DatadogCore", "DatadogRUM", "DatadogLogs", "DatadogInternal", "DatadogTrace", "DatadogCrashReporting"].include?(t.name) } - datadog_sdk_target.build_configurations.each do |config| - config.build_settings['SWIFT_ACTIVE_COMPILATION_CONDITIONS'] = '$(inherited) DD_SDK_COMPILED_FOR_TESTING' - config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = min_ios_version_supported - end - installer.pods_project.targets.each do |target| target.build_configurations.each do |config| config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = min_ios_version_supported diff --git a/example-new-architecture/ios/Podfile.lock b/example-new-architecture/ios/Podfile.lock index a07eb2d20..ae2e41348 100644 --- a/example-new-architecture/ios/Podfile.lock +++ b/example-new-architecture/ios/Podfile.lock @@ -1,26 +1,6 @@ PODS: - boost (1.84.0) - - DatadogCore (3.16.0): - - DatadogInternal (= 3.16.0) - - DatadogCrashReporting (3.16.0): - - DatadogInternal (= 3.16.0) - - KSCrash/Filters (= 2.5.1) - - KSCrash/Recording (= 2.5.1) - - DatadogFlags (3.16.0): - - DatadogInternal (= 3.16.0) - - DatadogInternal (3.16.0) - - DatadogLogs (3.16.0): - - DatadogInternal (= 3.16.0) - - DatadogRUM (3.16.0): - - DatadogInternal (= 3.16.0) - DatadogSDKReactNative (3.9.0): - - DatadogCore (= 3.16.0) - - DatadogCrashReporting (= 3.16.0) - - DatadogFlags (= 3.16.0) - - DatadogLogs (= 3.16.0) - - DatadogRUM (= 3.16.0) - - DatadogTrace (= 3.16.0) - - DatadogWebViewTracking (= 3.16.0) - DoubleConversion - glog - hermes-engine @@ -42,13 +22,6 @@ PODS: - ReactCommon/turbomodule/core - Yoga - DatadogSDKReactNative/Tests (3.9.0): - - DatadogCore (= 3.16.0) - - DatadogCrashReporting (= 3.16.0) - - DatadogFlags (= 3.16.0) - - DatadogLogs (= 3.16.0) - - DatadogRUM (= 3.16.0) - - DatadogTrace (= 3.16.0) - - DatadogWebViewTracking (= 3.16.0) - DoubleConversion - glog - hermes-engine @@ -69,11 +42,6 @@ PODS: - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - Yoga - - DatadogTrace (3.16.0): - - DatadogInternal (= 3.16.0) - - OpenTelemetry-Swift-Api (~> 2.5.0) - - DatadogWebViewTracking (3.16.0): - - DatadogInternal (= 3.16.0) - DoubleConversion (1.1.6) - fast_float (6.1.4) - FBLazyVector (0.76.9) @@ -82,18 +50,6 @@ PODS: - hermes-engine (0.76.9): - hermes-engine/Pre-built (= 0.76.9) - hermes-engine/Pre-built (0.76.9) - - KSCrash/Core (2.5.1) - - KSCrash/Filters (2.5.1): - - KSCrash/Recording - - KSCrash/RecordingCore - - KSCrash/ReportingCore - - KSCrash/Recording (2.5.1): - - KSCrash/RecordingCore - - KSCrash/RecordingCore (2.5.1): - - KSCrash/Core - - KSCrash/ReportingCore (2.5.1): - - KSCrash/Core - - OpenTelemetry-Swift-Api (2.5.1) - RCT-Folly (2024.10.14.00): - boost - DoubleConversion @@ -1719,16 +1675,6 @@ DEPENDENCIES: SPEC REPOS: https://github.com/CocoaPods/Specs.git: - - DatadogCore - - DatadogCrashReporting - - DatadogFlags - - DatadogInternal - - DatadogLogs - - DatadogRUM - - DatadogTrace - - DatadogWebViewTracking - - KSCrash - - OpenTelemetry-Swift-Api - SocketRocket EXTERNAL SOURCES: @@ -1866,23 +1812,13 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: boost: 1dca942403ed9342f98334bf4c3621f011aa7946 - DatadogCore: 7eed8fbaaa1575503c389f343c230858343c8baf - DatadogCrashReporting: 04f3c3a5bfd9921aef4d44b4ab80accb39c84ddb - DatadogFlags: 033cf48e769c271843e77068c015519880011866 - DatadogInternal: e5a4652ee266986e29c6b8491aff7f78dc3b731d - DatadogLogs: 52792add5827042f619771a23656e2bfb6b0f4e7 - DatadogRUM: b78d608e013f39c5679ed31ad97dad323c6113e8 - DatadogSDKReactNative: a4037e006d9dda1073be1d3b8a411461899d3181 - DatadogTrace: 5ef84e254e2e1d337bc52e0cdf16396ca102aeb1 - DatadogWebViewTracking: e0470157f55a83680a549d79ba2985e0d17465db + DatadogSDKReactNative: dd4f9107346e91abb88dc29d264725e3d5f3eae4 DoubleConversion: f16ae600a246532c4020132d54af21d0ddb2a385 fast_float: 06eeec4fe712a76acc9376682e4808b05ce978b6 FBLazyVector: 7605ea4810e0e10ae4815292433c09bf4324ba45 fmt: 01b82d4ca6470831d1cc0852a1af644be019e8f6 glog: 08b301085f15bcbb6ff8632a8ebaf239aae04e6a hermes-engine: 9e868dc7be781364296d6ee2f56d0c1a9ef0bb11 - KSCrash: 8c4464fd5da7de520f2ce4a00fdf63f169a80f18 - OpenTelemetry-Swift-Api: 3be9043f6288eb4ac3cbe7548b5bd45fb4ed5849 RCT-Folly: ea9d9256ba7f9322ef911169a9f696e5857b9e17 RCTDeprecation: ebe712bb05077934b16c6bf25228bdec34b64f83 RCTRequired: ca91e5dd26b64f577b528044c962baf171c6b716 @@ -1892,56 +1828,56 @@ SPEC CHECKSUMS: React-Core: 0a06707a0b34982efc4a556aff5dae4b22863455 React-CoreModules: 907334e94314189c2e5eed4877f3efe7b26d85b0 React-cxxreact: 3a1d5e8f4faa5e09be26614e9c8bbcae8d11b73d - React-debug: 817160c07dc8d24d020fbd1eac7b3558ffc08964 - React-defaultsnativemodule: 814830ccbc3fb08d67d0190e63b179ee4098c67b - React-domnativemodule: 270acf94bd0960b026bc3bfb327e703665d27fb4 - React-Fabric: 64586dc191fc1c170372a638b8e722e4f1d0a09b - React-FabricComponents: b0ebd032387468ea700574c581b139f57a7497fb - React-FabricImage: 81f0e0794caf25ad1224fa406d288fbc1986607f - React-featureflags: f2792b067a351d86fdc7bec23db3b9a2f2c8d26c - React-featureflagsnativemodule: 0d7091ae344d6160c0557048e127897654a5c00f - React-graphics: cbebe910e4a15b65b0bff94a4d3ed278894d6386 + React-debug: f1956672cf545729afb71ef838a9789c2a9088f5 + React-defaultsnativemodule: a5c2c12043f7e57dd8f972d28cf0c2e0ee439051 + React-domnativemodule: 9d4b6d9828a7512832d23fb64e3f13366efe67ef + React-Fabric: 80d7bc9d0ea7981a188b1ea6a67df072af164489 + React-FabricComponents: 1887b9027e7da5679f099b999dc56b44dbc7628c + React-FabricImage: 27996e41c769616bb68f011362bf69c472a6b2f7 + React-featureflags: dc9c91fcd6a75cc95bd7fec184d0be8ad0f26db5 + React-featureflagsnativemodule: f483a827effd65c0b7b2c827607716c74f2a4ae1 + React-graphics: fa15bab1a7d44a57eeb54e3185117729b141ed4b React-hermes: ec18c10f5a69d49fb9b5e17ae95494e9ea13d4d3 - React-idlecallbacksnativemodule: 6b84add48971da9c40403bd1860d4896462590f2 - React-ImageManager: f2a4c01c2ccb2193e60a20c135da74c7ca4d36f2 - React-jserrorhandler: 61d205b5a7cbc57fed3371dd7eed48c97f49fc64 + React-idlecallbacksnativemodule: 97ecc9647f7e80ea4c05545c84a86dee05e816d0 + React-ImageManager: 1a6f5a858f86bc93bf210a88ec5575ff22b69aaa + React-jserrorhandler: ea750869c2aa5497b3d9322afe02eb7f756b9696 React-jsi: 95f7676103137861b79b0f319467627bcfa629ee React-jsiexecutor: 41e0fe87cda9ea3970ffb872ef10f1ff8dbd1932 - React-jsinspector: 15578208796723e5c6f39069b6e8bf36863ef6e2 - React-jsitracing: 3758cdb155ea7711f0e77952572ea62d90c69f0b + React-jsinspector: 74c73f2b385b6a7979eddeba055961e9acc3cc42 + React-jsitracing: 182a6d4af2273f847daa8a3f841fd3ff8212d3f8 React-logger: dbca7bdfd4aa5ef69431362bde6b36d49403cb20 - React-Mapbuffer: 6efad4a606c1fae7e4a93385ee096681ef0300dc - React-microtasksnativemodule: a645237a841d733861c70b69908ab4a1707b52ad - React-nativeconfig: 8efdb1ef1e9158c77098a93085438f7e7b463678 - React-NativeModulesApple: 958d4f6c5c2ace4c0f427cf7ef82e28ae6538a22 + React-Mapbuffer: 129fa9634f42d88a0c3761d2829db85175b985ee + React-microtasksnativemodule: b5151a6d754fbf52292e758c4bb93b7c0d2f0b92 + React-nativeconfig: 415626a63057638759bcc75e0a96e2e07771a479 + React-NativeModulesApple: bffc60f55895c2723b1e5472fa40567fe3df4923 React-perflogger: 9b4f13c0afe56bc7b4a0e93ec74b1150421ee22d - React-performancetimeline: 359db1cb889aa0282fafc5838331b0987c4915a9 + React-performancetimeline: 128acbcdacb8a5ee73aa4a2bf28db4e8627f111b React-RCTActionSheet: aacf2375084dea6e7c221f4a727e579f732ff342 React-RCTAnimation: d8c82deebebe3aaf7a843affac1b57cb2dc073d4 React-RCTAppDelegate: 1774aa421a29a41a704ecaf789811ef73c4634b6 React-RCTBlob: 70a58c11a6a3500d1a12f2e51ca4f6c99babcff8 - React-RCTFabric: 731cda82aed592aacce2d32ead69d78cde5d9274 + React-RCTFabric: afb0e865f70c5017597f758d5749298dae9b87bf React-RCTImage: 5e9d655ba6a790c31e3176016f9b47fd0978fbf0 React-RCTLinking: 2a48338252805091f7521eaf92687206401bdf2a React-RCTNetwork: 0c1282b377257f6b1c81934f72d8a1d0c010e4c3 React-RCTSettings: f757b679a74e5962be64ea08d7865a7debd67b40 React-RCTText: e7d20c490b407d3b4a2daa48db4bcd8ec1032af2 React-RCTVibration: 8228e37144ca3122a91f1de16ba8e0707159cfec - React-rendererconsistency: b4917053ecbaa91469c67a4319701c9dc0d40be6 - React-rendererdebug: 81becbc8852b38d9b1b68672aa504556481330d5 - React-rncore: 120d21715c9b4ba8f798bffe986cb769b988dd74 - React-RuntimeApple: 52ed0e9e84a7c2607a901149fb13599a3c057655 - React-RuntimeCore: ca6189d2e53d86db826e2673fe8af6571b8be157 + React-rendererconsistency: b89c074e22ca2b9eaa8013e1310c69db85364893 + React-rendererdebug: 383e6c8c8d9ee45e88e5d461ad1c6a4a7a0f9282 + React-rncore: 2a6efd857e10a3b299f8a7fe912fd332aa7e515a + React-RuntimeApple: f07537b48b715b6dd7a8d6145f4f6684d78984cc + React-RuntimeCore: cce02c6ade4d7e8d1854d275c9b367b913ed1fb3 React-runtimeexecutor: 877596f82f5632d073e121cba2d2084b76a76899 - React-RuntimeHermes: 3b752dc5d8a1661c9d1687391d6d96acfa385549 - React-runtimescheduler: 8321bb09175ace2a4f0b3e3834637eb85bf42ebe - React-timing: 331cbf9f2668c67faddfd2e46bb7f41cbd9320b9 - React-utils: 54df9ada708578c8ad40d92895d6fed03e0e8a9e - ReactCodegen: 21a52ccddc6479448fc91903a437dd23ddc7366c - ReactCommon: bfd3600989d79bc3acbe7704161b171a1480b9fd + React-RuntimeHermes: ec8b23b1a86022e9831ab775d1634fcbc7dfc500 + React-runtimescheduler: 222c73a654f32e3544a1384b2ced809bd51df2af + React-timing: a693c531e5627dcc200fc7286cbbebf73d73469d + React-utils: 52cb73e127a39fc2d9f02f503b2a7b3b0abd23dd + ReactCodegen: 31fcff227d0035956575be0c013a2edcc687a53c + ReactCommon: 78c49c7cf7df16983ebc3c646b4f47398437f2ec SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748 - Yoga: feb4910aba9742cfedc059e2b2902e22ffe9954a + Yoga: 1259c7a8cbaccf7b4c3ddf8ee36ca11be9dee407 -PODFILE CHECKSUM: 85124514d3acbe8b60389d46d3c38133e7c8e8de +PODFILE CHECKSUM: 65bae30d106f4e0fed15150fb60695cc8cddcf1b COCOAPODS: 1.16.2 diff --git a/example/ios/DdSdkReactNativeExample.xcodeproj/project.pbxproj b/example/ios/DdSdkReactNativeExample.xcodeproj/project.pbxproj index bde88ccb4..51e7b602e 100644 --- a/example/ios/DdSdkReactNativeExample.xcodeproj/project.pbxproj +++ b/example/ios/DdSdkReactNativeExample.xcodeproj/project.pbxproj @@ -11,9 +11,9 @@ 13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.mm */; }; 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; + 2789DEF2415D78452154A27B /* Pods_ddSdkReactnativeExample.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EF25158637ACC88517B07D7D /* Pods_ddSdkReactnativeExample.framework */; }; 7115D38EB0DCB0BDB39D62A2 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = A54EC6889135AAF4EFAD7EF0 /* PrivacyInfo.xcprivacy */; }; 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; }; - FB483A2F5418999CE4813EF0 /* libPods-ddSdkReactnativeExample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = CE41272558F8A75D64B58C34 /* libPods-ddSdkReactnativeExample.a */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -29,8 +29,8 @@ 6D26190AF1861B20490BD908 /* Pods-ddSdkReactnativeExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ddSdkReactnativeExample.release.xcconfig"; path = "Target Support Files/Pods-ddSdkReactnativeExample/Pods-ddSdkReactnativeExample.release.xcconfig"; sourceTree = ""; }; 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = ddSdkReactnativeExample/LaunchScreen.storyboard; sourceTree = ""; }; A54EC6889135AAF4EFAD7EF0 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; includeInIndex = 1; name = PrivacyInfo.xcprivacy; path = ddSdkReactnativeExample/PrivacyInfo.xcprivacy; sourceTree = ""; }; - CE41272558F8A75D64B58C34 /* libPods-ddSdkReactnativeExample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-ddSdkReactnativeExample.a"; sourceTree = BUILT_PRODUCTS_DIR; }; ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; + EF25158637ACC88517B07D7D /* Pods_ddSdkReactnativeExample.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_ddSdkReactnativeExample.framework; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -38,7 +38,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - FB483A2F5418999CE4813EF0 /* libPods-ddSdkReactnativeExample.a in Frameworks */, + 2789DEF2415D78452154A27B /* Pods_ddSdkReactnativeExample.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -64,7 +64,7 @@ children = ( 04ACF1F52ED5D05F00602CDD /* datadog-configuration.json */, ED297162215061F000B7C4FE /* JavaScriptCore.framework */, - CE41272558F8A75D64B58C34 /* libPods-ddSdkReactnativeExample.a */, + EF25158637ACC88517B07D7D /* Pods_ddSdkReactnativeExample.framework */, ); name = Frameworks; sourceTree = ""; @@ -388,6 +388,17 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers", + "${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core", + "${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon-Samples/ReactCommon_Samples.framework/Headers", + "${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon-Samples/ReactCommon_Samples.framework/Headers/platform/ios", + "${PODS_CONFIGURATION_BUILD_DIR}/React-Fabric/React_Fabric.framework/Headers/react/renderer/components/view/platform/cxx", + "${PODS_CONFIGURATION_BUILD_DIR}/React-NativeModulesApple/React_NativeModulesApple.framework/Headers", + "${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers", + "${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers/react/renderer/graphics/platform/ios", + ); IPHONEOS_DEPLOYMENT_TARGET = 12.4; LD = ""; LDPLUSPLUS = ""; @@ -465,6 +476,17 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers", + "${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core", + "${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon-Samples/ReactCommon_Samples.framework/Headers", + "${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon-Samples/ReactCommon_Samples.framework/Headers/platform/ios", + "${PODS_CONFIGURATION_BUILD_DIR}/React-Fabric/React_Fabric.framework/Headers/react/renderer/components/view/platform/cxx", + "${PODS_CONFIGURATION_BUILD_DIR}/React-NativeModulesApple/React_NativeModulesApple.framework/Headers", + "${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers", + "${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers/react/renderer/graphics/platform/ios", + ); IPHONEOS_DEPLOYMENT_TARGET = 12.4; LD = ""; LDPLUSPLUS = ""; diff --git a/example/ios/DdSdkReactNativeExample.xcworkspace/xcshareddata/swiftpm/Package.resolved b/example/ios/DdSdkReactNativeExample.xcworkspace/xcshareddata/swiftpm/Package.resolved new file mode 100644 index 000000000..3c0312e44 --- /dev/null +++ b/example/ios/DdSdkReactNativeExample.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -0,0 +1,42 @@ +{ + "originHash" : "ecc3edec2d3d8492b2aafc6cd36445ca859b5fde20181e9e4a9c7d388015e111", + "pins" : [ + { + "identity" : "dd-sdk-ios", + "kind" : "remoteSourceControl", + "location" : "https://github.com/DataDog/dd-sdk-ios.git", + "state" : { + "revision" : "9a66954568bbbeee46eca36082a51b3dad581ae3", + "version" : "3.16.0" + } + }, + { + "identity" : "kscrash", + "kind" : "remoteSourceControl", + "location" : "https://github.com/kstenerud/KSCrash.git", + "state" : { + "revision" : "3f77f379c2db001e0c261c2a51b7e2b115d31f91", + "version" : "2.6.0" + } + }, + { + "identity" : "opentelemetry-swift-core", + "kind" : "remoteSourceControl", + "location" : "https://github.com/open-telemetry/opentelemetry-swift-core", + "state" : { + "revision" : "06f8a460a66f813758d22f09025d85df45450a63", + "version" : "2.5.1" + } + }, + { + "identity" : "swift-atomics", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-atomics.git", + "state" : { + "revision" : "0442cb5a3f98ab802acb777929fdb446bda11a34", + "version" : "1.3.1" + } + } + ], + "version" : 3 +} diff --git a/example/ios/Podfile b/example/ios/Podfile index 0c9182f55..20104baa9 100644 --- a/example/ios/Podfile +++ b/example/ios/Podfile @@ -10,11 +10,9 @@ require Pod::Executable.execute_command('node', ['-p', platform :ios, min_ios_version_supported prepare_react_native_project! -linkage = ENV['USE_FRAMEWORKS'] -if linkage != nil - Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green - use_frameworks! :linkage => linkage.to_sym -end +# The Datadog podspecs resolve the native iOS SDK through Swift Package Manager, which requires +# pods to be linked as dynamic frameworks. +use_frameworks! :linkage => :dynamic target 'ddSdkReactnativeExample' do pod 'DatadogSDKReactNative', :path => '../../packages/core/DatadogSDKReactNative.podspec', :testspecs => ['Tests'] @@ -38,11 +36,10 @@ target 'ddSdkReactnativeExample' do config[:reactNativePath], :mac_catalyst_enabled => false ) - # Enable `DD_SDK_COMPILED_FOR_TESTING` condition when compiling `DatadogSDK` dependency: - datadog_sdk_target = installer.pods_project.targets.detect {|t| ["DatadogCore", "DatadogRUM", "DatadogLogs", "DatadogInternal", "DatadogTrace", "DatadogCrashReporting"].include?(t.name) } - datadog_sdk_target.build_configurations.each do |config| - config.build_settings['SWIFT_ACTIVE_COMPILATION_CONDITIONS'] = '$(inherited) DD_SDK_COMPILED_FOR_TESTING' - end + # `DD_SDK_COMPILED_FOR_TESTING` is no longer injected. There is no pod target to set it on now + # that the SDK comes from SPM, and the native tests never needed it: none of them touch the + # three declarations it guards (`Datadog.flushAndDeinitialize` and its ObjC counterpart, and + # `DatadogContextProvider.replace(context:)`). installer.pods_project.targets.each do |target| target.build_configurations.each do |config| diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index a50252c34..9701af504 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -1,64 +1,26 @@ PODS: - boost (1.84.0) - - DatadogCore (3.16.0): - - DatadogInternal (= 3.16.0) - - DatadogCrashReporting (3.16.0): - - DatadogInternal (= 3.16.0) - - KSCrash/Filters (= 2.5.1) - - KSCrash/Recording (= 2.5.1) - - DatadogFlags (3.16.0): - - DatadogInternal (= 3.16.0) - - DatadogInternal (3.16.0) - - DatadogLogs (3.16.0): - - DatadogInternal (= 3.16.0) - - DatadogRUM (3.16.0): - - DatadogInternal (= 3.16.0) - DatadogSDKReactNative (3.9.0): - - DatadogCore (= 3.16.0) - - DatadogCrashReporting (= 3.16.0) - - DatadogFlags (= 3.16.0) - - DatadogLogs (= 3.16.0) - - DatadogRUM (= 3.16.0) - - DatadogTrace (= 3.16.0) - - DatadogWebViewTracking (= 3.16.0) - React-Core - DatadogSDKReactNative/Tests (3.9.0): - - DatadogCore (= 3.16.0) - - DatadogCrashReporting (= 3.16.0) - - DatadogFlags (= 3.16.0) - - DatadogLogs (= 3.16.0) - - DatadogRUM (= 3.16.0) - - DatadogTrace (= 3.16.0) - - DatadogWebViewTracking (= 3.16.0) - React-Core - DatadogSDKReactNativeSessionReplay (3.9.0): - DatadogSDKReactNative - - DatadogSessionReplay (= 3.16.0) - React-Core + - React-RCTText - DatadogSDKReactNativeSessionReplay/Tests (3.9.0): - DatadogSDKReactNative - - DatadogSessionReplay (= 3.16.0) - React-Core - React-RCTText - DatadogSDKReactNativeWebView (3.9.0): - - DatadogInternal (= 3.16.0) - DatadogSDKReactNative - - DatadogWebViewTracking (= 3.16.0) - React-Core + - react-native-webview - DatadogSDKReactNativeWebView/Tests (3.9.0): - - DatadogInternal (= 3.16.0) - DatadogSDKReactNative - - DatadogWebViewTracking (= 3.16.0) - React-Core - react-native-webview - React-RCTText - - DatadogSessionReplay (3.16.0): - - DatadogInternal (= 3.16.0) - - DatadogTrace (3.16.0): - - DatadogInternal (= 3.16.0) - - OpenTelemetry-Swift-Api (~> 2.5.0) - - DatadogWebViewTracking (3.16.0): - - DatadogInternal (= 3.16.0) - DoubleConversion (1.1.6) - fast_float (6.1.4) - FBLazyVector (0.76.9) @@ -68,18 +30,6 @@ PODS: - hermes-engine/Pre-built (= 0.76.9) - hermes-engine/Pre-built (0.76.9) - HMSegmentedControl (1.5.6) - - KSCrash/Core (2.5.1) - - KSCrash/Filters (2.5.1): - - KSCrash/Recording - - KSCrash/RecordingCore - - KSCrash/ReportingCore - - KSCrash/Recording (2.5.1): - - KSCrash/RecordingCore - - KSCrash/RecordingCore (2.5.1): - - KSCrash/Core - - KSCrash/ReportingCore (2.5.1): - - KSCrash/Core - - OpenTelemetry-Swift-Api (2.5.1) - RCT-Folly (2024.10.14.00): - boost - DoubleConversion @@ -1799,18 +1749,7 @@ DEPENDENCIES: SPEC REPOS: https://github.com/CocoaPods/Specs.git: - - DatadogCore - - DatadogCrashReporting - - DatadogFlags - - DatadogInternal - - DatadogLogs - - DatadogRUM - - DatadogSessionReplay - - DatadogTrace - - DatadogWebViewTracking - HMSegmentedControl - - KSCrash - - OpenTelemetry-Swift-Api - SocketRocket EXTERNAL SOURCES: @@ -1966,18 +1905,9 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: boost: 1dca942403ed9342f98334bf4c3621f011aa7946 - DatadogCore: 7eed8fbaaa1575503c389f343c230858343c8baf - DatadogCrashReporting: 04f3c3a5bfd9921aef4d44b4ab80accb39c84ddb - DatadogFlags: 033cf48e769c271843e77068c015519880011866 - DatadogInternal: e5a4652ee266986e29c6b8491aff7f78dc3b731d - DatadogLogs: 52792add5827042f619771a23656e2bfb6b0f4e7 - DatadogRUM: b78d608e013f39c5679ed31ad97dad323c6113e8 - DatadogSDKReactNative: 9094f70c8bf4be4021a85876d78781a87164efc7 - DatadogSDKReactNativeSessionReplay: 6a33bb577187438cd2023414e7148f5159a963d0 - DatadogSDKReactNativeWebView: 845b47fc1ac69aaca1a0179628b8ee9b14407a5e - DatadogSessionReplay: 932b2077b1a5367de1450479d72093621b9fd618 - DatadogTrace: 5ef84e254e2e1d337bc52e0cdf16396ca102aeb1 - DatadogWebViewTracking: e0470157f55a83680a549d79ba2985e0d17465db + DatadogSDKReactNative: 7eaa0d5c8b59cec34220d8f8b038662eba47e8f5 + DatadogSDKReactNativeSessionReplay: fc4be259fa3f8a72530b46c739721122b5f5712d + DatadogSDKReactNativeWebView: 7ab3a76e03fa9f5f368c15432b1c733af83843a8 DoubleConversion: f16ae600a246532c4020132d54af21d0ddb2a385 fast_float: 06eeec4fe712a76acc9376682e4808b05ce978b6 FBLazyVector: 7605ea4810e0e10ae4815292433c09bf4324ba45 @@ -1985,8 +1915,6 @@ SPEC CHECKSUMS: glog: 08b301085f15bcbb6ff8632a8ebaf239aae04e6a hermes-engine: 9e868dc7be781364296d6ee2f56d0c1a9ef0bb11 HMSegmentedControl: 34c1f54d822d8308e7b24f5d901ec674dfa31352 - KSCrash: 8c4464fd5da7de520f2ce4a00fdf63f169a80f18 - OpenTelemetry-Swift-Api: 3be9043f6288eb4ac3cbe7548b5bd45fb4ed5849 RCT-Folly: ea9d9256ba7f9322ef911169a9f696e5857b9e17 RCTDeprecation: ebe712bb05077934b16c6bf25228bdec34b64f83 RCTRequired: ca91e5dd26b64f577b528044c962baf171c6b716 @@ -1996,63 +1924,63 @@ SPEC CHECKSUMS: React-Core: 0a06707a0b34982efc4a556aff5dae4b22863455 React-CoreModules: 907334e94314189c2e5eed4877f3efe7b26d85b0 React-cxxreact: 3a1d5e8f4faa5e09be26614e9c8bbcae8d11b73d - React-debug: 817160c07dc8d24d020fbd1eac7b3558ffc08964 - React-defaultsnativemodule: a965cb39fb0a79276ab611793d39f52e59a9a851 - React-domnativemodule: d647f94e503c62c44f54291334b1aa22a30fa08b - React-Fabric: 64586dc191fc1c170372a638b8e722e4f1d0a09b - React-FabricComponents: b0ebd032387468ea700574c581b139f57a7497fb - React-FabricImage: 81f0e0794caf25ad1224fa406d288fbc1986607f - React-featureflags: f2792b067a351d86fdc7bec23db3b9a2f2c8d26c - React-featureflagsnativemodule: 95a02d895475de8ace78fedd76143866838bb720 - React-graphics: cbebe910e4a15b65b0bff94a4d3ed278894d6386 + React-debug: f1956672cf545729afb71ef838a9789c2a9088f5 + React-defaultsnativemodule: f5e33b59be56f54f0e6c1991db55ddbc6de39181 + React-domnativemodule: 73f26e6bc782ca358497fbed427035ea01fcc297 + React-Fabric: 80d7bc9d0ea7981a188b1ea6a67df072af164489 + React-FabricComponents: 1887b9027e7da5679f099b999dc56b44dbc7628c + React-FabricImage: 27996e41c769616bb68f011362bf69c472a6b2f7 + React-featureflags: dc9c91fcd6a75cc95bd7fec184d0be8ad0f26db5 + React-featureflagsnativemodule: 1a0c73dca4158da552f074d469066d317c6a0570 + React-graphics: fa15bab1a7d44a57eeb54e3185117729b141ed4b React-hermes: ec18c10f5a69d49fb9b5e17ae95494e9ea13d4d3 - React-idlecallbacksnativemodule: 0c1ae840cc5587197cd926a3cb76828ad059d116 - React-ImageManager: f2a4c01c2ccb2193e60a20c135da74c7ca4d36f2 - React-jserrorhandler: 61d205b5a7cbc57fed3371dd7eed48c97f49fc64 + React-idlecallbacksnativemodule: 1e13269b40e163fe92cb1774a24bbe607beb0242 + React-ImageManager: 1a6f5a858f86bc93bf210a88ec5575ff22b69aaa + React-jserrorhandler: ea750869c2aa5497b3d9322afe02eb7f756b9696 React-jsi: 95f7676103137861b79b0f319467627bcfa629ee React-jsiexecutor: 41e0fe87cda9ea3970ffb872ef10f1ff8dbd1932 - React-jsinspector: 15578208796723e5c6f39069b6e8bf36863ef6e2 - React-jsitracing: 3758cdb155ea7711f0e77952572ea62d90c69f0b + React-jsinspector: 74c73f2b385b6a7979eddeba055961e9acc3cc42 + React-jsitracing: 182a6d4af2273f847daa8a3f841fd3ff8212d3f8 React-logger: dbca7bdfd4aa5ef69431362bde6b36d49403cb20 - React-Mapbuffer: 6efad4a606c1fae7e4a93385ee096681ef0300dc - React-microtasksnativemodule: 8732b71aa66045da4bb341ddee1bb539f71e5f38 + React-Mapbuffer: 129fa9634f42d88a0c3761d2829db85175b985ee + React-microtasksnativemodule: 5aeec323cb452dba293815d82bf08d7076e295d0 react-native-crash-tester: 3ffaa64141427ca362079cb53559fe9a532487ae react-native-safe-area-context: 04803a01f39f31cc6605a5531280b477b48f8a88 - react-native-webview: 1e12de2fad74c17b4f8b1b53ebd1e3baa0148d71 - React-nativeconfig: 8efdb1ef1e9158c77098a93085438f7e7b463678 - React-NativeModulesApple: 958d4f6c5c2ace4c0f427cf7ef82e28ae6538a22 + react-native-webview: f0a8c96e34ec192f88eaf48c00fbefe415dd6ed2 + React-nativeconfig: 415626a63057638759bcc75e0a96e2e07771a479 + React-NativeModulesApple: bffc60f55895c2723b1e5472fa40567fe3df4923 React-perflogger: 9b4f13c0afe56bc7b4a0e93ec74b1150421ee22d - React-performancetimeline: 359db1cb889aa0282fafc5838331b0987c4915a9 + React-performancetimeline: 128acbcdacb8a5ee73aa4a2bf28db4e8627f111b React-RCTActionSheet: aacf2375084dea6e7c221f4a727e579f732ff342 React-RCTAnimation: d8c82deebebe3aaf7a843affac1b57cb2dc073d4 React-RCTAppDelegate: 6c0377d9c4058773ea7073bb34bb9ebd6ddf5a84 React-RCTBlob: 70a58c11a6a3500d1a12f2e51ca4f6c99babcff8 - React-RCTFabric: 7eb6dd2c8fda98cb860a572e3f4e4eb60d62c89e + React-RCTFabric: dba2f65bcfcede5e0b2ed7df48247cdb16f21f20 React-RCTImage: 5e9d655ba6a790c31e3176016f9b47fd0978fbf0 React-RCTLinking: 2a48338252805091f7521eaf92687206401bdf2a React-RCTNetwork: 0c1282b377257f6b1c81934f72d8a1d0c010e4c3 React-RCTSettings: f757b679a74e5962be64ea08d7865a7debd67b40 React-RCTText: e7d20c490b407d3b4a2daa48db4bcd8ec1032af2 React-RCTVibration: 8228e37144ca3122a91f1de16ba8e0707159cfec - React-rendererconsistency: b4917053ecbaa91469c67a4319701c9dc0d40be6 - React-rendererdebug: 81becbc8852b38d9b1b68672aa504556481330d5 - React-rncore: 120d21715c9b4ba8f798bffe986cb769b988dd74 - React-RuntimeApple: 52ed0e9e84a7c2607a901149fb13599a3c057655 - React-RuntimeCore: ca6189d2e53d86db826e2673fe8af6571b8be157 + React-rendererconsistency: b89c074e22ca2b9eaa8013e1310c69db85364893 + React-rendererdebug: 383e6c8c8d9ee45e88e5d461ad1c6a4a7a0f9282 + React-rncore: 2a6efd857e10a3b299f8a7fe912fd332aa7e515a + React-RuntimeApple: f07537b48b715b6dd7a8d6145f4f6684d78984cc + React-RuntimeCore: cce02c6ade4d7e8d1854d275c9b367b913ed1fb3 React-runtimeexecutor: 877596f82f5632d073e121cba2d2084b76a76899 - React-RuntimeHermes: 3b752dc5d8a1661c9d1687391d6d96acfa385549 - React-runtimescheduler: 8321bb09175ace2a4f0b3e3834637eb85bf42ebe - React-timing: 331cbf9f2668c67faddfd2e46bb7f41cbd9320b9 - React-utils: 54df9ada708578c8ad40d92895d6fed03e0e8a9e - ReactCodegen: 21a52ccddc6479448fc91903a437dd23ddc7366c - ReactCommon: bfd3600989d79bc3acbe7704161b171a1480b9fd + React-RuntimeHermes: ec8b23b1a86022e9831ab775d1634fcbc7dfc500 + React-runtimescheduler: 222c73a654f32e3544a1384b2ced809bd51df2af + React-timing: a693c531e5627dcc200fc7286cbbebf73d73469d + React-utils: 52cb73e127a39fc2d9f02f503b2a7b3b0abd23dd + ReactCodegen: 31fcff227d0035956575be0c013a2edcc687a53c + ReactCommon: 78c49c7cf7df16983ebc3c646b4f47398437f2ec ReactNativeNavigation: 50c1eef68b821e7265eff3a391d27ed18fdce459 RNCAsyncStorage: 23e56519cc41d3bade3c8d4479f7760cb1c11996 - RNGestureHandler: 950dfa674dbf481460ca389c65b9036ac4ab8ada - RNScreens: 606ab1cf68162f7ba0d049a31f2a84089a6fffb4 + RNGestureHandler: 8d00cc737b38b7b67be2d9438242850182291fb4 + RNScreens: da5922094c3a1d9ce10625888b185798523b58ed SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748 - Yoga: feb4910aba9742cfedc059e2b2902e22ffe9954a + Yoga: 1259c7a8cbaccf7b4c3ddf8ee36ca11be9dee407 -PODFILE CHECKSUM: a2729cbf6c0a559932ef8f49d27110873b77ff7d +PODFILE CHECKSUM: 04d9739a3e9c4afbe3a81d5f7ddf602c423f0e9a COCOAPODS: 1.16.2 diff --git a/example/ios/ddSdkReactnativeExample/PrivacyInfo.xcprivacy b/example/ios/ddSdkReactnativeExample/PrivacyInfo.xcprivacy index bad327615..41b8317f0 100644 --- a/example/ios/ddSdkReactnativeExample/PrivacyInfo.xcprivacy +++ b/example/ios/ddSdkReactnativeExample/PrivacyInfo.xcprivacy @@ -6,18 +6,18 @@ NSPrivacyAccessedAPIType - NSPrivacyAccessedAPICategoryUserDefaults + NSPrivacyAccessedAPICategoryFileTimestamp NSPrivacyAccessedAPITypeReasons - CA92.1 + C617.1 NSPrivacyAccessedAPIType - NSPrivacyAccessedAPICategoryFileTimestamp + NSPrivacyAccessedAPICategoryUserDefaults NSPrivacyAccessedAPITypeReasons - C617.1 + CA92.1 diff --git a/packages/core/DatadogSDKReactNative.podspec b/packages/core/DatadogSDKReactNative.podspec index e04f5fc2e..841ad0d47 100644 --- a/packages/core/DatadogSDKReactNative.podspec +++ b/packages/core/DatadogSDKReactNative.podspec @@ -2,6 +2,21 @@ require "json" package = JSON.parse(File.read(File.join(__dir__, "package.json"))) +# /!\ Remember to keep this version in sync with the other Datadog podspecs: +# - DatadogSDKReactNativeSessionReplay.podspec +# - DatadogSDKReactNativeWebView.podspec +# - DatadogInternalTesting.podspec +datadog_ios_version = '3.16.0' +datadog_ios_spm_url = 'https://github.com/DataDog/dd-sdk-ios.git' + +# The native iOS SDK is resolved through Swift Package Manager, using React Native's +# `spm_dependency` podspec helper. This requires React Native >= 0.75 and an app that links +# pods as dynamic frameworks (`use_frameworks! :linkage => :dynamic`). +if !respond_to?(:spm_dependency, true) + raise "Datadog: the native iOS SDK is resolved through Swift Package Manager, which requires " \ + "React Native >= 0.75 -- the first version to ship the `spm_dependency` podspec helper." +end + Pod::Spec.new do |s| s.name = "DatadogSDKReactNative" s.version = package["version"] @@ -18,16 +33,27 @@ Pod::Spec.new do |s| s.dependency "React-Core" - # /!\ Remember to keep the versions in sync with DatadogSDKReactNativeSessionReplay.podspec - s.dependency 'DatadogCore', '3.16.0' - s.dependency 'DatadogLogs', '3.16.0' - s.dependency 'DatadogTrace', '3.16.0' - s.dependency 'DatadogRUM', '3.16.0' - s.dependency 'DatadogCrashReporting', '3.16.0' - s.dependency 'DatadogFlags', '3.16.0' - - # DatadogWebViewTracking is not available for tvOS - s.ios.dependency 'DatadogWebViewTracking', '3.16.0' + # `spm_dependency` cannot be scoped per-platform the way `s.ios.dependency` can, so + # DatadogWebViewTracking is requested for every platform here. Our Swift sources already + # guard the import with `#if os(iOS)`, but dd-sdk-ios declares the product for all of its + # package platforms — building this pod for tvOS through SPM is therefore untested. + # + # Note that DatadogInternal is deliberately absent: it is an internal target of + # dd-sdk-ios, not an exported SPM product, so it cannot be requested here. Making it + # importable takes an extra search path -- see the FRAMEWORK_SEARCH_PATHS note below. + spm_dependency(s, + url: datadog_ios_spm_url, + requirement: { kind: 'exactVersion', version: datadog_ios_version }, + products: [ + 'DatadogCore', + 'DatadogLogs', + 'DatadogTrace', + 'DatadogRUM', + 'DatadogCrashReporting', + 'DatadogFlags', + 'DatadogWebViewTracking' + ] + ) s.test_spec 'Tests' do |test_spec| test_spec.source_files = 'ios/Tests/**/*.{swift,json}' @@ -35,11 +61,34 @@ Pod::Spec.new do |s| test_spec.platforms = { :ios => "13.4", :tvos => "13.4" } end + # DatadogInternal is an internal target of dd-sdk-ios rather than an exported product, so + # SwiftPM builds it into PackageFrameworks/ instead of emitting a bare .swiftmodule alongside + # the products. React Native's `spm_dependency` helper only appends the products directory to + # SWIFT_INCLUDE_PATHS, which leaves the module invisible to the compiler. Our sources import it + # for AnyEncodable, CoreRegistry, DatadogCoreProtocol and FeatureScope, so add the directory + # holding the package frameworks explicitly. + # + # Note this cannot be written against BUILT_PRODUCTS_DIR: CocoaPods gives every pod target its + # own CONFIGURATION_BUILD_DIR, so for this target BUILT_PRODUCTS_DIR is + # //DatadogSDKReactNative, one level below where SwiftPM actually + # writes PackageFrameworks/. Spelling it as SYMROOT/CONFIGURATION+EFFECTIVE_PLATFORM_NAME + # matches what `spm_dependency` itself uses for SWIFT_INCLUDE_PATHS. + datadog_spm_xcconfig = { + 'FRAMEWORK_SEARCH_PATHS' => '$(inherited) "$(SYMROOT)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/PackageFrameworks"' + } + + xcconfig = datadog_spm_xcconfig.dup + if ENV['RCT_NEW_ARCH_ENABLED'] == '1' - s.pod_target_xcconfig = { + xcconfig.merge!({ "DEFINES_MODULE" => "YES", "OTHER_CPLUSPLUSFLAGS" => "-DRCT_NEW_ARCH_ENABLED=1" - } + }) + + # Assign before install_modules_dependencies: the helper reads the spec's current + # pod_target_xcconfig, merges React Native's own header search paths and C++ settings into it + # and assigns the result back, so assigning afterwards would drop everything it added. + s.pod_target_xcconfig = xcconfig # install_modules_dependencies is only available on RN >= 0.71 if respond_to?(:install_modules_dependencies, true) @@ -47,5 +96,7 @@ Pod::Spec.new do |s| else Pod::UI.warn "Using Datadog React Native SDK with new architecture on RN < 0.71 is discouraged and not officially supported." end + else + s.pod_target_xcconfig = xcconfig end end diff --git a/packages/core/README.md b/packages/core/README.md index 6b61e7510..ecd93a410 100644 --- a/packages/core/README.md +++ b/packages/core/README.md @@ -16,7 +16,13 @@ To install with Yarn, run: yarn add @datadog/mobile-react-native ``` -**Minimum React Native version**: SDK supports React Native version 0.63.4 or higher. Compatibility with older versions is not guaranteed out of the box. +**Minimum React Native version**: SDK supports React Native version 0.63.4 or higher on Android. On iOS, the native SDK is resolved through Swift Package Manager, which requires React Native 0.75 or higher. + +**iOS setup**: your app's `Podfile` must link pods as dynamic frameworks: + +```ruby +use_frameworks! :linkage => :dynamic +``` Versions `1.0.0-rc5` and higher require you to have `compileSdkVersion = 31` in the Android application setup, which implies that you should use Build Tools version 31, Android Gradle Plugin version 7, and Gradle version 7 or higher. To modify the versions, change the values in the `buildscript.ext` block of your application's top-level `build.gradle` file. Datadog recommends using React Native version 0.67 or higher. diff --git a/packages/core/ios/Tests/AnyEncodableTests.swift b/packages/core/ios/Tests/AnyEncodableTests.swift index ef20db530..ae8943c31 100644 --- a/packages/core/ios/Tests/AnyEncodableTests.swift +++ b/packages/core/ios/Tests/AnyEncodableTests.swift @@ -4,6 +4,7 @@ * Copyright 2019-2020 Datadog, Inc. */ +import Foundation import XCTest @testable import DatadogSDKReactNative @testable import DatadogInternal diff --git a/packages/core/ios/Tests/DatadogSdkWrapperTests.swift b/packages/core/ios/Tests/DatadogSdkWrapperTests.swift index a445b2bbe..5be27d58e 100644 --- a/packages/core/ios/Tests/DatadogSdkWrapperTests.swift +++ b/packages/core/ios/Tests/DatadogSdkWrapperTests.swift @@ -4,6 +4,7 @@ * Copyright 2019-2020 Datadog, Inc. */ +import Foundation import XCTest @testable import DatadogSDKReactNative import DatadogTrace diff --git a/packages/core/ios/Tests/DdFlagsTests.swift b/packages/core/ios/Tests/DdFlagsTests.swift index 3fca72ddc..80cc00b95 100644 --- a/packages/core/ios/Tests/DdFlagsTests.swift +++ b/packages/core/ios/Tests/DdFlagsTests.swift @@ -4,6 +4,7 @@ * Copyright 2016-Present Datadog, Inc. */ +import Foundation import XCTest import DatadogCore @_spi(Internal) diff --git a/packages/core/ios/Tests/DdLogsTests.swift b/packages/core/ios/Tests/DdLogsTests.swift index 390c947d4..253ec213e 100644 --- a/packages/core/ios/Tests/DdLogsTests.swift +++ b/packages/core/ios/Tests/DdLogsTests.swift @@ -4,6 +4,7 @@ * Copyright 2019-2020 Datadog, Inc. */ +import Foundation import XCTest @testable import DatadogSDKReactNative import DatadogLogs diff --git a/packages/core/ios/Tests/DdRumTests.swift b/packages/core/ios/Tests/DdRumTests.swift index 3a8fca2e6..05c9df89b 100644 --- a/packages/core/ios/Tests/DdRumTests.swift +++ b/packages/core/ios/Tests/DdRumTests.swift @@ -4,6 +4,7 @@ * Copyright 2019-2020 Datadog, Inc. */ +import Foundation import XCTest @testable import DatadogCore @testable import DatadogRUM diff --git a/packages/core/ios/Tests/DdSdkNativeInitializationTests.swift b/packages/core/ios/Tests/DdSdkNativeInitializationTests.swift index cb6a6c500..eee47deb9 100644 --- a/packages/core/ios/Tests/DdSdkNativeInitializationTests.swift +++ b/packages/core/ios/Tests/DdSdkNativeInitializationTests.swift @@ -4,6 +4,7 @@ * Copyright 2019-Present Datadog, Inc. */ +import Foundation import XCTest @testable import DatadogCore @testable import DatadogSDKReactNative diff --git a/packages/core/ios/Tests/DdSdkSessionStartedListenerTests.swift b/packages/core/ios/Tests/DdSdkSessionStartedListenerTests.swift index c891dc8e4..5f6e2d8ca 100644 --- a/packages/core/ios/Tests/DdSdkSessionStartedListenerTests.swift +++ b/packages/core/ios/Tests/DdSdkSessionStartedListenerTests.swift @@ -4,6 +4,7 @@ * Copyright 2019-Present Datadog, Inc. */ +import Foundation import XCTest @testable import DatadogSDKReactNative @testable import React diff --git a/packages/core/ios/Tests/DdSdkTests.swift b/packages/core/ios/Tests/DdSdkTests.swift index bc13c4f98..5642da954 100644 --- a/packages/core/ios/Tests/DdSdkTests.swift +++ b/packages/core/ios/Tests/DdSdkTests.swift @@ -4,6 +4,7 @@ * Copyright 2019-2020 Datadog, Inc. */ +import Foundation import XCTest @testable import DatadogCore diff --git a/packages/core/ios/Tests/DdTraceTests.swift b/packages/core/ios/Tests/DdTraceTests.swift index 3de9978ee..141fe93a2 100644 --- a/packages/core/ios/Tests/DdTraceTests.swift +++ b/packages/core/ios/Tests/DdTraceTests.swift @@ -4,6 +4,7 @@ * Copyright 2019-2020 Datadog, Inc. */ +import Foundation import XCTest @testable import DatadogSDKReactNative @testable import DatadogCore diff --git a/packages/core/ios/Tests/GlobalStateTests.swift b/packages/core/ios/Tests/GlobalStateTests.swift index 1def8ad6a..f7f87e7fc 100644 --- a/packages/core/ios/Tests/GlobalStateTests.swift +++ b/packages/core/ios/Tests/GlobalStateTests.swift @@ -4,6 +4,7 @@ * Copyright 2019-Present Datadog, Inc. */ +import Foundation import XCTest @testable import DatadogSDKReactNative diff --git a/packages/core/ios/Tests/ModulesTest.swift b/packages/core/ios/Tests/ModulesTest.swift index d8f1f0358..8d1f47a9e 100644 --- a/packages/core/ios/Tests/ModulesTest.swift +++ b/packages/core/ios/Tests/ModulesTest.swift @@ -4,6 +4,7 @@ * Copyright 2016-Present Datadog, Inc. */ +import Foundation import XCTest @testable import DatadogSDKReactNative @testable import React diff --git a/packages/core/ios/Tests/RNDdSdkConfigurationTests.swift b/packages/core/ios/Tests/RNDdSdkConfigurationTests.swift index 00e73e399..65855fad6 100644 --- a/packages/core/ios/Tests/RNDdSdkConfigurationTests.swift +++ b/packages/core/ios/Tests/RNDdSdkConfigurationTests.swift @@ -4,6 +4,7 @@ * Copyright 2019-Present Datadog, Inc. */ +import Foundation import XCTest @testable import DatadogSDKReactNative @testable import DatadogInternal diff --git a/packages/core/ios/Tests/TvOSCompatibilityTests.swift b/packages/core/ios/Tests/TvOSCompatibilityTests.swift index 19434248d..16884980a 100644 --- a/packages/core/ios/Tests/TvOSCompatibilityTests.swift +++ b/packages/core/ios/Tests/TvOSCompatibilityTests.swift @@ -7,12 +7,20 @@ import Foundation import XCTest -/// `DatadogWebViewTracking` and the `consumeWebviewEvent` bridge method are iOS-only (the -/// framework isn't published for tvOS, see the podspec's `s.ios.dependency 'DatadogWebViewTracking'`). +/// `DatadogWebViewTracking` and the `consumeWebviewEvent` bridge method are iOS-only in our own +/// code. This used to also be true one level down: the podspec's `s.ios.dependency +/// 'DatadogWebViewTracking'` meant the pod dependency itself was never pulled in on tvOS. Now that +/// the native SDK is resolved through SwiftPM, `spm_dependency` cannot be scoped per platform (see +/// the podspec), so the product is requested unconditionally instead. Confirmed with a standalone +/// scratch SPM package (outside this repo, since it has no tvOS build target of its own) that +/// `DatadogWebViewTracking` 3.16.0 itself still compiles cleanly for tvOS -- but that only checks +/// dd-sdk-ios's own product in isolation, not this whole pod (React-Core, the FRAMEWORK_SEARCH_PATHS +/// and OTHER_LDFLAGS workarounds in the podspec, ...) built and linked for tvOS end to end. /// /// This test statically enforces that every reference to these symbols in `Sources` is wrapped in /// a platform guard (`#if os(iOS)` for Swift, `#if TARGET_OS_IOS` for Objective-C++), as a -/// lightweight substitute for an actual tvOS build. +/// lightweight substitute for an actual tvOS build. It only covers our own code, not whether the +/// dependency resolves for tvOS in the first place. final class TvOSCompatibilityTests: XCTestCase { private static let iOSOnlySymbols = ["DatadogWebViewTracking", "WebViewTracking", "consumeWebviewEvent"] diff --git a/packages/internal-testing-tools/DatadogInternalTesting.podspec b/packages/internal-testing-tools/DatadogInternalTesting.podspec index 46087cf81..72adfac4b 100644 --- a/packages/internal-testing-tools/DatadogInternalTesting.podspec +++ b/packages/internal-testing-tools/DatadogInternalTesting.podspec @@ -2,6 +2,18 @@ require "json" package = JSON.parse(File.read(File.join(__dir__, "package.json"))) +# /!\ Remember to keep this version in sync with DatadogSDKReactNative.podspec +datadog_ios_version = '3.16.0' +datadog_ios_spm_url = 'https://github.com/DataDog/dd-sdk-ios.git' + +# The native iOS SDK is resolved through Swift Package Manager, using React Native's +# `spm_dependency` podspec helper. This requires React Native >= 0.75 and an app that links +# pods as dynamic frameworks (`use_frameworks! :linkage => :dynamic`). +if !respond_to?(:spm_dependency, true) + raise "Datadog: the native iOS SDK is resolved through Swift Package Manager, which requires " \ + "React Native >= 0.75 -- the first version to ship the `spm_dependency` podspec helper." +end + Pod::Spec.new do |s| s.name = "DatadogInternalTesting" s.version = package["version"] @@ -18,20 +30,66 @@ Pod::Spec.new do |s| s.dependency "React-Core" s.dependency "DatadogSDKReactNative" - + + # DatadogCore and DatadogInternal do not reach this pod through DatadogSDKReactNative: + # React Native's `spm_dependency` helper adds the SPM build-products directory to + # SWIFT_INCLUDE_PATHS per pod target, so this target only gets it by declaring its own SPM + # dependency. Our sources import both DatadogCore and DatadogInternal. + spm_dependency(s, + url: datadog_ios_spm_url, + requirement: { kind: 'exactVersion', version: datadog_ios_version }, + products: ['DatadogCore'] + ) + s.test_spec 'Tests' do |test_spec| test_spec.source_files = 'ios/Tests/*.swift' + + # DatadogCore resolves the same way it does for DatadogSDKReactNative's own test spec: as a + # declared SPM product, its .framework sits at the top-level SYMROOT/CONFIGURATION directory, + # which Xcode searches implicitly for any target with no CONFIGURATION_BUILD_DIR override of + # its own -- true here since test specs don't get the per-pod-target override main pod targets + # do. DatadogInternal needs the explicit help below because it is not a product: it lives one + # level down, in PackageFrameworks/. + test_spec.pod_target_xcconfig = { + 'FRAMEWORK_SEARCH_PATHS' => '$(inherited) "$(SYMROOT)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/PackageFrameworks"', + 'OTHER_LDFLAGS' => '$(inherited) -framework DatadogInternal' + } end # This guard prevents installing the dependencies when we run `pod install` in the old architecture. # The `install_modules_dependencies` function is only available from RN 0.71, the new architecture is not # supported on earlier RN versions. + # DatadogInternal is an internal target of dd-sdk-ios rather than an exported product, so + # SwiftPM builds it into PackageFrameworks/ instead of emitting a bare .swiftmodule alongside + # the products. React Native's `spm_dependency` helper only appends the products directory to + # SWIFT_INCLUDE_PATHS, which leaves the module invisible to the compiler. Our sources import it + # for AnyEncodable, CoreRegistry, DatadogCoreProtocol and FeatureScope, so add the directory + # holding the package frameworks explicitly. + # + # Note this cannot be written against BUILT_PRODUCTS_DIR: CocoaPods gives every pod target its + # own CONFIGURATION_BUILD_DIR, so for this target BUILT_PRODUCTS_DIR is + # //DatadogSDKReactNative, one level below where SwiftPM actually + # writes PackageFrameworks/. Spelling it as SYMROOT/CONFIGURATION+EFFECTIVE_PLATFORM_NAME + # matches what `spm_dependency` itself uses for SWIFT_INCLUDE_PATHS. + datadog_spm_xcconfig = { + 'FRAMEWORK_SEARCH_PATHS' => '$(inherited) "$(SYMROOT)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/PackageFrameworks"' + } + + xcconfig = datadog_spm_xcconfig.dup + if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then - s.pod_target_xcconfig = { + xcconfig.merge!({ "DEFINES_MODULE" => "YES", "OTHER_CPLUSPLUSFLAGS" => "-DRCT_NEW_ARCH_ENABLED=1" - } + }) + + # Assign before install_modules_dependencies: the helper reads the spec's current + # pod_target_xcconfig, merges React Native's own header search paths and C++ settings into it + # and assigns the result back, so assigning afterwards would drop everything it added. + s.pod_target_xcconfig = xcconfig install_modules_dependencies(s) + else + s.pod_target_xcconfig = xcconfig end end diff --git a/packages/internal-testing-tools/ios/Tests/DdInternalTestingTests.swift b/packages/internal-testing-tools/ios/Tests/DdInternalTestingTests.swift index 50e93269c..419028f37 100644 --- a/packages/internal-testing-tools/ios/Tests/DdInternalTestingTests.swift +++ b/packages/internal-testing-tools/ios/Tests/DdInternalTestingTests.swift @@ -4,6 +4,7 @@ * Copyright 2019-2020 Datadog, Inc. */ +import Foundation import XCTest @testable import DatadogInternalTesting @testable import DatadogSDKReactNative diff --git a/packages/react-native-session-replay/DatadogSDKReactNativeSessionReplay.podspec b/packages/react-native-session-replay/DatadogSDKReactNativeSessionReplay.podspec index a78a62ca4..8588b735c 100644 --- a/packages/react-native-session-replay/DatadogSDKReactNativeSessionReplay.podspec +++ b/packages/react-native-session-replay/DatadogSDKReactNativeSessionReplay.podspec @@ -2,6 +2,18 @@ require "json" package = JSON.parse(File.read(File.join(__dir__, "package.json"))) +# /!\ Remember to keep this version in sync with DatadogSDKReactNative.podspec +datadog_ios_version = '3.16.0' +datadog_ios_spm_url = 'https://github.com/DataDog/dd-sdk-ios.git' + +# The native iOS SDK is resolved through Swift Package Manager, using React Native's +# `spm_dependency` podspec helper. This requires React Native >= 0.75 and an app that links +# pods as dynamic frameworks (`use_frameworks! :linkage => :dynamic`). +if !respond_to?(:spm_dependency, true) + raise "Datadog: the native iOS SDK is resolved through Swift Package Manager, which requires " \ + "React Native >= 0.75 -- the first version to ship the `spm_dependency` podspec helper." +end + Pod::Spec.new do |s| s.name = "DatadogSDKReactNativeSessionReplay" s.version = package["version"] @@ -15,20 +27,49 @@ Pod::Spec.new do |s| s.source_files = "ios/Sources/**/*.{h,m,mm,swift}" - s.resource_bundles = { - 'DDSessionReplay' => ['assets/assets.json', 'assets/assets.bin'] - } + # A CocoaPods resource bundle would create a second target (`-DDSessionReplay`) whose + # CONFIGURATION_BUILD_DIR is pinned, inline in the generated project, to the pod-scoped + # //DatadogSDKReactNativeSessionReplay. When the pod also declares an + # SPM dependency, Xcode picks that bundle target as the host for the package's own resource + # bundles (Datadog_DatadogRUM.bundle, KSCrash_*.bundle, ...) and emits implicit copy tasks that + # read them from that pod-scoped directory -- while SwiftPM writes them to the shared products + # root one level up. The copies then fail with "no such file", and because the build dir is set + # inline rather than through the pod's xcconfig there is no way to redirect them from a podspec. + # Ship the two assets as plain resources instead: with no bundle target there is nothing for + # Xcode to mis-host, and it embeds the package resources into the app target as it does for the + # other Datadog pods. Bundle+SessionReplay.swift handles both layouts. + s.resources = ['assets/assets.json', 'assets/assets.bin'] s.dependency "React-Core" - - # /!\ Remember to keep the version in sync with DatadogSDKReactNative.podspec - s.dependency 'DatadogSessionReplay', '3.16.0' + # RCTTextExtractor.mm references RCTTextView and the RCTText shadow view classes directly, so + # this pod has always had a link-time dependency on React-RCTText. It was only declared on the + # test spec, which went unnoticed while pods were linked statically and undefined symbols were + # deferred to the app link. + s.dependency "React-RCTText" s.dependency 'DatadogSDKReactNative' + # DatadogInternal is an internal target of dd-sdk-ios rather than an exported product, so it + # cannot be requested here. Making it importable takes an extra search path -- see the + # FRAMEWORK_SEARCH_PATHS note below. + spm_dependency(s, + url: datadog_ios_spm_url, + requirement: { kind: 'exactVersion', version: datadog_ios_version }, + products: ['DatadogSessionReplay'] + ) + + # React-RCTText is not repeated here: it is declared on the main spec above, which the test spec + # inherits. s.test_spec 'Tests' do |test_spec| - test_spec.dependency "React-RCTText" test_spec.source_files = 'ios/Tests/*.swift' test_spec.platforms = { :ios => "13.4", :tvos => "13.4" } + + # The tests reference DatadogInternal protocol descriptors (Storage, Telemetry) directly. Unlike + # the SPM products, DatadogInternal is not on this target's link line, so name it explicitly -- + # and point the linker at PackageFrameworks, where SwiftPM writes non-product targets. + test_spec.pod_target_xcconfig = { + 'FRAMEWORK_SEARCH_PATHS' => '$(inherited) "$(SYMROOT)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/PackageFrameworks"', + 'OTHER_LDFLAGS' => '$(inherited) -framework DatadogInternal' + } end header_paths = %W[ @@ -42,11 +83,29 @@ Pod::Spec.new do |s| $(PODS_CONFIGURATION_BUILD_DIR)/React-timing/React_timing.framework/Headers/** ].join(' ') + # DatadogInternal is an internal target of dd-sdk-ios rather than an exported product, so + # SwiftPM builds it into PackageFrameworks/ instead of emitting a bare .swiftmodule alongside + # the products. React Native's `spm_dependency` helper only appends the products directory to + # SWIFT_INCLUDE_PATHS, which leaves the module invisible to the compiler. Our sources import it + # for AnyEncodable, CoreRegistry, DatadogCoreProtocol and FeatureScope, so add the directory + # holding the package frameworks explicitly. + # + # Note this cannot be written against BUILT_PRODUCTS_DIR: CocoaPods gives every pod target its + # own CONFIGURATION_BUILD_DIR, so for this target BUILT_PRODUCTS_DIR is + # //DatadogSDKReactNative, one level below where SwiftPM actually + # writes PackageFrameworks/. Spelling it as SYMROOT/CONFIGURATION+EFFECTIVE_PLATFORM_NAME + # matches what `spm_dependency` itself uses for SWIFT_INCLUDE_PATHS. + datadog_spm_xcconfig = { + 'FRAMEWORK_SEARCH_PATHS' => '$(inherited) "$(SYMROOT)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/PackageFrameworks"' + } + xcconfig = { 'HEADER_SEARCH_PATHS' => header_paths, 'USER_HEADER_SEARCH_PATHS' => header_paths, } + xcconfig.merge!(datadog_spm_xcconfig) + if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then s.compiler_flags = "-DRCT_NEW_ARCH_ENABLED=1" diff --git a/packages/react-native-session-replay/README.md b/packages/react-native-session-replay/README.md index 4b019a86e..765f7fa98 100644 --- a/packages/react-native-session-replay/README.md +++ b/packages/react-native-session-replay/README.md @@ -18,6 +18,12 @@ To install with Yarn, run: yarn add @datadog/mobile-react-native-session-replay ``` +**iOS setup**: the native iOS SDK is resolved through Swift Package Manager, which requires React Native 0.75 or higher and your app's `Podfile` to link pods as dynamic frameworks: + +```ruby +use_frameworks! :linkage => :dynamic +``` + ## Enable Session Replay To enable Session Replay, import and call the `enable` method with your configuration. Below is an example setup: diff --git a/packages/react-native-session-replay/ios/Sources/Utils/Bundle+SessionReplay.swift b/packages/react-native-session-replay/ios/Sources/Utils/Bundle+SessionReplay.swift index 17e6f2d10..aae98deba 100644 --- a/packages/react-native-session-replay/ios/Sources/Utils/Bundle+SessionReplay.swift +++ b/packages/react-native-session-replay/ios/Sources/Utils/Bundle+SessionReplay.swift @@ -16,6 +16,9 @@ extension Bundle { return resourceBundle } - return nil + // When the native iOS SDK is resolved through Swift Package Manager the podspec ships the + // assets as plain resources rather than in a DDSessionReplay bundle, so they sit directly + // in the bundle we just looked in. + return bundle } } diff --git a/packages/react-native-session-replay/ios/Tests/DdSessionReplayTests.swift b/packages/react-native-session-replay/ios/Tests/DdSessionReplayTests.swift index 741f8318a..dfb05c6ef 100644 --- a/packages/react-native-session-replay/ios/Tests/DdSessionReplayTests.swift +++ b/packages/react-native-session-replay/ios/Tests/DdSessionReplayTests.swift @@ -4,6 +4,7 @@ * Copyright 2019-2020 Datadog, Inc. */ +import Foundation import XCTest @testable import DatadogSDKReactNativeSessionReplay import DatadogSessionReplay diff --git a/packages/react-native-session-replay/ios/Tests/RCTTextViewRecorderTests.swift b/packages/react-native-session-replay/ios/Tests/RCTTextViewRecorderTests.swift index 3fd300c51..d27453546 100644 --- a/packages/react-native-session-replay/ios/Tests/RCTTextViewRecorderTests.swift +++ b/packages/react-native-session-replay/ios/Tests/RCTTextViewRecorderTests.swift @@ -4,6 +4,7 @@ * Copyright 2019-2020 Datadog, Inc. */ +import Foundation import XCTest @testable import DatadogSDKReactNativeSessionReplay @_spi(Internal) diff --git a/packages/react-native-webview/DatadogSDKReactNativeWebView.podspec b/packages/react-native-webview/DatadogSDKReactNativeWebView.podspec index 722e76634..b6b36e417 100644 --- a/packages/react-native-webview/DatadogSDKReactNativeWebView.podspec +++ b/packages/react-native-webview/DatadogSDKReactNativeWebView.podspec @@ -2,6 +2,18 @@ require "json" package = JSON.parse(File.read(File.join(__dir__, "package.json"))) +# /!\ Remember to keep this version in sync with DatadogSDKReactNative.podspec +datadog_ios_version = '3.16.0' +datadog_ios_spm_url = 'https://github.com/DataDog/dd-sdk-ios.git' + +# The native iOS SDK is resolved through Swift Package Manager, using React Native's +# `spm_dependency` podspec helper. This requires React Native >= 0.75 and an app that links +# pods as dynamic frameworks (`use_frameworks! :linkage => :dynamic`). +if !respond_to?(:spm_dependency, true) + raise "Datadog: the native iOS SDK is resolved through Swift Package Manager, which requires " \ + "React Native >= 0.75 -- the first version to ship the `spm_dependency` podspec helper." +end + Pod::Spec.new do |s| s.name = "DatadogSDKReactNativeWebView" s.version = package["version"] @@ -17,27 +29,65 @@ Pod::Spec.new do |s| s.source_files = "ios/Sources/*.{h,m,mm,swift}" s.dependency "React-Core" + s.dependency 'DatadogSDKReactNative' - if ENV['USE_FRAMEWORKS'] == 'static' - s.dependency "react-native-webview" - end + # Our headers subclass RNCWebViewImpl / RNCWebViewManager. Under framework linkage those headers + # are only reachable as , which requires react-native-webview to be a + # declared dependency so that CocoaPods puts its build directory on this target's + # FRAMEWORK_SEARCH_PATHS. + s.dependency "react-native-webview" - # /!\ Remember to keep the version in sync with DatadogSDKReactNative.podspec - s.dependency 'DatadogWebViewTracking', '3.16.0' - s.dependency 'DatadogInternal', '3.16.0' - s.dependency 'DatadogSDKReactNative' + # DatadogInternal was previously declared explicitly here, but it is an internal target of + # dd-sdk-ios rather than an exported SPM product, so it cannot be requested. Making it + # importable takes an extra search path -- see the FRAMEWORK_SEARCH_PATHS note below. Compiling + # is not enough to link it, though: unlike DatadogCore and DatadogSessionReplay, the + # DatadogWebViewTracking product's own autolink metadata does not pull DatadogInternal onto this + # target's link line, so RCTDatadogWebViewTracking.swift's direct references to + # DatadogInternal.CoreRegistry and DatadogCoreProtocol are left unresolved at link time + # ("Undefined symbols ... DatadogInternal.CoreRegistry...") unless we link it explicitly too. + spm_dependency(s, + url: datadog_ios_spm_url, + requirement: { kind: 'exactVersion', version: datadog_ios_version }, + products: ['DatadogWebViewTracking'] + ) s.test_spec 'Tests' do |test_spec| test_spec.dependency "react-native-webview" test_spec.dependency "React-RCTText" - + test_spec.source_files = 'ios/Tests/*.swift' test_spec.platforms = { :ios => "13.4", :tvos => "13.4" } + + # The tests reach DatadogInternal directly, which is not on this target's link line because it + # is a target of dd-sdk-ios rather than one of the SPM products this pod requests. + test_spec.pod_target_xcconfig = { + 'FRAMEWORK_SEARCH_PATHS' => '$(inherited) "$(SYMROOT)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/PackageFrameworks"', + 'OTHER_LDFLAGS' => '$(inherited) -framework DatadogInternal' + } end + # DatadogInternal is an internal target of dd-sdk-ios rather than an exported product, so + # SwiftPM builds it into PackageFrameworks/ instead of emitting a bare .swiftmodule alongside + # the products. React Native's `spm_dependency` helper only appends the products directory to + # SWIFT_INCLUDE_PATHS, which leaves the module invisible to the compiler. Our sources import it + # for AnyEncodable, CoreRegistry, DatadogCoreProtocol and FeatureScope, so add the directory + # holding the package frameworks explicitly. + # + # Note this cannot be written against BUILT_PRODUCTS_DIR: CocoaPods gives every pod target its + # own CONFIGURATION_BUILD_DIR, so for this target BUILT_PRODUCTS_DIR is + # //DatadogSDKReactNative, one level below where SwiftPM actually + # writes PackageFrameworks/. Spelling it as SYMROOT/CONFIGURATION+EFFECTIVE_PLATFORM_NAME + # matches what `spm_dependency` itself uses for SWIFT_INCLUDE_PATHS. + datadog_spm_xcconfig = { + 'FRAMEWORK_SEARCH_PATHS' => '$(inherited) "$(SYMROOT)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/PackageFrameworks"' + } + xcconfig = { - "HEADER_SEARCH_PATHS" => "$(PODS_ROOT)/react-native-webview/**" + "HEADER_SEARCH_PATHS" => "$(PODS_ROOT)/react-native-webview/**", + "OTHER_LDFLAGS" => "$(inherited) -framework DatadogInternal" } + + xcconfig.merge!(datadog_spm_xcconfig) # This guard prevents installing the dependencies when we run `pod install` in the old architecture. # The `install_modules_dependencies` function is only available from RN 0.71, the new architecture is not @@ -50,8 +100,13 @@ Pod::Spec.new do |s| "CLANG_CXX_LANGUAGE_STANDARD" => "c++17" }) + # Assign before install_modules_dependencies: the helper reads the spec's current + # pod_target_xcconfig, merges React Native's own header search paths and C++ settings into it + # and assigns the result back, so assigning afterwards would drop everything it added. + s.pod_target_xcconfig = xcconfig + install_modules_dependencies(s) + else + s.pod_target_xcconfig = xcconfig end - - s.pod_target_xcconfig = xcconfig end diff --git a/packages/react-native-webview/README.md b/packages/react-native-webview/README.md index d4cc30ee4..eec23c73e 100644 --- a/packages/react-native-webview/README.md +++ b/packages/react-native-webview/README.md @@ -20,6 +20,12 @@ Set up the RUM Browser SDK on the web page you want rendered on your mobile Reac Add `react-native-webview` to your application following the [official installation documentation][4]. +**iOS setup**: the native iOS SDK is resolved through Swift Package Manager, which requires React Native 0.75 or higher and your app's `Podfile` to link pods as dynamic frameworks: + +```ruby +use_frameworks! :linkage => :dynamic +``` + ### Instrument your web views Import `WebView` from `@datadog/mobile-react-native-webview` instead of `react-native-webview`: diff --git a/packages/react-native-webview/ios/Sources/DatadogSDKReactNativeWebView.h b/packages/react-native-webview/ios/Sources/DatadogSDKReactNativeWebView.h index 70bed4bd8..1fc7489a6 100644 --- a/packages/react-native-webview/ios/Sources/DatadogSDKReactNativeWebView.h +++ b/packages/react-native-webview/ios/Sources/DatadogSDKReactNativeWebView.h @@ -9,4 +9,13 @@ #import "RCTDatadogWebView.h" #import "RCTDatadogWebViewManager.h" +// react-native-webview is a static library under CocoaPods' default linkage, where its public +// headers land flat in Pods/Headers/Public and resolve as a quoted import. When the pod is built +// as a dynamic framework instead -- which is mandatory when the native Datadog iOS SDK is resolved +// through Swift Package Manager --the same header is only reachable +// as . Support both layouts. +#if __has_include() +#import +#else #import "RNCWebViewImpl.h" +#endif diff --git a/packages/react-native-webview/ios/Sources/RCTDatadogWebView.h b/packages/react-native-webview/ios/Sources/RCTDatadogWebView.h index 69b498a3d..3182f5504 100644 --- a/packages/react-native-webview/ios/Sources/RCTDatadogWebView.h +++ b/packages/react-native-webview/ios/Sources/RCTDatadogWebView.h @@ -4,7 +4,16 @@ * Copyright 2016-Present Datadog, Inc. */ +// react-native-webview is a static library under CocoaPods' default linkage, where its public +// headers land flat in Pods/Headers/Public and resolve as a quoted import. When the pod is built +// as a dynamic framework instead -- which is mandatory when the native Datadog iOS SDK is resolved +// through Swift Package Manager -- the same header is only reachable +// as . Support both layouts. +#if __has_include() +#import +#else #import "RNCWebViewImpl.h" +#endif @class RCTDatadogWebView; @@ -14,8 +23,8 @@ @interface RCTDatadogWebView : RNCWebViewImpl -@property (nonatomic, weak) id ddWebViewDelegate; -@property (nonatomic, assign) BOOL isTrackingEnabled; +@property(nonatomic, weak) id ddWebViewDelegate; +@property(nonatomic, assign) BOOL isTrackingEnabled; -- (WKWebView*) getWKWebView; +- (WKWebView *)getWKWebView; @end diff --git a/packages/react-native-webview/ios/Sources/RCTDatadogWebViewManager.h b/packages/react-native-webview/ios/Sources/RCTDatadogWebViewManager.h index 96e0dc2c1..2eb1bfc92 100644 --- a/packages/react-native-webview/ios/Sources/RCTDatadogWebViewManager.h +++ b/packages/react-native-webview/ios/Sources/RCTDatadogWebViewManager.h @@ -4,7 +4,14 @@ * Copyright 2016-Present Datadog, Inc. */ +// See the note in RCTDatadogWebView.h: this header resolves as a quoted import under CocoaPods' +// default static linkage, but only as when the pod is built as a +// dynamic framework. +#if __has_include() +#import +#else #import "RNCWebViewManager.h" +#endif @interface RCTDatadogWebViewManager : RNCWebViewManager @end diff --git a/update-native-sdk-versions.sh b/update-native-sdk-versions.sh index 1c944f708..36b51b409 100755 --- a/update-native-sdk-versions.sh +++ b/update-native-sdk-versions.sh @@ -12,6 +12,7 @@ podspec_files=( "packages/core/DatadogSDKReactNative.podspec" "packages/react-native-session-replay/DatadogSDKReactNativeSessionReplay.podspec" "packages/react-native-webview/DatadogSDKReactNativeWebView.podspec" + "packages/internal-testing-tools/DatadogInternalTesting.podspec" ) # Android build.gradle files @@ -83,7 +84,7 @@ else fi # Get iOS version -extract_and_validate_version podspec_files[@] "dependency 'Datadog.*' *, *'" "s/.*dependency *'Datadog.*, *'\([0-9.]*\).*/\1/" "iOS" ios_version +extract_and_validate_version podspec_files[@] "datadog_ios_version *= *'" "s/.*datadog_ios_version *= *'\([0-9.]*\)'.*/\1/" "iOS" ios_version # Get Android version extract_and_validate_version build_gradle_files[@] "com.datadoghq:dd-sdk-android" 's/.*:\([0-9.]*\).*/\1/' "Android" android_version