@mixpanel/react-native-session-replay 0.3.0 → 1.0.1
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/MixpanelReactNativeSessionReplay.podspec +1 -1
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/mixpanelreactnativesessionreplay/MixpanelReactNativeSessionReplayModule.kt +12 -1
- package/ios/MixpanelReactNativeSessionReplay.mm +13 -0
- package/ios/MixpanelSwiftSessionReplay.swift +9 -1
- package/lib/module/NativeMixpanelReactNativeSessionReplay.js.map +1 -1
- package/lib/module/index.js +22 -2
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/NativeMixpanelReactNativeSessionReplay.d.ts +1 -0
- package/lib/typescript/src/NativeMixpanelReactNativeSessionReplay.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +10 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/NativeMixpanelReactNativeSessionReplay.ts +1 -0
- package/src/index.tsx +18 -0
|
@@ -15,7 +15,7 @@ Pod::Spec.new do |s|
|
|
|
15
15
|
|
|
16
16
|
s.source_files = "ios/**/*.{h,m,mm,cpp,swift}"
|
|
17
17
|
s.private_header_files = "ios/**/*.h"
|
|
18
|
-
s.dependency 'MixpanelSessionReplay', '1.
|
|
18
|
+
s.dependency 'MixpanelSessionReplay', '1.2.0'
|
|
19
19
|
# Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
|
|
20
20
|
# See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.
|
|
21
21
|
if respond_to?(:install_modules_dependencies, true)
|
package/android/build.gradle
CHANGED
|
@@ -79,7 +79,7 @@ dependencies {
|
|
|
79
79
|
implementation "com.mixpanel.android:mixpanel-android:8.0.2"
|
|
80
80
|
|
|
81
81
|
// Mixpanel Android Session Replay SDK dependency
|
|
82
|
-
implementation "com.mixpanel.android:mixpanel-android-session-replay:1.0.
|
|
82
|
+
implementation "com.mixpanel.android:mixpanel-android-session-replay:1.0.5"
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
react {
|
|
@@ -165,6 +165,17 @@ class MixpanelReactNativeSessionReplayModule(reactContext: ReactApplicationConte
|
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
167
|
|
|
168
|
+
@ReactMethod
|
|
169
|
+
override fun flush(promise: Promise) {
|
|
170
|
+
try {
|
|
171
|
+
MPSessionReplay.getInstance()?.flush(onComplete = {
|
|
172
|
+
promise.resolve(null)
|
|
173
|
+
}) ?: promise.resolve(null)
|
|
174
|
+
} catch (e: Exception) {
|
|
175
|
+
promise.resolve(null)
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
168
179
|
/**
|
|
169
180
|
* Safely configure sensitive classes for comprehensive React Native view masking
|
|
170
181
|
* Supports both old and new React Native architectures with crash prevention
|
|
@@ -296,7 +307,7 @@ class MixpanelReactNativeSessionReplayModule(reactContext: ReactApplicationConte
|
|
|
296
307
|
|
|
297
308
|
companion object {
|
|
298
309
|
const val NAME = "MixpanelReactNativeSessionReplay"
|
|
299
|
-
const val LIB_VERSION = "0.
|
|
310
|
+
const val LIB_VERSION = "1.0.1"
|
|
300
311
|
const val MP_LIB = "react-native-sr"
|
|
301
312
|
}
|
|
302
313
|
}
|
|
@@ -95,6 +95,19 @@ RCT_EXPORT_METHOD(getReplayId:(RCTPromiseResolveBlock)resolve
|
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
+
RCT_EXPORT_METHOD(flush:(RCTPromiseResolveBlock)resolve
|
|
99
|
+
reject:(RCTPromiseRejectBlock)reject)
|
|
100
|
+
{
|
|
101
|
+
@try {
|
|
102
|
+
[MixpanelSwiftSessionReplay flushWithCompletionHandler:^{
|
|
103
|
+
resolve(nil);
|
|
104
|
+
}];
|
|
105
|
+
}
|
|
106
|
+
@catch (NSException *exception) {
|
|
107
|
+
reject(@"FLUSH_ERROR", exception.reason, nil);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
98
111
|
#ifdef RCT_NEW_ARCH_ENABLED
|
|
99
112
|
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
|
|
100
113
|
(const facebook::react::ObjCTurboModule::InitParams &)params
|
|
@@ -3,7 +3,7 @@ import MixpanelSessionReplay
|
|
|
3
3
|
import UIKit
|
|
4
4
|
|
|
5
5
|
@objc public class MixpanelSwiftSessionReplay: NSObject {
|
|
6
|
-
static let libVersion = "0.
|
|
6
|
+
static let libVersion = "1.0.1"
|
|
7
7
|
static let mpLib = "react-native-sr"
|
|
8
8
|
|
|
9
9
|
@objc public static func startRecording(recordingSessionsPercent: Double = 100.0) {
|
|
@@ -74,6 +74,14 @@ import UIKit
|
|
|
74
74
|
return MPSessionReplay.getReplayId()
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
+
@objc public static func flush(completionHandler: @escaping () -> Void) {
|
|
78
|
+
guard let instance = MPSessionReplay.getInstance() else {
|
|
79
|
+
completionHandler()
|
|
80
|
+
return
|
|
81
|
+
}
|
|
82
|
+
instance.flush(completionHandler: completionHandler)
|
|
83
|
+
}
|
|
84
|
+
|
|
77
85
|
@objc public static func setMPReplaySensitive(value: Bool, view: UIView) {
|
|
78
86
|
view.mpReplaySensitive = value
|
|
79
87
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NativeModules","TurboModuleRegistry","isTurboModuleEnabled","global","__turboModuleProxy","MixpanelReactNativeSessionReplay","get","e","console","warn","errorMessage","Error"],"sourceRoot":"../../src","sources":["NativeMixpanelReactNativeSessionReplay.ts"],"mappings":";;AACA,SAASA,aAAa,EAAEC,mBAAmB,QAAQ,cAAc;;
|
|
1
|
+
{"version":3,"names":["NativeModules","TurboModuleRegistry","isTurboModuleEnabled","global","__turboModuleProxy","MixpanelReactNativeSessionReplay","get","e","console","warn","errorMessage","Error"],"sourceRoot":"../../src","sources":["NativeMixpanelReactNativeSessionReplay.ts"],"mappings":";;AACA,SAASA,aAAa,EAAEC,mBAAmB,QAAQ,cAAc;;AAiBjE;;AAKA;AACA;AACA,MAAMC,oBAAoB,GAAGC,MAAM,CAACC,kBAAkB,IAAI,IAAI;AAE9D,IAAIC,gCAA6C,GAAG,IAAI;AAExD,IAAIH,oBAAoB,EAAE;EACxB;EACA,IAAI;IACFG,gCAAgC,GAAGJ,mBAAmB,CAACK,GAAG,CACxD,kCACF,CAAC;EACH,CAAC,CAAC,OAAOC,CAAC,EAAE;IACV;IACAC,OAAO,CAACC,IAAI,CACV,4FACF,CAAC;EACH;AACF;;AAEA;AACA,IAAI,CAACJ,gCAAgC,EAAE;EACrCA,gCAAgC,GAC9BL,aAAa,CAACK,gCAAgC;AAClD;;AAEA;AACA,IAAI,CAACA,gCAAgC,EAAE;EACrC,MAAMK,YAAY,GAChB,+FAA+F,GAC/F,mJAAmJ,GACnJ,4DAA4D,GAC5D,2GAA2G,GAC3G,sFAAsF,GACtF,yEAAyE;EAE3E,MAAM,IAAIC,KAAK,CAACD,YAAY,CAAC;AAC/B;AAEA,eAAeL,gCAAgC","ignoreList":[]}
|
package/lib/module/index.js
CHANGED
|
@@ -99,7 +99,14 @@ export class MPSessionReplayConfig {
|
|
|
99
99
|
autoMaskedViews: transformedAutoMaskedViews,
|
|
100
100
|
autoStartRecording: this.autoStartRecording,
|
|
101
101
|
flushInterval: this.flushInterval,
|
|
102
|
-
enableLogging: this.enableLogging
|
|
102
|
+
enableLogging: this.enableLogging,
|
|
103
|
+
// iOS-specific config to enable session replay on iOS 26 and later
|
|
104
|
+
...Platform.select({
|
|
105
|
+
ios: {
|
|
106
|
+
enableSessionReplayOniOS26AndLater: true
|
|
107
|
+
},
|
|
108
|
+
default: {}
|
|
109
|
+
})
|
|
103
110
|
};
|
|
104
111
|
if (Platform.OS === 'ios' || Platform.OS === 'android') {
|
|
105
112
|
// console.log(Platform.OS, JSON.stringify(config));
|
|
@@ -196,6 +203,18 @@ async function identify(distinctId) {
|
|
|
196
203
|
async function getReplayId() {
|
|
197
204
|
return MixpanelReactNativeSessionReplay.getReplayId();
|
|
198
205
|
}
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* Manually triggers a flush of pending session replay events.
|
|
209
|
+
*
|
|
210
|
+
* This method forces the SDK to immediately upload all pending Session Replay events to Mixpanel,
|
|
211
|
+
* bypassing the normal flush interval. The returned promise resolves when the flush operation completes.
|
|
212
|
+
*
|
|
213
|
+
* @returns A promise that resolves when the flush operation has completed.
|
|
214
|
+
*/
|
|
215
|
+
async function flush() {
|
|
216
|
+
return MixpanelReactNativeSessionReplay.flush();
|
|
217
|
+
}
|
|
199
218
|
export { MPSessionReplayView } from "./MixpanelSessionReplayView.js";
|
|
200
219
|
export const MPSessionReplay = {
|
|
201
220
|
initialize,
|
|
@@ -203,6 +222,7 @@ export const MPSessionReplay = {
|
|
|
203
222
|
stopRecording,
|
|
204
223
|
isRecording,
|
|
205
224
|
identify,
|
|
206
|
-
getReplayId
|
|
225
|
+
getReplayId,
|
|
226
|
+
flush
|
|
207
227
|
};
|
|
208
228
|
//# sourceMappingURL=index.js.map
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Platform","MixpanelReactNativeSessionReplay","MPSessionReplayMask","MPSessionReplayConfig","constructor","wifiOnly","autoStartRecording","recordingSessionsPercent","autoMaskedViews","Image","Text","Web","Map","flushInterval","enableLogging","transformMaskValueForPlatform","value","OS","charAt","toUpperCase","slice","toJSON","transformedAutoMaskedViews","filter","mask","map","config","JSON","stringify","initialize","token","distinctId","Error","undefined","json","startRecording","stopRecording","isRecording","identify","getReplayId","MPSessionReplayView","MPSessionReplay"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SAASA,QAAQ,QAAQ,cAAc;AACvC,OAAOC,gCAAgC,MAAM,6CAA0C;AAEvF,WAAYC,mBAAmB,0BAAnBA,mBAAmB;EAAnBA,mBA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A0B,GAAG,IAAI,CAACd,eAAe,CACpDe,MAAM,CACJC,IAAI,IACH,EAAExB,QAAQ,CAACiB,EAAE,KAAK,SAAS,IAAIO,IAAI,KAAKtB,mBAAmB,CAACU,GAAG,CACnE,CAAC,CACAa,GAAG,CAAED,IAAI,IAAK,IAAI,CAACT,6BAA6B,CAACS,IAAI,CAAC,CAAC;IAE1D,MAAME,MAAM,GAAG;MACbrB,QAAQ,EAAE,IAAI,CAACA,QAAQ;MACvBE,wBAAwB,EAAE,IAAI,CAACA,wBAAwB;MACvDC,eAAe,EAAEc,0BAA0B;MAC3ChB,kBAAkB,EAAE,IAAI,CAACA,kBAAkB;MAC3CO,aAAa,EAAE,IAAI,CAACA,aAAa;MACjCC,aAAa,EAAE,IAAI,CAACA;
|
|
1
|
+
{"version":3,"names":["Platform","MixpanelReactNativeSessionReplay","MPSessionReplayMask","MPSessionReplayConfig","constructor","wifiOnly","autoStartRecording","recordingSessionsPercent","autoMaskedViews","Image","Text","Web","Map","flushInterval","enableLogging","transformMaskValueForPlatform","value","OS","charAt","toUpperCase","slice","toJSON","transformedAutoMaskedViews","filter","mask","map","config","select","ios","enableSessionReplayOniOS26AndLater","default","JSON","stringify","initialize","token","distinctId","Error","undefined","json","startRecording","stopRecording","isRecording","identify","getReplayId","flush","MPSessionReplayView","MPSessionReplay"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SAASA,QAAQ,QAAQ,cAAc;AACvC,OAAOC,gCAAgC,MAAM,6CAA0C;AAEvF,WAAYC,mBAAmB,0BAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAA,OAAnBA,mBAAmB;AAAA;AAO/B,OAAO,MAAMC,qBAAqB,CAAC;EACjC;AACF;AACA;AACA;AACA;AACA;AACA;AACA;;EAGE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;EAGE;AACF;AACA;AACA;AACA;AACA;;E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EAAEC,UAAU,EAAEG,IAAI,CAAC;AAC7E;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAeC,cAAcA,CAC3BhC,wBAAgC,GAAG,GAAG,EACvB;EACf,OAAON,gCAAgC,CAACsC,cAAc,CACpDhC,wBACF,CAAC;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAeiC,aAAaA,CAAA,EAAkB;EAC5C,OAAOvC,gCAAgC,CAACuC,aAAa,CAAC,CAAC;AACzD;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAeC,WAAWA,CAAA,EAAqB;EAC7C,OAAOxC,gCAAgC,CAACwC,WAAW,CAAC,CAAC;AACvD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAeC,QAAQA,CAACP,UAAkB,EAAiB;EACzD,IAAI,CAACA,UAAU,IAAI,OAAOA,UAAU,KAAK,QAAQ,EAAE;IACjD,MAAM,IAAIC,KAAK,CAAC,6CAA6C,CAAC;EAChE;EAEA,OAAOnC,gCAAgC,CAACyC,QAAQ,CAACP,UAAU,CAAC;AAC9D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAeQ,WAAWA,CAAA,EAA2B;EACnD,OAAO1C,gCAAgC,CAAC0C,WAAW,CAAC,CAAC;AACvD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAeC,KAAKA,CAAA,EAAkB;EACpC,OAAO3C,gCAAgC,CAAC2C,KAAK,CAAC,CAAC;AACjD;AAEA,SAASC,mBAAmB,QAAQ,gCAA6B;AAEjE,OAAO,MAAMC,eAAe,GAAG;EAC7Bb,UAAU;EACVM,cAAc;EACdC,aAAa;EACbC,WAAW;EACXC,QAAQ;EACRC,WAAW;EACXC;AACF,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeMixpanelReactNativeSessionReplay.d.ts","sourceRoot":"","sources":["../../../src/NativeMixpanelReactNativeSessionReplay.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC,UAAU,CACR,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,IAAI,CAAC,CAAC;IACjB,cAAc,CAAC,wBAAwB,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAChE,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAE/B,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IAChC,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5C,WAAW,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"NativeMixpanelReactNativeSessionReplay.d.ts","sourceRoot":"","sources":["../../../src/NativeMixpanelReactNativeSessionReplay.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC,UAAU,CACR,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,IAAI,CAAC,CAAC;IACjB,cAAc,CAAC,wBAAwB,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAChE,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAE/B,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IAChC,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5C,WAAW,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IACtC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB;AAGD,OAAO,CAAC,MAAM,CAAC;IACb,IAAI,kBAAkB,EAAE,OAAO,GAAG,SAAS,CAAC;CAC7C;wBAyCkD,IAAI;AAAvD,wBAAwD"}
|
|
@@ -122,6 +122,15 @@ declare function identify(distinctId: string): Promise<void>;
|
|
|
122
122
|
* @returns A promise that resolves to the replay ID string or null if no replay is active.
|
|
123
123
|
*/
|
|
124
124
|
declare function getReplayId(): Promise<string | null>;
|
|
125
|
+
/**
|
|
126
|
+
* Manually triggers a flush of pending session replay events.
|
|
127
|
+
*
|
|
128
|
+
* This method forces the SDK to immediately upload all pending Session Replay events to Mixpanel,
|
|
129
|
+
* bypassing the normal flush interval. The returned promise resolves when the flush operation completes.
|
|
130
|
+
*
|
|
131
|
+
* @returns A promise that resolves when the flush operation has completed.
|
|
132
|
+
*/
|
|
133
|
+
declare function flush(): Promise<void>;
|
|
125
134
|
export { MPSessionReplayView } from './MixpanelSessionReplayView';
|
|
126
135
|
export declare const MPSessionReplay: {
|
|
127
136
|
initialize: typeof initialize;
|
|
@@ -130,5 +139,6 @@ export declare const MPSessionReplay: {
|
|
|
130
139
|
isRecording: typeof isRecording;
|
|
131
140
|
identify: typeof identify;
|
|
132
141
|
getReplayId: typeof getReplayId;
|
|
142
|
+
flush: typeof flush;
|
|
133
143
|
};
|
|
134
144
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAGA,oBAAY,mBAAmB;IAC7B,IAAI,SAAS;IACb,GAAG,QAAQ;IACX,GAAG,QAAQ;IACX,KAAK,UAAU;CAChB;AAED,qBAAa,qBAAqB;IAChC;;;;;;;OAOG;IACH,QAAQ,EAAE,OAAO,CAAC;IAElB;;;;;;;;;;OAUG;IACH,wBAAwB,EAAE,MAAM,CAAC;IAEjC;;;;;OAKG;IACH,eAAe,EAAE,mBAAmB,EAAE,CAAC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AY,GACrC,OAAO,CAAC,IAAI,CAAC,CAIf;AAED;;;;GAIG;AACH,iBAAe,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CAE5C;AAED;;;;GAIG;AACH,iBAAe,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC,CAE7C;AAED;;;;;;;;;GASG;AACH,iBAAe,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAMzD;AAED;;;;;;;GAOG;AACH,iBAAe,WAAW,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAEnD;AAED;;;;;;;GAOG;AACH,iBAAe,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAEpC;AAED,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAElE,eAAO,MAAM,eAAe;;;;;;;;CAQ3B,CAAC"}
|
package/package.json
CHANGED
|
@@ -13,6 +13,7 @@ export interface Spec extends TurboModule {
|
|
|
13
13
|
isRecording(): Promise<boolean>;
|
|
14
14
|
identify(distinctId: string): Promise<void>;
|
|
15
15
|
getReplayId(): Promise<string | null>;
|
|
16
|
+
flush(): Promise<void>;
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
// Type declaration for global to include __turboModuleProxy
|
package/src/index.tsx
CHANGED
|
@@ -118,6 +118,11 @@ export class MPSessionReplayConfig {
|
|
|
118
118
|
autoStartRecording: this.autoStartRecording,
|
|
119
119
|
flushInterval: this.flushInterval,
|
|
120
120
|
enableLogging: this.enableLogging,
|
|
121
|
+
// iOS-specific config to enable session replay on iOS 26 and later
|
|
122
|
+
...Platform.select({
|
|
123
|
+
ios: { enableSessionReplayOniOS26AndLater: true },
|
|
124
|
+
default: {},
|
|
125
|
+
}),
|
|
121
126
|
};
|
|
122
127
|
|
|
123
128
|
if (Platform.OS === 'ios' || Platform.OS === 'android') {
|
|
@@ -229,6 +234,18 @@ async function getReplayId(): Promise<string | null> {
|
|
|
229
234
|
return MixpanelReactNativeSessionReplay.getReplayId();
|
|
230
235
|
}
|
|
231
236
|
|
|
237
|
+
/**
|
|
238
|
+
* Manually triggers a flush of pending session replay events.
|
|
239
|
+
*
|
|
240
|
+
* This method forces the SDK to immediately upload all pending Session Replay events to Mixpanel,
|
|
241
|
+
* bypassing the normal flush interval. The returned promise resolves when the flush operation completes.
|
|
242
|
+
*
|
|
243
|
+
* @returns A promise that resolves when the flush operation has completed.
|
|
244
|
+
*/
|
|
245
|
+
async function flush(): Promise<void> {
|
|
246
|
+
return MixpanelReactNativeSessionReplay.flush();
|
|
247
|
+
}
|
|
248
|
+
|
|
232
249
|
export { MPSessionReplayView } from './MixpanelSessionReplayView';
|
|
233
250
|
|
|
234
251
|
export const MPSessionReplay = {
|
|
@@ -238,4 +255,5 @@ export const MPSessionReplay = {
|
|
|
238
255
|
isRecording,
|
|
239
256
|
identify,
|
|
240
257
|
getReplayId,
|
|
258
|
+
flush,
|
|
241
259
|
};
|