@datadog/mobile-react-native-webview 2.14.1 → 3.0.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.
|
@@ -23,8 +23,8 @@ Pod::Spec.new do |s|
|
|
|
23
23
|
end
|
|
24
24
|
|
|
25
25
|
# /!\ Remember to keep the version in sync with DatadogSDKReactNative.podspec
|
|
26
|
-
s.dependency 'DatadogWebViewTracking', '
|
|
27
|
-
s.dependency 'DatadogInternal', '
|
|
26
|
+
s.dependency 'DatadogWebViewTracking', '3.4.0'
|
|
27
|
+
s.dependency 'DatadogInternal', '3.4.0'
|
|
28
28
|
s.dependency 'DatadogSDKReactNative'
|
|
29
29
|
|
|
30
30
|
s.test_spec 'Tests' do |test_spec|
|
package/android/build.gradle
CHANGED
|
@@ -196,7 +196,7 @@ dependencies {
|
|
|
196
196
|
implementation "com.facebook.react:react-android:$reactNativeVersion"
|
|
197
197
|
}
|
|
198
198
|
|
|
199
|
-
implementation "com.datadoghq:dd-sdk-android-webview:
|
|
199
|
+
implementation "com.datadoghq:dd-sdk-android-webview:3.4.0"
|
|
200
200
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
201
201
|
|
|
202
202
|
implementation project(path: ':datadog_mobile-react-native')
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
DatadogSDKReactNativeWebView_kotlinVersion=1.7.21
|
|
2
|
-
DatadogSDKReactNativeWebView_minSdkVersion=
|
|
2
|
+
DatadogSDKReactNativeWebView_minSdkVersion=23
|
|
3
3
|
DatadogSDKReactNativeWebView_compileSdkVersion=33
|
|
4
4
|
DatadogSDKReactNativeWebView_buildToolsVersion=33.0.0
|
|
5
5
|
DatadogSDKReactNativeWebView_targetSdkVersion=33
|
|
@@ -8,26 +8,27 @@ import WebKit
|
|
|
8
8
|
import DatadogWebViewTracking
|
|
9
9
|
import DatadogSDKReactNative
|
|
10
10
|
import DatadogCore
|
|
11
|
+
import DatadogInternal
|
|
11
12
|
|
|
12
13
|
@objc public class RCTDatadogWebViewTracking: NSObject {
|
|
13
14
|
var webView: RCTDatadogWebView? = nil
|
|
14
15
|
var allowedHosts: Set<String> = Set()
|
|
15
|
-
var
|
|
16
|
+
var onSdkInitializedListener: OnSdkInitializedListener?
|
|
16
17
|
|
|
17
18
|
public override init() {
|
|
18
19
|
super.init()
|
|
19
|
-
self.
|
|
20
|
+
self.onSdkInitializedListener = { [weak self] (core: DatadogCoreProtocol) in
|
|
20
21
|
guard let strongSelf = self, let webView = strongSelf.webView else {
|
|
21
22
|
return
|
|
22
23
|
}
|
|
23
24
|
strongSelf.enableWebViewTracking(
|
|
24
25
|
webView: webView,
|
|
25
26
|
allowedHosts: strongSelf.allowedHosts,
|
|
26
|
-
core:
|
|
27
|
+
core: CoreRegistry.default
|
|
27
28
|
)
|
|
28
29
|
}
|
|
29
30
|
}
|
|
30
|
-
|
|
31
|
+
|
|
31
32
|
/**
|
|
32
33
|
Enables tracking on the given WebView.
|
|
33
34
|
|
|
@@ -42,15 +43,16 @@ import DatadogCore
|
|
|
42
43
|
|
|
43
44
|
guard !webView.isTrackingEnabled else { return }
|
|
44
45
|
|
|
45
|
-
if
|
|
46
|
-
enableWebViewTracking(webView: webView, allowedHosts: allowedHosts, core:
|
|
47
|
-
} else if let
|
|
48
|
-
DatadogSDKWrapper.shared.
|
|
46
|
+
if CoreRegistry.isRegistered(instanceName: CoreRegistry.defaultInstanceName) {
|
|
47
|
+
enableWebViewTracking(webView: webView, allowedHosts: allowedHosts, core: CoreRegistry.default)
|
|
48
|
+
} else if let onSdkInitializedListener = self.onSdkInitializedListener {
|
|
49
|
+
DatadogSDKWrapper.shared.addOnSdkInitializedListener(listener: onSdkInitializedListener)
|
|
49
50
|
} else {
|
|
50
51
|
// TODO: Report initialization problem
|
|
51
52
|
}
|
|
52
53
|
}
|
|
53
54
|
|
|
55
|
+
|
|
54
56
|
private func enableWebViewTracking(
|
|
55
57
|
webView: RCTDatadogWebView,
|
|
56
58
|
allowedHosts: Set<String>,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datadog/mobile-react-native-webview",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "A client-side React Native module to interact with react-native-webview and Datadog",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"datadog",
|
|
@@ -94,5 +94,5 @@
|
|
|
94
94
|
"javaPackageName": "com.datadog.reactnative.webview"
|
|
95
95
|
}
|
|
96
96
|
},
|
|
97
|
-
"gitHead": "
|
|
97
|
+
"gitHead": "2a8f57a6b7fa68cfa8a03ae202d65ecc64e3e42d"
|
|
98
98
|
}
|