@datadog/mobile-react-native 3.7.0 → 3.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/src/main/kotlin/com/datadog/reactnative/SdkVersion.kt +1 -1
- package/ios/Sources/DdFlagsImplementation.swift +3 -4
- package/ios/Sources/DdLogsImplementation.swift +8 -8
- package/ios/Sources/DdRumImplementation.swift +25 -25
- package/ios/Sources/DdSdkImplementation.swift +20 -21
- package/ios/Sources/DdTraceImplementation.swift +2 -2
- package/ios/Sources/RCTPromiseTypes.swift +18 -0
- package/ios/Sources/SdkVersion.swift +1 -1
- package/lib/commonjs/DdSdkReactNative.js +15 -15
- package/lib/commonjs/DdSdkReactNative.js.map +1 -1
- package/lib/commonjs/flags/internal.js +9 -1
- package/lib/commonjs/flags/internal.js.map +1 -1
- package/lib/commonjs/flags/rumIntegration.js +104 -0
- package/lib/commonjs/flags/rumIntegration.js.map +1 -0
- package/lib/commonjs/index.js +7 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/rum/DdRum.js +2 -2
- package/lib/commonjs/rum/DdRum.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.js +3 -3
- package/lib/commonjs/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.js.map +1 -1
- package/lib/commonjs/sdk/AttributesEncoding/defaultEncoders.js +1 -1
- package/lib/commonjs/sdk/AttributesEncoding/defaultEncoders.js.map +1 -1
- package/lib/commonjs/sdk/AttributesEncoding/helpers.js +3 -3
- package/lib/commonjs/sdk/AttributesEncoding/helpers.js.map +1 -1
- package/lib/commonjs/sdk/AttributesEncoding/utils.js +8 -0
- package/lib/commonjs/sdk/AttributesEncoding/utils.js.map +1 -1
- package/lib/commonjs/sdk/DatadogProvider/Buffer/BoundedBuffer.js +2 -2
- package/lib/commonjs/sdk/DatadogProvider/Buffer/BoundedBuffer.js.map +1 -1
- package/lib/commonjs/sdk/DdSdkInternal.js +22 -22
- package/lib/commonjs/sdk/DdSdkInternal.js.map +1 -1
- package/lib/commonjs/sdk/EventMappers/EventMapper.js +2 -2
- package/lib/commonjs/sdk/EventMappers/EventMapper.js.map +1 -1
- package/lib/commonjs/utils/time-provider/TimeProvider.js +4 -1
- package/lib/commonjs/utils/time-provider/TimeProvider.js.map +1 -1
- package/lib/commonjs/version.js +1 -1
- package/lib/module/DdSdkReactNative.js +15 -15
- package/lib/module/DdSdkReactNative.js.map +1 -1
- package/lib/module/flags/internal.js +9 -1
- package/lib/module/flags/internal.js.map +1 -1
- package/lib/module/flags/rumIntegration.js +97 -0
- package/lib/module/flags/rumIntegration.js.map +1 -0
- package/lib/module/index.js +2 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/rum/DdRum.js +2 -2
- package/lib/module/rum/DdRum.js.map +1 -1
- package/lib/module/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.js +3 -3
- package/lib/module/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.js.map +1 -1
- package/lib/module/sdk/AttributesEncoding/defaultEncoders.js +2 -2
- package/lib/module/sdk/AttributesEncoding/defaultEncoders.js.map +1 -1
- package/lib/module/sdk/AttributesEncoding/helpers.js +4 -4
- package/lib/module/sdk/AttributesEncoding/helpers.js.map +1 -1
- package/lib/module/sdk/AttributesEncoding/utils.js +7 -0
- package/lib/module/sdk/AttributesEncoding/utils.js.map +1 -1
- package/lib/module/sdk/DatadogProvider/Buffer/BoundedBuffer.js +2 -2
- package/lib/module/sdk/DatadogProvider/Buffer/BoundedBuffer.js.map +1 -1
- package/lib/module/sdk/DdSdkInternal.js +21 -22
- package/lib/module/sdk/DdSdkInternal.js.map +1 -1
- package/lib/module/sdk/EventMappers/EventMapper.js +2 -2
- package/lib/module/sdk/EventMappers/EventMapper.js.map +1 -1
- package/lib/module/utils/time-provider/TimeProvider.js +4 -1
- package/lib/module/utils/time-provider/TimeProvider.js.map +1 -1
- package/lib/module/version.js +1 -1
- package/lib/typescript/flags/internal.d.ts.map +1 -1
- package/lib/typescript/flags/rumIntegration.d.ts +14 -0
- package/lib/typescript/flags/rumIntegration.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +2 -1
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/sdk/AttributesEncoding/defaultEncoders.d.ts.map +1 -1
- package/lib/typescript/sdk/AttributesEncoding/utils.d.ts +1 -0
- package/lib/typescript/sdk/AttributesEncoding/utils.d.ts.map +1 -1
- package/lib/typescript/sdk/DdSdkInternal.d.ts +1 -8
- package/lib/typescript/sdk/DdSdkInternal.d.ts.map +1 -1
- package/lib/typescript/utils/time-provider/TimeProvider.d.ts.map +1 -1
- package/lib/typescript/version.d.ts +1 -1
- package/package.json +2 -2
- package/src/DdSdkReactNative.tsx +15 -15
- package/src/__tests__/DdSdkReactNative.test.tsx +139 -19
- package/src/__tests__/rum/instrumentation/DdRumUserInteractionTracking.test.tsx +3 -3
- package/src/flags/__tests__/internal.test.ts +39 -0
- package/src/flags/__tests__/rumIntegration.test.ts +493 -0
- package/src/flags/internal.ts +12 -1
- package/src/flags/rumIntegration.ts +140 -0
- package/src/index.tsx +3 -1
- package/src/rum/DdRum.ts +2 -2
- package/src/rum/__tests__/DdRum.test.ts +4 -4
- package/src/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.tsx +3 -3
- package/src/sdk/AttributesEncoding/__tests__/attributesEncoding.test.ts +25 -0
- package/src/sdk/AttributesEncoding/defaultEncoders.ts +6 -2
- package/src/sdk/AttributesEncoding/helpers.ts +6 -6
- package/src/sdk/AttributesEncoding/utils.ts +8 -0
- package/src/sdk/DatadogProvider/Buffer/BoundedBuffer.ts +2 -2
- package/src/sdk/DatadogProvider/Buffer/__tests__/BoundedBuffer.test.ts +5 -5
- package/src/sdk/DdSdkInternal.ts +23 -30
- package/src/sdk/EventMappers/EventMapper.ts +2 -2
- package/src/sdk/EventMappers/__tests__/EventMapper.test.ts +2 -2
- package/src/utils/__tests__/TimeProvider.test.tsx +49 -0
- package/src/utils/time-provider/TimeProvider.tsx +10 -1
- package/src/version.ts +1 -1
|
@@ -26,7 +26,7 @@ public class DdFlagsImplementation: NSObject {
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
@objc
|
|
29
|
-
public func enable(_ configuration: NSDictionary, resolve:
|
|
29
|
+
public func enable(_ configuration: NSDictionary, resolve: @escaping RCTPromiseResolve, reject: @escaping RCTPromiseReject) {
|
|
30
30
|
// Client providers become stale upon subsequent enable calls (which can happen e.g. in case of a React Native hot reload).
|
|
31
31
|
clientProviders.removeAll()
|
|
32
32
|
|
|
@@ -53,9 +53,8 @@ public class DdFlagsImplementation: NSObject {
|
|
|
53
53
|
return client
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
// Using @escaping RCTPromiseResolveBlock type will result in an issue when compiling the Swift header file.
|
|
57
56
|
@objc
|
|
58
|
-
public func setEvaluationContext(_ clientName: String, targetingKey: String, attributes: NSDictionary, resolve: @escaping
|
|
57
|
+
public func setEvaluationContext(_ clientName: String, targetingKey: String, attributes: NSDictionary, resolve: @escaping RCTPromiseResolve, reject: @escaping RCTPromiseReject) {
|
|
59
58
|
let client = getClient(name: clientName)
|
|
60
59
|
guard let clientInternal = client as? FlagsClientInternal else {
|
|
61
60
|
reject("CLIENT_NOT_INITIALIZED", "Flags client '\(clientName)' is not properly initialized. Make sure the Datadog SDK has been initialized and Flags.enable() has been called.", nil)
|
|
@@ -102,7 +101,7 @@ public class DdFlagsImplementation: NSObject {
|
|
|
102
101
|
}
|
|
103
102
|
|
|
104
103
|
@objc
|
|
105
|
-
public func trackEvaluation(_ clientName: String, key: String, rawFlag: NSDictionary, targetingKey: String, attributes: NSDictionary, resolve:
|
|
104
|
+
public func trackEvaluation(_ clientName: String, key: String, rawFlag: NSDictionary, targetingKey: String, attributes: NSDictionary, resolve: @escaping RCTPromiseResolve, reject: @escaping RCTPromiseReject) {
|
|
106
105
|
guard let client = getClient(name: clientName) as? FlagsClientInternal else {
|
|
107
106
|
reject("CLIENT_NOT_INITIALIZED", "Flags client '\(clientName)' is not properly initialized. Make sure the Datadog SDK has been initialized and Flags.enable() has been called.", nil)
|
|
108
107
|
return
|
|
@@ -36,56 +36,56 @@ public class DdLogsImplementation: NSObject {
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
@objc
|
|
39
|
-
public func debug(message: String, context: NSDictionary, resolve:
|
|
39
|
+
public func debug(message: String, context: NSDictionary, resolve: @escaping RCTPromiseResolve, reject: @escaping RCTPromiseReject) -> Void {
|
|
40
40
|
let attributes = castAttributesToSwift(context).mergeWithGlobalAttributes()
|
|
41
41
|
logger.debug(message, error: nil, attributes: attributes)
|
|
42
42
|
resolve(nil)
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
@objc
|
|
46
|
-
public func info(message: String, context: NSDictionary, resolve:
|
|
46
|
+
public func info(message: String, context: NSDictionary, resolve: @escaping RCTPromiseResolve, reject: @escaping RCTPromiseReject) -> Void {
|
|
47
47
|
let attributes = castAttributesToSwift(context).mergeWithGlobalAttributes()
|
|
48
48
|
logger.info(message, error: nil, attributes: attributes)
|
|
49
49
|
resolve(nil)
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
@objc
|
|
53
|
-
public func warn(message: String, context: NSDictionary, resolve:
|
|
53
|
+
public func warn(message: String, context: NSDictionary, resolve: @escaping RCTPromiseResolve, reject: @escaping RCTPromiseReject) -> Void {
|
|
54
54
|
let attributes = castAttributesToSwift(context).mergeWithGlobalAttributes()
|
|
55
55
|
logger.warn(message, error: nil, attributes: attributes)
|
|
56
56
|
resolve(nil)
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
@objc
|
|
60
|
-
public func error(message: String, context: NSDictionary, resolve:
|
|
60
|
+
public func error(message: String, context: NSDictionary, resolve: @escaping RCTPromiseResolve, reject: @escaping RCTPromiseReject) -> Void {
|
|
61
61
|
let attributes = castAttributesToSwift(context).mergeWithGlobalAttributes()
|
|
62
62
|
logger.error(message, error: nil, attributes: attributes)
|
|
63
63
|
resolve(nil)
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
@objc
|
|
67
|
-
public func debugWithError(message: String, errorKind: String?, errorMessage: String?, stacktrace: String?, context: NSDictionary, resolve:
|
|
67
|
+
public func debugWithError(message: String, errorKind: String?, errorMessage: String?, stacktrace: String?, context: NSDictionary, resolve: @escaping RCTPromiseResolve, reject: @escaping RCTPromiseReject) -> Void {
|
|
68
68
|
let attributes = castAttributesToSwift(context).mergeWithGlobalAttributes()
|
|
69
69
|
logger._internal.log(level: .debug, message: message, errorKind: errorKind, errorMessage: errorMessage, stackTrace: stacktrace, attributes: attributes)
|
|
70
70
|
resolve(nil)
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
@objc
|
|
74
|
-
public func infoWithError(message: String, errorKind: String?, errorMessage: String?, stacktrace: String?, context: NSDictionary, resolve:
|
|
74
|
+
public func infoWithError(message: String, errorKind: String?, errorMessage: String?, stacktrace: String?, context: NSDictionary, resolve: @escaping RCTPromiseResolve, reject: @escaping RCTPromiseReject) -> Void {
|
|
75
75
|
let attributes = castAttributesToSwift(context).mergeWithGlobalAttributes()
|
|
76
76
|
logger._internal.log(level: .info, message: message, errorKind: errorKind, errorMessage: errorMessage, stackTrace: stacktrace, attributes: attributes)
|
|
77
77
|
resolve(nil)
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
@objc
|
|
81
|
-
public func warnWithError(message: String, errorKind: String?, errorMessage: String?, stacktrace: String?, context: NSDictionary, resolve:
|
|
81
|
+
public func warnWithError(message: String, errorKind: String?, errorMessage: String?, stacktrace: String?, context: NSDictionary, resolve: @escaping RCTPromiseResolve, reject: @escaping RCTPromiseReject) -> Void {
|
|
82
82
|
let attributes = castAttributesToSwift(context).mergeWithGlobalAttributes()
|
|
83
83
|
logger._internal.log(level: .warn, message: message, errorKind: errorKind, errorMessage: errorMessage, stackTrace: stacktrace, attributes: attributes)
|
|
84
84
|
resolve(nil)
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
@objc
|
|
88
|
-
public func errorWithError(message: String, errorKind: String?, errorMessage: String?, stacktrace: String?, context: NSDictionary, resolve:
|
|
88
|
+
public func errorWithError(message: String, errorKind: String?, errorMessage: String?, stacktrace: String?, context: NSDictionary, resolve: @escaping RCTPromiseResolve, reject: @escaping RCTPromiseReject) -> Void {
|
|
89
89
|
let attributes = castAttributesToSwift(context).mergeWithGlobalAttributes()
|
|
90
90
|
logger._internal.log(level: .error, message: message, errorKind: errorKind, errorMessage: errorMessage, stackTrace: stacktrace, attributes: attributes)
|
|
91
91
|
resolve(nil)
|
|
@@ -131,31 +131,31 @@ public class DdRumImplementation: NSObject {
|
|
|
131
131
|
}
|
|
132
132
|
|
|
133
133
|
@objc
|
|
134
|
-
public func startView(key: String, name: String, context: NSDictionary, timestampMs: Double, resolve:
|
|
134
|
+
public func startView(key: String, name: String, context: NSDictionary, timestampMs: Double, resolve: @escaping RCTPromiseResolve, reject: @escaping RCTPromiseReject) -> Void {
|
|
135
135
|
nativeRUM.startView(key: key, name: name, attributes: attributes(from: context, with: timestampMs))
|
|
136
136
|
resolve(nil)
|
|
137
137
|
}
|
|
138
138
|
|
|
139
139
|
@objc
|
|
140
|
-
public func stopView(key: String, context: NSDictionary, timestampMs: Double, resolve:
|
|
140
|
+
public func stopView(key: String, context: NSDictionary, timestampMs: Double, resolve: @escaping RCTPromiseResolve, reject: @escaping RCTPromiseReject) -> Void {
|
|
141
141
|
nativeRUM.stopView(key: key, attributes: attributes(from: context, with: timestampMs))
|
|
142
142
|
resolve(nil)
|
|
143
143
|
}
|
|
144
144
|
|
|
145
145
|
@objc
|
|
146
|
-
public func startAction(type: String, name: String, context: NSDictionary, timestampMs: Double, resolve:
|
|
146
|
+
public func startAction(type: String, name: String, context: NSDictionary, timestampMs: Double, resolve: @escaping RCTPromiseResolve, reject: @escaping RCTPromiseReject) -> Void {
|
|
147
147
|
nativeRUM.startAction(type: RUMActionType(from: type), name: name, attributes: attributes(from: context, with: timestampMs))
|
|
148
148
|
resolve(nil)
|
|
149
149
|
}
|
|
150
150
|
|
|
151
151
|
@objc
|
|
152
|
-
public func stopAction(type: String, name: String, context: NSDictionary, timestampMs: Double, resolve:
|
|
152
|
+
public func stopAction(type: String, name: String, context: NSDictionary, timestampMs: Double, resolve: @escaping RCTPromiseResolve, reject: @escaping RCTPromiseReject) -> Void {
|
|
153
153
|
nativeRUM.stopAction(type: RUMActionType(from: type), name: name, attributes: attributes(from: context, with: timestampMs))
|
|
154
154
|
resolve(nil)
|
|
155
155
|
}
|
|
156
156
|
|
|
157
157
|
@objc
|
|
158
|
-
public func addAction(type: String, name: String, touch: NSDictionary?, context: NSDictionary, timestampMs: Double, resolve:
|
|
158
|
+
public func addAction(type: String, name: String, touch: NSDictionary?, context: NSDictionary, timestampMs: Double, resolve: @escaping RCTPromiseResolve, reject: @escaping RCTPromiseReject) -> Void {
|
|
159
159
|
if
|
|
160
160
|
let touch,
|
|
161
161
|
let reactTag = touch["reactTag"] as? NSNumber,
|
|
@@ -165,13 +165,13 @@ public class DdRumImplementation: NSObject {
|
|
|
165
165
|
let pageY = touch["pageY"] as? NSNumber
|
|
166
166
|
{
|
|
167
167
|
addAction(
|
|
168
|
-
at: Date(
|
|
168
|
+
at: Date(),
|
|
169
169
|
type: RUMActionType(from: type),
|
|
170
170
|
name: name,
|
|
171
171
|
reactTag: reactTag,
|
|
172
172
|
location: .init(x: CGFloat(truncating: x), y: CGFloat(truncating: y)),
|
|
173
173
|
pageLocation: .init(x: CGFloat(truncating: pageX), y: CGFloat(truncating: pageY)),
|
|
174
|
-
attributes:
|
|
174
|
+
attributes: attributes(from: context, with: timestampMs)
|
|
175
175
|
)
|
|
176
176
|
} else {
|
|
177
177
|
nativeRUM.addAction(type: RUMActionType(from: type), name: name, attributes: attributes(from: context, with: timestampMs))
|
|
@@ -180,13 +180,13 @@ public class DdRumImplementation: NSObject {
|
|
|
180
180
|
}
|
|
181
181
|
|
|
182
182
|
@objc
|
|
183
|
-
public func startResource(key: String, method: String, url: String, context: NSDictionary, timestampMs: Double, resolve:
|
|
183
|
+
public func startResource(key: String, method: String, url: String, context: NSDictionary, timestampMs: Double, resolve: @escaping RCTPromiseResolve, reject: @escaping RCTPromiseReject) -> Void {
|
|
184
184
|
nativeRUM.startResource(resourceKey: key, httpMethod: RUMMethod(from: method), urlString: url, attributes: attributes(from: context, with: timestampMs))
|
|
185
185
|
resolve(nil)
|
|
186
186
|
}
|
|
187
187
|
|
|
188
188
|
@objc
|
|
189
|
-
public func stopResource(key: String, statusCode: Int64, kind: String, size: Double, context: NSDictionary, timestampMs: Double, resolve:
|
|
189
|
+
public func stopResource(key: String, statusCode: Int64, kind: String, size: Double, context: NSDictionary, timestampMs: Double, resolve: @escaping RCTPromiseResolve, reject: @escaping RCTPromiseReject) -> Void {
|
|
190
190
|
let mutableContext = NSMutableDictionary(dictionary: context)
|
|
191
191
|
if let resourceTimings = mutableContext.object(forKey: Self.resourceTimingsKey) as? [String: Any] {
|
|
192
192
|
mutableContext.removeObject(forKey: Self.resourceTimingsKey)
|
|
@@ -205,7 +205,7 @@ public class DdRumImplementation: NSObject {
|
|
|
205
205
|
}
|
|
206
206
|
|
|
207
207
|
@objc
|
|
208
|
-
public func addError(message: String, source: String, stacktrace: String, context: NSDictionary, timestampMs: Double, fingerprint: String, resolve:
|
|
208
|
+
public func addError(message: String, source: String, stacktrace: String, context: NSDictionary, timestampMs: Double, fingerprint: String, resolve: @escaping RCTPromiseResolve, reject: @escaping RCTPromiseReject) -> Void {
|
|
209
209
|
|
|
210
210
|
func addErrorWithContext(errorContext: NSDictionary) -> Void {
|
|
211
211
|
nativeRUM.addError(message: message, type: nil, stack: stacktrace, source: RUMErrorSource(from: source), attributes: attributes(from: errorContext, with: timestampMs), file: nil, line: nil)
|
|
@@ -223,13 +223,13 @@ public class DdRumImplementation: NSObject {
|
|
|
223
223
|
}
|
|
224
224
|
|
|
225
225
|
@objc
|
|
226
|
-
public func addTiming(name: String, resolve:
|
|
226
|
+
public func addTiming(name: String, resolve: @escaping RCTPromiseResolve, reject: @escaping RCTPromiseReject) -> Void {
|
|
227
227
|
nativeRUM.addTiming(name: name)
|
|
228
228
|
resolve(nil)
|
|
229
229
|
}
|
|
230
230
|
|
|
231
231
|
@objc
|
|
232
|
-
public func addViewAttribute(key: AttributeKey, value: NSDictionary, resolve:
|
|
232
|
+
public func addViewAttribute(key: AttributeKey, value: NSDictionary, resolve: @escaping RCTPromiseResolve, reject: @escaping RCTPromiseReject) -> Void {
|
|
233
233
|
if let attributeValue = value.object(forKey: "value") {
|
|
234
234
|
let castedAttribute = castValueToSwift(attributeValue)
|
|
235
235
|
nativeRUM.addViewAttribute(forKey: key, value: castedAttribute)
|
|
@@ -238,38 +238,38 @@ public class DdRumImplementation: NSObject {
|
|
|
238
238
|
}
|
|
239
239
|
|
|
240
240
|
@objc
|
|
241
|
-
public func removeViewAttribute(key: AttributeKey, resolve:
|
|
241
|
+
public func removeViewAttribute(key: AttributeKey, resolve: @escaping RCTPromiseResolve, reject: @escaping RCTPromiseReject) -> Void {
|
|
242
242
|
nativeRUM.removeViewAttribute(forKey: key)
|
|
243
243
|
resolve(nil)
|
|
244
244
|
}
|
|
245
245
|
|
|
246
246
|
@objc
|
|
247
|
-
public func addViewAttributes(attributes: NSDictionary, resolve:
|
|
247
|
+
public func addViewAttributes(attributes: NSDictionary, resolve: @escaping RCTPromiseResolve, reject: @escaping RCTPromiseReject) -> Void {
|
|
248
248
|
let castedAttributes = castAttributesToSwift(attributes)
|
|
249
249
|
nativeRUM.addViewAttributes(castedAttributes)
|
|
250
250
|
resolve(nil)
|
|
251
251
|
}
|
|
252
252
|
|
|
253
253
|
@objc
|
|
254
|
-
public func removeViewAttributes(keys: [AttributeKey], resolve:
|
|
254
|
+
public func removeViewAttributes(keys: [AttributeKey], resolve: @escaping RCTPromiseResolve, reject: @escaping RCTPromiseReject) -> Void {
|
|
255
255
|
nativeRUM.removeViewAttributes(forKeys: keys)
|
|
256
256
|
resolve(nil)
|
|
257
257
|
}
|
|
258
258
|
|
|
259
259
|
@objc
|
|
260
|
-
public func addViewLoadingTime(overwrite: Bool, resolve:
|
|
260
|
+
public func addViewLoadingTime(overwrite: Bool, resolve: @escaping RCTPromiseResolve, reject: @escaping RCTPromiseReject) -> Void {
|
|
261
261
|
nativeRUM.addViewLoadingTime(overwrite: overwrite)
|
|
262
262
|
resolve(nil)
|
|
263
263
|
}
|
|
264
264
|
|
|
265
265
|
@objc
|
|
266
|
-
public func stopSession(resolve:
|
|
266
|
+
public func stopSession(resolve: @escaping RCTPromiseResolve, reject: @escaping RCTPromiseReject) -> Void {
|
|
267
267
|
nativeRUM.stopSession()
|
|
268
268
|
resolve(nil)
|
|
269
269
|
}
|
|
270
270
|
|
|
271
271
|
@objc
|
|
272
|
-
public func addFeatureFlagEvaluation(name: String, value: NSDictionary, resolve:
|
|
272
|
+
public func addFeatureFlagEvaluation(name: String, value: NSDictionary, resolve: @escaping RCTPromiseResolve, reject: @escaping RCTPromiseReject) -> Void {
|
|
273
273
|
let valueAsEncodable = castAttributesToSwift(value)
|
|
274
274
|
if let value = valueAsEncodable["value"] {
|
|
275
275
|
nativeRUM.addFeatureFlagEvaluation(name: name, value: value)
|
|
@@ -278,7 +278,7 @@ public class DdRumImplementation: NSObject {
|
|
|
278
278
|
}
|
|
279
279
|
|
|
280
280
|
@objc
|
|
281
|
-
public func getCurrentSessionId(_ resolve: @escaping
|
|
281
|
+
public func getCurrentSessionId(_ resolve: @escaping RCTPromiseResolve, reject: @escaping RCTPromiseReject) -> Void {
|
|
282
282
|
nativeRUM.currentSessionID { sessionId in
|
|
283
283
|
resolve(sessionId)
|
|
284
284
|
}
|
|
@@ -289,8 +289,8 @@ public class DdRumImplementation: NSObject {
|
|
|
289
289
|
name: String,
|
|
290
290
|
operationKey: String?,
|
|
291
291
|
attributes: NSDictionary,
|
|
292
|
-
resolve: @escaping
|
|
293
|
-
reject:
|
|
292
|
+
resolve: @escaping RCTPromiseResolve,
|
|
293
|
+
reject: @escaping RCTPromiseReject
|
|
294
294
|
){
|
|
295
295
|
let castedAttributes = castAttributesToSwift(attributes)
|
|
296
296
|
nativeRUM.startFeatureOperation(name: name, operationKey: operationKey, attributes: castedAttributes)
|
|
@@ -302,8 +302,8 @@ public class DdRumImplementation: NSObject {
|
|
|
302
302
|
name: String,
|
|
303
303
|
operationKey: String?,
|
|
304
304
|
attributes: NSDictionary,
|
|
305
|
-
resolve: @escaping
|
|
306
|
-
reject:
|
|
305
|
+
resolve: @escaping RCTPromiseResolve,
|
|
306
|
+
reject: @escaping RCTPromiseReject
|
|
307
307
|
){
|
|
308
308
|
let castedAttributes = castAttributesToSwift(attributes)
|
|
309
309
|
nativeRUM.succeedFeatureOperation(name: name, operationKey: operationKey, attributes: castedAttributes)
|
|
@@ -316,8 +316,8 @@ public class DdRumImplementation: NSObject {
|
|
|
316
316
|
operationKey: String?,
|
|
317
317
|
reason: String,
|
|
318
318
|
attributes: NSDictionary,
|
|
319
|
-
resolve: @escaping
|
|
320
|
-
reject:
|
|
319
|
+
resolve: @escaping RCTPromiseResolve,
|
|
320
|
+
reject: @escaping RCTPromiseReject
|
|
321
321
|
){
|
|
322
322
|
let castedAttributes = castAttributesToSwift(attributes)
|
|
323
323
|
nativeRUM.failFeatureOperation(name: name, operationKey: operationKey,
|
|
@@ -62,11 +62,10 @@ public class DdSdkImplementation: NSObject {
|
|
|
62
62
|
super.init()
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
// Using @escaping RCTPromiseResolveBlock type will result in an issue when compiling the Swift header file.
|
|
66
65
|
@objc
|
|
67
66
|
public func initialize(
|
|
68
|
-
configuration: NSDictionary, resolve: @escaping
|
|
69
|
-
reject:
|
|
67
|
+
configuration: NSDictionary, resolve: @escaping RCTPromiseResolve,
|
|
68
|
+
reject: @escaping RCTPromiseReject
|
|
70
69
|
) {
|
|
71
70
|
let sdkConfiguration = configuration.asDdSdkConfiguration()
|
|
72
71
|
let nativeInitialization = DdSdkNativeInitialization()
|
|
@@ -94,8 +93,8 @@ public class DdSdkImplementation: NSObject {
|
|
|
94
93
|
|
|
95
94
|
@objc
|
|
96
95
|
public func addAttribute(
|
|
97
|
-
key: AttributeKey, value: NSDictionary, resolve:
|
|
98
|
-
reject:
|
|
96
|
+
key: AttributeKey, value: NSDictionary, resolve: @escaping RCTPromiseResolve,
|
|
97
|
+
reject: @escaping RCTPromiseReject
|
|
99
98
|
) {
|
|
100
99
|
if let attributeValue = value.object(forKey: "value") {
|
|
101
100
|
let castedValue = castValueToSwift(attributeValue)
|
|
@@ -108,7 +107,7 @@ public class DdSdkImplementation: NSObject {
|
|
|
108
107
|
|
|
109
108
|
@objc
|
|
110
109
|
public func removeAttribute(
|
|
111
|
-
key: AttributeKey, resolve:
|
|
110
|
+
key: AttributeKey, resolve: @escaping RCTPromiseResolve, reject: @escaping RCTPromiseReject
|
|
112
111
|
) {
|
|
113
112
|
RUMMonitorProvider()?.removeAttribute(forKey: key)
|
|
114
113
|
GlobalState.removeAttribute(key: key)
|
|
@@ -118,7 +117,7 @@ public class DdSdkImplementation: NSObject {
|
|
|
118
117
|
|
|
119
118
|
@objc
|
|
120
119
|
public func addAttributes(
|
|
121
|
-
attributes: NSDictionary, resolve:
|
|
120
|
+
attributes: NSDictionary, resolve: @escaping RCTPromiseResolve, reject: @escaping RCTPromiseReject
|
|
122
121
|
) {
|
|
123
122
|
let castedAttributes = castAttributesToSwift(attributes)
|
|
124
123
|
for (key, value) in castedAttributes {
|
|
@@ -131,7 +130,7 @@ public class DdSdkImplementation: NSObject {
|
|
|
131
130
|
|
|
132
131
|
@objc
|
|
133
132
|
public func removeAttributes(
|
|
134
|
-
keys: [AttributeKey], resolve:
|
|
133
|
+
keys: [AttributeKey], resolve: @escaping RCTPromiseResolve, reject: @escaping RCTPromiseReject
|
|
135
134
|
) {
|
|
136
135
|
RUMMonitorProvider()?.removeAttributes(forKeys: keys)
|
|
137
136
|
for (key) in keys {
|
|
@@ -143,7 +142,7 @@ public class DdSdkImplementation: NSObject {
|
|
|
143
142
|
|
|
144
143
|
@objc
|
|
145
144
|
public func setUserInfo(
|
|
146
|
-
userInfo: NSDictionary, resolve:
|
|
145
|
+
userInfo: NSDictionary, resolve: @escaping RCTPromiseResolve, reject: @escaping RCTPromiseReject
|
|
147
146
|
) {
|
|
148
147
|
let castedUserInfo = castAttributesToSwift(userInfo)
|
|
149
148
|
let id = castedUserInfo["id"] as? String
|
|
@@ -166,7 +165,7 @@ public class DdSdkImplementation: NSObject {
|
|
|
166
165
|
|
|
167
166
|
@objc
|
|
168
167
|
public func addUserExtraInfo(
|
|
169
|
-
extraInfo: NSDictionary, resolve:
|
|
168
|
+
extraInfo: NSDictionary, resolve: @escaping RCTPromiseResolve, reject: @escaping RCTPromiseReject
|
|
170
169
|
) {
|
|
171
170
|
let castedExtraInfo = castAttributesToSwift(extraInfo)
|
|
172
171
|
|
|
@@ -175,14 +174,14 @@ public class DdSdkImplementation: NSObject {
|
|
|
175
174
|
}
|
|
176
175
|
|
|
177
176
|
@objc
|
|
178
|
-
public func clearUserInfo(resolve:
|
|
177
|
+
public func clearUserInfo(resolve: @escaping RCTPromiseResolve, reject: @escaping RCTPromiseReject) {
|
|
179
178
|
Datadog.clearUserInfo()
|
|
180
179
|
resolve(nil)
|
|
181
180
|
}
|
|
182
181
|
|
|
183
182
|
@objc
|
|
184
183
|
public func setAccountInfo(
|
|
185
|
-
accountInfo: NSDictionary, resolve:
|
|
184
|
+
accountInfo: NSDictionary, resolve: @escaping RCTPromiseResolve, reject: @escaping RCTPromiseReject
|
|
186
185
|
) {
|
|
187
186
|
let castedAccountInfo = castAttributesToSwift(accountInfo)
|
|
188
187
|
let id = castedAccountInfo["id"] as? String
|
|
@@ -204,7 +203,7 @@ public class DdSdkImplementation: NSObject {
|
|
|
204
203
|
|
|
205
204
|
@objc
|
|
206
205
|
public func addAccountExtraInfo(
|
|
207
|
-
extraInfo: NSDictionary, resolve:
|
|
206
|
+
extraInfo: NSDictionary, resolve: @escaping RCTPromiseResolve, reject: @escaping RCTPromiseReject
|
|
208
207
|
) {
|
|
209
208
|
let castedExtraInfo = castAttributesToSwift(extraInfo)
|
|
210
209
|
|
|
@@ -213,14 +212,14 @@ public class DdSdkImplementation: NSObject {
|
|
|
213
212
|
}
|
|
214
213
|
|
|
215
214
|
@objc
|
|
216
|
-
public func clearAccountInfo(resolve:
|
|
215
|
+
public func clearAccountInfo(resolve: @escaping RCTPromiseResolve, reject: @escaping RCTPromiseReject) {
|
|
217
216
|
Datadog.clearAccountInfo()
|
|
218
217
|
resolve(nil)
|
|
219
218
|
}
|
|
220
219
|
|
|
221
220
|
@objc
|
|
222
221
|
public func setTrackingConsent(
|
|
223
|
-
trackingConsent: NSString, resolve:
|
|
222
|
+
trackingConsent: NSString, resolve: @escaping RCTPromiseResolve, reject: @escaping RCTPromiseReject
|
|
224
223
|
) {
|
|
225
224
|
Datadog.set(trackingConsent: (trackingConsent as NSString?).asTrackingConsent())
|
|
226
225
|
resolve(nil)
|
|
@@ -229,7 +228,7 @@ public class DdSdkImplementation: NSObject {
|
|
|
229
228
|
@objc
|
|
230
229
|
public func sendTelemetryLog(
|
|
231
230
|
message: NSString, attributes: NSDictionary, config: NSDictionary,
|
|
232
|
-
resolve:
|
|
231
|
+
resolve: @escaping RCTPromiseResolve, reject: @escaping RCTPromiseReject
|
|
233
232
|
) {
|
|
234
233
|
let castedAttributes = castAttributesToSwift(attributes)
|
|
235
234
|
let castedConfig = castAttributesToSwift(config)
|
|
@@ -241,7 +240,7 @@ public class DdSdkImplementation: NSObject {
|
|
|
241
240
|
@objc
|
|
242
241
|
|
|
243
242
|
public func telemetryDebug(
|
|
244
|
-
message: NSString, resolve:
|
|
243
|
+
message: NSString, resolve: @escaping RCTPromiseResolve, reject: @escaping RCTPromiseReject
|
|
245
244
|
) {
|
|
246
245
|
DdTelemetry.telemetryDebug(
|
|
247
246
|
id: "datadog_react_native:\(message)", message: message as String)
|
|
@@ -250,8 +249,8 @@ public class DdSdkImplementation: NSObject {
|
|
|
250
249
|
|
|
251
250
|
@objc
|
|
252
251
|
public func telemetryError(
|
|
253
|
-
message: NSString, stack: NSString, kind: NSString, resolve:
|
|
254
|
-
reject:
|
|
252
|
+
message: NSString, stack: NSString, kind: NSString, resolve: @escaping RCTPromiseResolve,
|
|
253
|
+
reject: @escaping RCTPromiseReject
|
|
255
254
|
) {
|
|
256
255
|
DdTelemetry.telemetryError(
|
|
257
256
|
id: "datadog_react_native:\(String(describing: kind)):\(message)",
|
|
@@ -262,7 +261,7 @@ public class DdSdkImplementation: NSObject {
|
|
|
262
261
|
#if os(iOS)
|
|
263
262
|
@objc
|
|
264
263
|
public func consumeWebviewEvent(
|
|
265
|
-
message: NSString, resolve:
|
|
264
|
+
message: NSString, resolve: @escaping RCTPromiseResolve, reject: @escaping RCTPromiseReject
|
|
266
265
|
) {
|
|
267
266
|
do {
|
|
268
267
|
try DatadogSDKWrapper.shared.sendWebviewMessage(body: message)
|
|
@@ -280,7 +279,7 @@ public class DdSdkImplementation: NSObject {
|
|
|
280
279
|
#endif
|
|
281
280
|
|
|
282
281
|
@objc
|
|
283
|
-
public func clearAllData(resolve:
|
|
282
|
+
public func clearAllData(resolve: @escaping RCTPromiseResolve, reject: @escaping RCTPromiseReject) {
|
|
284
283
|
Datadog.clearAllData()
|
|
285
284
|
resolve(nil)
|
|
286
285
|
}
|
|
@@ -31,7 +31,7 @@ public class DdTraceImplementation: NSObject {
|
|
|
31
31
|
@objc
|
|
32
32
|
public func startSpan(
|
|
33
33
|
operation: String, context: NSDictionary, timestampMs: Double,
|
|
34
|
-
resolve:
|
|
34
|
+
resolve: @escaping RCTPromiseResolve, reject: @escaping RCTPromiseReject
|
|
35
35
|
) {
|
|
36
36
|
objc_sync_enter(self)
|
|
37
37
|
defer { objc_sync_exit(self) }
|
|
@@ -57,7 +57,7 @@ public class DdTraceImplementation: NSObject {
|
|
|
57
57
|
@objc
|
|
58
58
|
public func finishSpan(
|
|
59
59
|
spanId: NSString, context: NSDictionary, timestampMs: Double,
|
|
60
|
-
resolve:
|
|
60
|
+
resolve: @escaping RCTPromiseResolve, reject: @escaping RCTPromiseReject
|
|
61
61
|
) {
|
|
62
62
|
objc_sync_enter(self)
|
|
63
63
|
defer { objc_sync_exit(self) }
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
|
|
3
|
+
* This product includes software developed at Datadog (https://www.datadoghq.com/).
|
|
4
|
+
* Copyright 2016-Present Datadog, Inc.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import Foundation
|
|
8
|
+
|
|
9
|
+
/// Local equivalents of `RCTPromiseResolveBlock`/`RCTPromiseRejectBlock` from `React/RCTBridgeModule.h`.
|
|
10
|
+
///
|
|
11
|
+
/// Using these plain Swift closure types instead of React's typealiases keeps the generated
|
|
12
|
+
/// Objective-C interface header (`-Swift.h`) from referencing `RCTPromiseResolveBlock`/`RCTPromiseRejectBlock`
|
|
13
|
+
/// by name: Swift emits the underlying block signature directly instead, so the header no longer
|
|
14
|
+
/// depends on `RCTBridgeModule.h` being importable wherever it is consumed. The block signatures are
|
|
15
|
+
/// structurally identical to React's, so `.mm` callers can pass `RCTPromiseResolveBlock`/`RCTPromiseRejectBlock`
|
|
16
|
+
/// values through unchanged.
|
|
17
|
+
public typealias RCTPromiseResolve = (Any?) -> Void
|
|
18
|
+
public typealias RCTPromiseReject = (String, String, NSError?) -> Void
|
|
@@ -25,7 +25,7 @@ var _AccountInfoSingleton = require("./sdk/AccountInfoSingleton/AccountInfoSingl
|
|
|
25
25
|
var _AttributesSingleton = require("./sdk/AttributesSingleton/AttributesSingleton");
|
|
26
26
|
var _DdSdkInternalNativeBridge = require("./sdk/DatadogInternalBridge/DdSdkInternalNativeBridge");
|
|
27
27
|
var _BufferSingleton = require("./sdk/DatadogProvider/Buffer/BufferSingleton");
|
|
28
|
-
var
|
|
28
|
+
var _DdSdk = require("./sdk/DdSdk");
|
|
29
29
|
var _GlobalState = require("./sdk/GlobalState/GlobalState");
|
|
30
30
|
var _UserInfoSingleton = require("./sdk/UserInfoSingleton/UserInfoSingleton");
|
|
31
31
|
var _longTasksUtils = require("./utils/longTasksUtils");
|
|
@@ -61,13 +61,13 @@ class DdSdkReactNative {
|
|
|
61
61
|
if (_GlobalState.GlobalState.isInitialized) {
|
|
62
62
|
_InternalLog.InternalLog.log("Can't initialize Datadog, SDK was already initialized", _SdkVerbosity.SdkVerbosity.WARN);
|
|
63
63
|
if (!__DEV__) {
|
|
64
|
-
|
|
64
|
+
_DdSdk.DdSdk.telemetryDebug('RN SDK was already initialized in javascript');
|
|
65
65
|
}
|
|
66
66
|
return new Promise(resolve => resolve());
|
|
67
67
|
}
|
|
68
68
|
_InternalLog.InternalLog.verbosity = configuration.verbosity;
|
|
69
69
|
(0, _DdSdkInternalNativeBridge.registerNativeBridge)();
|
|
70
|
-
await
|
|
70
|
+
await _DdSdk.DdSdk.initialize(DdSdkReactNative.buildConfiguration(configuration, params));
|
|
71
71
|
_InternalLog.InternalLog.log('Datadog SDK was initialized', _SdkVerbosity.SdkVerbosity.INFO);
|
|
72
72
|
_GlobalState.GlobalState.isInitialized = true;
|
|
73
73
|
_BufferSingleton.BufferSingleton.onInitialization();
|
|
@@ -155,7 +155,7 @@ class DdSdkReactNative {
|
|
|
155
155
|
*/
|
|
156
156
|
static addAttribute = async (key, value) => {
|
|
157
157
|
_InternalLog.InternalLog.log(`Adding attribute ${JSON.stringify(value)} for key ${key}`, _SdkVerbosity.SdkVerbosity.DEBUG);
|
|
158
|
-
await
|
|
158
|
+
await _DdSdk.DdSdk.addAttribute(key, {
|
|
159
159
|
value
|
|
160
160
|
});
|
|
161
161
|
_AttributesSingleton.AttributesSingleton.getInstance().addAttribute(key, value);
|
|
@@ -167,7 +167,7 @@ class DdSdkReactNative {
|
|
|
167
167
|
*/
|
|
168
168
|
static removeAttribute = async key => {
|
|
169
169
|
_InternalLog.InternalLog.log(`Removing attribute for key ${key}`, _SdkVerbosity.SdkVerbosity.DEBUG);
|
|
170
|
-
await
|
|
170
|
+
await _DdSdk.DdSdk.removeAttribute(key);
|
|
171
171
|
_AttributesSingleton.AttributesSingleton.getInstance().removeAttribute(key);
|
|
172
172
|
};
|
|
173
173
|
|
|
@@ -178,7 +178,7 @@ class DdSdkReactNative {
|
|
|
178
178
|
*/
|
|
179
179
|
static addAttributes = async attributes => {
|
|
180
180
|
_InternalLog.InternalLog.log(`Adding attributes ${JSON.stringify(attributes)}`, _SdkVerbosity.SdkVerbosity.DEBUG);
|
|
181
|
-
await
|
|
181
|
+
await _DdSdk.DdSdk.addAttributes(attributes);
|
|
182
182
|
_AttributesSingleton.AttributesSingleton.getInstance().addAttributes(attributes);
|
|
183
183
|
};
|
|
184
184
|
|
|
@@ -188,7 +188,7 @@ class DdSdkReactNative {
|
|
|
188
188
|
*/
|
|
189
189
|
static removeAttributes = async keys => {
|
|
190
190
|
_InternalLog.InternalLog.log(`Removing attributes for keys ${JSON.stringify(keys)}`, _SdkVerbosity.SdkVerbosity.DEBUG);
|
|
191
|
-
await
|
|
191
|
+
await _DdSdk.DdSdk.removeAttributes(keys);
|
|
192
192
|
_AttributesSingleton.AttributesSingleton.getInstance().removeAttributes(keys);
|
|
193
193
|
};
|
|
194
194
|
|
|
@@ -205,7 +205,7 @@ class DdSdkReactNative {
|
|
|
205
205
|
return;
|
|
206
206
|
}
|
|
207
207
|
_InternalLog.InternalLog.log(`Setting user ${JSON.stringify(userInfo)}`, _SdkVerbosity.SdkVerbosity.DEBUG);
|
|
208
|
-
await
|
|
208
|
+
await _DdSdk.DdSdk.setUserInfo(userInfo);
|
|
209
209
|
_UserInfoSingleton.UserInfoSingleton.getInstance().setUserInfo(userInfo);
|
|
210
210
|
};
|
|
211
211
|
|
|
@@ -215,7 +215,7 @@ class DdSdkReactNative {
|
|
|
215
215
|
*/
|
|
216
216
|
static clearUserInfo = async () => {
|
|
217
217
|
_InternalLog.InternalLog.log('Clearing user info', _SdkVerbosity.SdkVerbosity.DEBUG);
|
|
218
|
-
await
|
|
218
|
+
await _DdSdk.DdSdk.clearUserInfo();
|
|
219
219
|
_UserInfoSingleton.UserInfoSingleton.getInstance().clearUserInfo();
|
|
220
220
|
};
|
|
221
221
|
|
|
@@ -226,7 +226,7 @@ class DdSdkReactNative {
|
|
|
226
226
|
*/
|
|
227
227
|
static addUserExtraInfo = async extraUserInfo => {
|
|
228
228
|
_InternalLog.InternalLog.log(`Adding extra user info ${JSON.stringify(extraUserInfo)}`, _SdkVerbosity.SdkVerbosity.DEBUG);
|
|
229
|
-
await
|
|
229
|
+
await _DdSdk.DdSdk.addUserExtraInfo(extraUserInfo);
|
|
230
230
|
_UserInfoSingleton.UserInfoSingleton.getInstance().addUserExtraInfo(extraUserInfo);
|
|
231
231
|
};
|
|
232
232
|
|
|
@@ -239,7 +239,7 @@ class DdSdkReactNative {
|
|
|
239
239
|
*/
|
|
240
240
|
static setAccountInfo = async accountInfo => {
|
|
241
241
|
_InternalLog.InternalLog.log(`Setting account ${JSON.stringify(accountInfo)}`, _SdkVerbosity.SdkVerbosity.DEBUG);
|
|
242
|
-
await
|
|
242
|
+
await _DdSdk.DdSdk.setAccountInfo(accountInfo);
|
|
243
243
|
_AccountInfoSingleton.AccountInfoSingleton.getInstance().setAccountInfo(accountInfo);
|
|
244
244
|
};
|
|
245
245
|
|
|
@@ -249,7 +249,7 @@ class DdSdkReactNative {
|
|
|
249
249
|
*/
|
|
250
250
|
static clearAccountInfo = async () => {
|
|
251
251
|
_InternalLog.InternalLog.log('Clearing account info', _SdkVerbosity.SdkVerbosity.DEBUG);
|
|
252
|
-
await
|
|
252
|
+
await _DdSdk.DdSdk.clearAccountInfo();
|
|
253
253
|
_AccountInfoSingleton.AccountInfoSingleton.getInstance().clearAccountInfo();
|
|
254
254
|
};
|
|
255
255
|
|
|
@@ -269,7 +269,7 @@ class DdSdkReactNative {
|
|
|
269
269
|
...accountInfo.extraInfo,
|
|
270
270
|
...extraAccountInfo
|
|
271
271
|
};
|
|
272
|
-
await
|
|
272
|
+
await _DdSdk.DdSdk.addAccountExtraInfo(extraInfo);
|
|
273
273
|
_AccountInfoSingleton.AccountInfoSingleton.getInstance().addAccountExtraInfo(extraAccountInfo);
|
|
274
274
|
};
|
|
275
275
|
|
|
@@ -280,7 +280,7 @@ class DdSdkReactNative {
|
|
|
280
280
|
*/
|
|
281
281
|
static setTrackingConsent = consent => {
|
|
282
282
|
_InternalLog.InternalLog.log(`Setting consent ${consent}`, _SdkVerbosity.SdkVerbosity.DEBUG);
|
|
283
|
-
return
|
|
283
|
+
return _DdSdk.DdSdk.setTrackingConsent(consent);
|
|
284
284
|
};
|
|
285
285
|
|
|
286
286
|
/**
|
|
@@ -289,7 +289,7 @@ class DdSdkReactNative {
|
|
|
289
289
|
*/
|
|
290
290
|
static clearAllData = () => {
|
|
291
291
|
_InternalLog.InternalLog.log('Clearing all data', _SdkVerbosity.SdkVerbosity.DEBUG);
|
|
292
|
-
return
|
|
292
|
+
return _DdSdk.DdSdk.clearAllData();
|
|
293
293
|
};
|
|
294
294
|
static buildConfiguration = (configuration, params) => {
|
|
295
295
|
if (configuration.additionalConfiguration === undefined) {
|