noibu-react-native 0.2.22 → 0.2.23
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/CHANGELOG.md
CHANGED
|
@@ -3,16 +3,19 @@
|
|
|
3
3
|
All notable changes of the noibu-react-native SDK release series are documented in this file using
|
|
4
4
|
the [Keep a CHANGELOG](https://keepachangelog.com/) principles.
|
|
5
5
|
|
|
6
|
+
## 0.2.23
|
|
7
|
+
- **iOS: WebView replay support**
|
|
8
|
+
|
|
6
9
|
## 0.2.22
|
|
7
|
-
- **
|
|
10
|
+
- **Adds support for new architecture**
|
|
8
11
|
|
|
9
12
|
## 0.2.21
|
|
10
|
-
- **
|
|
13
|
+
- **ANDROID: Add mapper for expo vector icons**
|
|
11
14
|
|
|
12
15
|
## 0.2.20
|
|
13
16
|
|
|
14
17
|
### Added
|
|
15
|
-
- **
|
|
18
|
+
- **ANDROID: WebView replay support (mobile transformer)**
|
|
16
19
|
- Integrates a WebView-specific transformer to convert rrweb full/incremental snapshots from WebViews into web events.
|
|
17
20
|
- Snapshots generated during transformation are now included at the top level of the transformed output, emitted immediately after the event that produced them.
|
|
18
21
|
- **Live subscription emits multiple events when applicable**
|
package/dist/constants.js
CHANGED
|
@@ -24,7 +24,7 @@ const CONTENT_TYPE = 'content-type';
|
|
|
24
24
|
* Gets the script id from the cookie object, returns default if cannot be found
|
|
25
25
|
*/
|
|
26
26
|
function GET_SCRIPT_ID() {
|
|
27
|
-
return "1.0.104-rn-sdk-0.2.
|
|
27
|
+
return "1.0.104-rn-sdk-0.2.23" ;
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
30
30
|
* Gets the max metro recon number
|
|
@@ -8,7 +8,7 @@ const LINKING_ERROR = `The package 'noibu-session-replay' doesn't seem to be lin
|
|
|
8
8
|
// Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) + TODO: add back when iOS is supported.
|
|
9
9
|
'- You rebuilt the app after installing the package\n' +
|
|
10
10
|
'- You are not using Expo Go\n';
|
|
11
|
-
const { NativeSessionRecorder: LegacyNativeSessionRecorder,
|
|
11
|
+
const { NativeSessionRecorder: LegacyNativeSessionRecorder, NoibuSessionRecorder } = NativeModules;
|
|
12
12
|
const NativeSessionRecorder = TurboNativeSessionRecorder !== null && TurboNativeSessionRecorder !== void 0 ? TurboNativeSessionRecorder : LegacyNativeSessionRecorder;
|
|
13
13
|
let nativeModuleEmitter;
|
|
14
14
|
const SupportedPlatforms = ['android', 'ios'];
|
|
@@ -77,7 +77,7 @@ function subscribeToNativeEvent(callback) {
|
|
|
77
77
|
}
|
|
78
78
|
if (Platform.OS === 'ios') {
|
|
79
79
|
if (!nativeModuleEmitter) {
|
|
80
|
-
nativeModuleEmitter = new NativeEventEmitter(
|
|
80
|
+
nativeModuleEmitter = new NativeEventEmitter(NoibuSessionRecorder);
|
|
81
81
|
noibuLog('nativeModuleEmitter', nativeModuleEmitter);
|
|
82
82
|
}
|
|
83
83
|
nativeModuleEmitter.addListener('iosPOCRecordingEvent', event => {
|
|
@@ -90,7 +90,7 @@ function subscribeToNativeEvent(callback) {
|
|
|
90
90
|
}
|
|
91
91
|
});
|
|
92
92
|
if (!isIOSInitialized) {
|
|
93
|
-
|
|
93
|
+
NoibuSessionRecorder.startIOS();
|
|
94
94
|
isIOSInitialized = true;
|
|
95
95
|
}
|
|
96
96
|
}
|
package/ios/IOSPocEmitter.m
CHANGED
package/ios/IOSPocEmitter.swift
CHANGED
|
@@ -2,8 +2,8 @@ import Foundation
|
|
|
2
2
|
import React
|
|
3
3
|
import NoibuSDK
|
|
4
4
|
|
|
5
|
-
@objc(
|
|
6
|
-
class
|
|
5
|
+
@objc(NoibuSessionRecorder)
|
|
6
|
+
class NoibuSessionRecorder: RCTEventEmitter {
|
|
7
7
|
|
|
8
8
|
private var hasListeners = false
|
|
9
9
|
|
|
@@ -32,27 +32,26 @@ class IOSPocEmitter: RCTEventEmitter {
|
|
|
32
32
|
let NOIBU_HOST = "https://noibu.com/"
|
|
33
33
|
|
|
34
34
|
let config = NoibuConfig(apiKey: NOIBU_API_KEY, host: NOIBU_HOST)
|
|
35
|
-
// config.debug = true // Enable debug logging to see
|
|
35
|
+
// config.debug = true // Enable debug logging to see emitted events
|
|
36
36
|
|
|
37
|
-
config.onMobileEventTransformed = { [weak self]
|
|
37
|
+
config.onMobileEventTransformed = { [weak self] eventsJsonString in
|
|
38
38
|
guard let self = self, self.bridge != nil else { return }
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
guard let jsonData = transformedData.data(using: .utf8) else {
|
|
43
|
-
NSLog("❌ Failed to encode transformedData as UTF-8")
|
|
39
|
+
guard let eventsData = eventsJsonString.data(using: .utf8) else {
|
|
40
|
+
NSLog("❌ Failed to encode events JSON string as UTF-8")
|
|
44
41
|
return
|
|
45
42
|
}
|
|
46
43
|
|
|
47
44
|
do {
|
|
48
|
-
let
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
45
|
+
let decodedJSON = try JSONSerialization.jsonObject(with: eventsData, options: [])
|
|
46
|
+
if let events = decodedJSON as? [Any] {
|
|
47
|
+
for event in events {
|
|
48
|
+
self.sendEvent(withName: "iosPOCRecordingEvent", body: ["message": event])
|
|
49
|
+
}
|
|
50
|
+
} else {
|
|
51
|
+
self.sendEvent(withName: "iosPOCRecordingEvent", body: ["message": decodedJSON])
|
|
52
52
|
}
|
|
53
|
-
self.sendEvent(withName: "iosPOCRecordingEvent", body: ["message": finalMessage])
|
|
54
53
|
} catch {
|
|
55
|
-
NSLog("❌ Failed to parse
|
|
54
|
+
NSLog("❌ Failed to parse events JSON: %@", error.localizedDescription)
|
|
56
55
|
}
|
|
57
56
|
}
|
|
58
57
|
|
|
@@ -26,7 +26,7 @@ Pod::Spec.new do |s|
|
|
|
26
26
|
#s.vendored_frameworks = "ios/SessionRecorder.xcframework"
|
|
27
27
|
#s.vendored_frameworks = "ios/Noibu.xcframework"
|
|
28
28
|
|
|
29
|
-
s.dependency 'NoibuSDK', '0.0.
|
|
29
|
+
s.dependency 'NoibuSDK', '0.0.7'
|
|
30
30
|
s.pod_target_xcconfig = {
|
|
31
31
|
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/noibu-react-native/ios/**\""
|
|
32
32
|
}
|
package/package.json
CHANGED