diff --git a/packages/core/ios/Sources/DdSdkImplementation.swift b/packages/core/ios/Sources/DdSdkImplementation.swift index 087d56609..92fbaa50c 100644 --- a/packages/core/ios/Sources/DdSdkImplementation.swift +++ b/packages/core/ios/Sources/DdSdkImplementation.swift @@ -157,13 +157,15 @@ public class DdSdkImplementation: NSObject { } func overrideReactNativeTelemetry(rnConfiguration: DdSdkConfiguration, core: DatadogCoreProtocol) -> Void { - // TODO: missing some keys: initializationType, reactVersion, reactNativeVersion, trackNativeErrors - let telemetry = TelemetryCore(core: core) - telemetry.configuration( + core.telemetry.configuration( + initializationType: rnConfiguration.configurationForTelemetry?.initializationType as? String, + reactNativeVersion: rnConfiguration.configurationForTelemetry?.reactNativeVersion as? String, + reactVersion: rnConfiguration.configurationForTelemetry?.reactVersion as? String, trackCrossPlatformLongTasks: rnConfiguration.longTaskThresholdMs != 0, trackErrors: rnConfiguration.configurationForTelemetry?.trackErrors, trackInteractions: rnConfiguration.configurationForTelemetry?.trackInteractions, trackLongTask: rnConfiguration.longTaskThresholdMs != 0, + trackNativeErrors: rnConfiguration.nativeLongTaskThresholdMs != 0, trackNativeLongTasks: rnConfiguration.nativeLongTaskThresholdMs != 0, trackNetworkRequests: rnConfiguration.configurationForTelemetry?.trackNetworkRequests ) diff --git a/packages/core/ios/Tests/DdSdkTests.swift b/packages/core/ios/Tests/DdSdkTests.swift index 0bd1b6baa..0dc757a60 100644 --- a/packages/core/ios/Tests/DdSdkTests.swift +++ b/packages/core/ios/Tests/DdSdkTests.swift @@ -725,16 +725,15 @@ internal class DdSdkTests: XCTestCase { DdSdkImplementation().overrideReactNativeTelemetry(rnConfiguration: configuration, core: core) - // TODO: uncomment when all telemetry is supported -// XCTAssertEqual(mockTelemetry.configuration?.initializationType, "LEGACY") + XCTAssertEqual(core.configuration?.initializationType, "LEGACY") XCTAssertEqual(core.configuration?.trackErrors, true) XCTAssertEqual(core.configuration?.trackInteractions, true) XCTAssertEqual(core.configuration?.trackNetworkRequests, true) -// XCTAssertEqual(core.configuration?.trackNativeErrors, false) + XCTAssertEqual(core.configuration?.trackNativeErrors, false) XCTAssertEqual(core.configuration?.trackNativeLongTasks, false) XCTAssertEqual(core.configuration?.trackLongTask, true) -// XCTAssertEqual(core.configuration?.reactVersion, "18.2.0") -// XCTAssertEqual(core.configuration?.reactNativeVersion, "0.71.0") + XCTAssertEqual(core.configuration?.reactVersion, "18.2.0") + XCTAssertEqual(core.configuration?.reactNativeVersion, "0.71.0") } func testDropsResourceMarkedAsDropped() throws {