@mixpanel/react-native-session-replay 1.2.0 → 1.4.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/MixpanelReactNativeSessionReplay.podspec +1 -1
- package/README.md +2 -0
- package/android/build.gradle +10 -3
- package/android/src/main/java/com/mixpanelreactnativesessionreplay/MixpanelReactNativeSessionReplayModule.kt +54 -0
- package/android/src/main/java/com/mixpanelreactnativesessionreplay/MixpanelSessionReplayView.kt +56 -0
- package/android/src/main/java/com/mixpanelreactnativesessionreplay/MixpanelSessionReplayViewManager.kt +5 -0
- package/android/src/test/java/com/mixpanelreactnativesessionreplay/WireframeTextDeclarationTest.kt +41 -0
- package/ios/MixpanelReactNativeSessionReplay.h +7 -2
- package/ios/MixpanelReactNativeSessionReplay.mm +35 -2
- package/ios/MixpanelSessionReplayViewManager.mm +9 -0
- package/ios/MixpanelSwiftSessionReplay.swift +43 -1
- package/lib/module/MixpanelSessionReplayView.js.map +1 -1
- package/lib/module/NativeMixpanelReactNativeSessionReplay.js.map +1 -1
- package/lib/module/index.js +623 -5
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/MixpanelSessionReplayView.d.ts +32 -0
- package/lib/typescript/src/MixpanelSessionReplayView.d.ts.map +1 -1
- package/lib/typescript/src/NativeMixpanelReactNativeSessionReplay.d.ts +2 -0
- package/lib/typescript/src/NativeMixpanelReactNativeSessionReplay.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +351 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/package.json +2 -24
- package/src/MixpanelSessionReplayView.tsx +33 -0
- package/src/NativeMixpanelReactNativeSessionReplay.ts +7 -0
- package/src/index.tsx +688 -4
- package/android/app/build/generated/source/codegen/java/com/facebook/fbreact/specs/NativeMixpanelReactNativeSessionReplaySpec.java +0 -62
- package/android/app/build/generated/source/codegen/jni/CMakeLists.txt +0 -36
- package/android/app/build/generated/source/codegen/jni/MixpanelReactNativeSessionReplaySpec-generated.cpp +0 -68
- package/android/app/build/generated/source/codegen/jni/MixpanelReactNativeSessionReplaySpec.h +0 -31
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/MixpanelReactNativeSessionReplaySpec/MixpanelReactNativeSessionReplaySpecJSI-generated.cpp +0 -67
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/MixpanelReactNativeSessionReplaySpec/MixpanelReactNativeSessionReplaySpecJSI.h +0 -125
- package/android/generated/java/com/mpsessionreplay/NativeMpSessionReplaySpec.java +0 -49
- package/android/generated/jni/CMakeLists.txt +0 -36
- package/android/generated/jni/RNMpSessionReplaySpec-generated.cpp +0 -50
- package/android/generated/jni/RNMpSessionReplaySpec.h +0 -31
- package/android/generated/jni/react/renderer/components/RNMpSessionReplaySpec/RNMpSessionReplaySpecJSI-generated.cpp +0 -51
- package/android/generated/jni/react/renderer/components/RNMpSessionReplaySpec/RNMpSessionReplaySpecJSI.h +0 -98
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
-
*
|
|
5
|
-
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
-
* once the code is regenerated.
|
|
7
|
-
*
|
|
8
|
-
* @generated by codegen project: GenerateModuleJavaSpec.js
|
|
9
|
-
*
|
|
10
|
-
* @nolint
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
package com.facebook.fbreact.specs;
|
|
14
|
-
|
|
15
|
-
import com.facebook.proguard.annotations.DoNotStrip;
|
|
16
|
-
import com.facebook.react.bridge.Promise;
|
|
17
|
-
import com.facebook.react.bridge.ReactApplicationContext;
|
|
18
|
-
import com.facebook.react.bridge.ReactContextBaseJavaModule;
|
|
19
|
-
import com.facebook.react.bridge.ReactMethod;
|
|
20
|
-
import com.facebook.react.turbomodule.core.interfaces.TurboModule;
|
|
21
|
-
import javax.annotation.Nonnull;
|
|
22
|
-
|
|
23
|
-
public abstract class NativeMixpanelReactNativeSessionReplaySpec extends ReactContextBaseJavaModule implements TurboModule {
|
|
24
|
-
public static final String NAME = "MixpanelReactNativeSessionReplay";
|
|
25
|
-
|
|
26
|
-
public NativeMixpanelReactNativeSessionReplaySpec(ReactApplicationContext reactContext) {
|
|
27
|
-
super(reactContext);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
@Override
|
|
31
|
-
public @Nonnull String getName() {
|
|
32
|
-
return NAME;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
@ReactMethod
|
|
36
|
-
@DoNotStrip
|
|
37
|
-
public abstract void initialize(String token, String distinctId, String configJSON, Promise promise);
|
|
38
|
-
|
|
39
|
-
@ReactMethod
|
|
40
|
-
@DoNotStrip
|
|
41
|
-
public abstract void startRecording(double recordingSessionsPercent, Promise promise);
|
|
42
|
-
|
|
43
|
-
@ReactMethod
|
|
44
|
-
@DoNotStrip
|
|
45
|
-
public abstract void stopRecording(Promise promise);
|
|
46
|
-
|
|
47
|
-
@ReactMethod
|
|
48
|
-
@DoNotStrip
|
|
49
|
-
public abstract void isRecording(Promise promise);
|
|
50
|
-
|
|
51
|
-
@ReactMethod
|
|
52
|
-
@DoNotStrip
|
|
53
|
-
public abstract void identify(String distinctId, Promise promise);
|
|
54
|
-
|
|
55
|
-
@ReactMethod
|
|
56
|
-
@DoNotStrip
|
|
57
|
-
public abstract void getReplayId(Promise promise);
|
|
58
|
-
|
|
59
|
-
@ReactMethod
|
|
60
|
-
@DoNotStrip
|
|
61
|
-
public abstract void flush(Promise promise);
|
|
62
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
-
#
|
|
3
|
-
# This source code is licensed under the MIT license found in the
|
|
4
|
-
# LICENSE file in the root directory of this source tree.
|
|
5
|
-
|
|
6
|
-
cmake_minimum_required(VERSION 3.13)
|
|
7
|
-
set(CMAKE_VERBOSE_MAKEFILE on)
|
|
8
|
-
|
|
9
|
-
file(GLOB react_codegen_SRCS CONFIGURE_DEPENDS *.cpp react/renderer/components/MixpanelReactNativeSessionReplaySpec/*.cpp)
|
|
10
|
-
|
|
11
|
-
add_library(
|
|
12
|
-
react_codegen_MixpanelReactNativeSessionReplaySpec
|
|
13
|
-
OBJECT
|
|
14
|
-
${react_codegen_SRCS}
|
|
15
|
-
)
|
|
16
|
-
|
|
17
|
-
target_include_directories(react_codegen_MixpanelReactNativeSessionReplaySpec PUBLIC . react/renderer/components/MixpanelReactNativeSessionReplaySpec)
|
|
18
|
-
|
|
19
|
-
target_link_libraries(
|
|
20
|
-
react_codegen_MixpanelReactNativeSessionReplaySpec
|
|
21
|
-
fbjni
|
|
22
|
-
jsi
|
|
23
|
-
# We need to link different libraries based on whether we are building rncore or not, that's necessary
|
|
24
|
-
# because we want to break a circular dependency between react_codegen_rncore and reactnative
|
|
25
|
-
reactnative
|
|
26
|
-
)
|
|
27
|
-
|
|
28
|
-
target_compile_options(
|
|
29
|
-
react_codegen_MixpanelReactNativeSessionReplaySpec
|
|
30
|
-
PRIVATE
|
|
31
|
-
-DLOG_TAG=\"ReactNative\"
|
|
32
|
-
-fexceptions
|
|
33
|
-
-frtti
|
|
34
|
-
-std=c++20
|
|
35
|
-
-Wall
|
|
36
|
-
)
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
-
*
|
|
5
|
-
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
-
* once the code is regenerated.
|
|
7
|
-
*
|
|
8
|
-
* @generated by codegen project: GenerateModuleJniCpp.js
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
#include "MixpanelReactNativeSessionReplaySpec.h"
|
|
12
|
-
|
|
13
|
-
namespace facebook::react {
|
|
14
|
-
|
|
15
|
-
static facebook::jsi::Value __hostFunction_NativeMixpanelReactNativeSessionReplaySpecJSI_initialize(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
16
|
-
static jmethodID cachedMethodId = nullptr;
|
|
17
|
-
return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "initialize", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
static facebook::jsi::Value __hostFunction_NativeMixpanelReactNativeSessionReplaySpecJSI_startRecording(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
21
|
-
static jmethodID cachedMethodId = nullptr;
|
|
22
|
-
return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "startRecording", "(DLcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
static facebook::jsi::Value __hostFunction_NativeMixpanelReactNativeSessionReplaySpecJSI_stopRecording(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
26
|
-
static jmethodID cachedMethodId = nullptr;
|
|
27
|
-
return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "stopRecording", "(Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
static facebook::jsi::Value __hostFunction_NativeMixpanelReactNativeSessionReplaySpecJSI_isRecording(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
31
|
-
static jmethodID cachedMethodId = nullptr;
|
|
32
|
-
return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "isRecording", "(Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
static facebook::jsi::Value __hostFunction_NativeMixpanelReactNativeSessionReplaySpecJSI_identify(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
36
|
-
static jmethodID cachedMethodId = nullptr;
|
|
37
|
-
return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "identify", "(Ljava/lang/String;Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
static facebook::jsi::Value __hostFunction_NativeMixpanelReactNativeSessionReplaySpecJSI_getReplayId(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
41
|
-
static jmethodID cachedMethodId = nullptr;
|
|
42
|
-
return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "getReplayId", "(Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
static facebook::jsi::Value __hostFunction_NativeMixpanelReactNativeSessionReplaySpecJSI_flush(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
46
|
-
static jmethodID cachedMethodId = nullptr;
|
|
47
|
-
return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "flush", "(Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
NativeMixpanelReactNativeSessionReplaySpecJSI::NativeMixpanelReactNativeSessionReplaySpecJSI(const JavaTurboModule::InitParams ¶ms)
|
|
51
|
-
: JavaTurboModule(params) {
|
|
52
|
-
methodMap_["initialize"] = MethodMetadata {3, __hostFunction_NativeMixpanelReactNativeSessionReplaySpecJSI_initialize};
|
|
53
|
-
methodMap_["startRecording"] = MethodMetadata {1, __hostFunction_NativeMixpanelReactNativeSessionReplaySpecJSI_startRecording};
|
|
54
|
-
methodMap_["stopRecording"] = MethodMetadata {0, __hostFunction_NativeMixpanelReactNativeSessionReplaySpecJSI_stopRecording};
|
|
55
|
-
methodMap_["isRecording"] = MethodMetadata {0, __hostFunction_NativeMixpanelReactNativeSessionReplaySpecJSI_isRecording};
|
|
56
|
-
methodMap_["identify"] = MethodMetadata {1, __hostFunction_NativeMixpanelReactNativeSessionReplaySpecJSI_identify};
|
|
57
|
-
methodMap_["getReplayId"] = MethodMetadata {0, __hostFunction_NativeMixpanelReactNativeSessionReplaySpecJSI_getReplayId};
|
|
58
|
-
methodMap_["flush"] = MethodMetadata {0, __hostFunction_NativeMixpanelReactNativeSessionReplaySpecJSI_flush};
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
std::shared_ptr<TurboModule> MixpanelReactNativeSessionReplaySpec_ModuleProvider(const std::string &moduleName, const JavaTurboModule::InitParams ¶ms) {
|
|
62
|
-
if (moduleName == "MixpanelReactNativeSessionReplay") {
|
|
63
|
-
return std::make_shared<NativeMixpanelReactNativeSessionReplaySpecJSI>(params);
|
|
64
|
-
}
|
|
65
|
-
return nullptr;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
} // namespace facebook::react
|
package/android/app/build/generated/source/codegen/jni/MixpanelReactNativeSessionReplaySpec.h
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
-
*
|
|
5
|
-
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
-
* once the code is regenerated.
|
|
7
|
-
*
|
|
8
|
-
* @generated by codegen project: GenerateModuleJniH.js
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
#pragma once
|
|
12
|
-
|
|
13
|
-
#include <ReactCommon/JavaTurboModule.h>
|
|
14
|
-
#include <ReactCommon/TurboModule.h>
|
|
15
|
-
#include <jsi/jsi.h>
|
|
16
|
-
|
|
17
|
-
namespace facebook::react {
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* JNI C++ class for module 'NativeMixpanelReactNativeSessionReplay'
|
|
21
|
-
*/
|
|
22
|
-
class JSI_EXPORT NativeMixpanelReactNativeSessionReplaySpecJSI : public JavaTurboModule {
|
|
23
|
-
public:
|
|
24
|
-
NativeMixpanelReactNativeSessionReplaySpecJSI(const JavaTurboModule::InitParams ¶ms);
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
JSI_EXPORT
|
|
29
|
-
std::shared_ptr<TurboModule> MixpanelReactNativeSessionReplaySpec_ModuleProvider(const std::string &moduleName, const JavaTurboModule::InitParams ¶ms);
|
|
30
|
-
|
|
31
|
-
} // namespace facebook::react
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
3
|
-
*
|
|
4
|
-
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
5
|
-
* once the code is regenerated.
|
|
6
|
-
*
|
|
7
|
-
* @generated by codegen project: GenerateModuleCpp.js
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
#include "MixpanelReactNativeSessionReplaySpecJSI.h"
|
|
11
|
-
|
|
12
|
-
namespace facebook::react {
|
|
13
|
-
|
|
14
|
-
static jsi::Value __hostFunction_NativeMixpanelReactNativeSessionReplayCxxSpecJSI_initialize(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
15
|
-
return static_cast<NativeMixpanelReactNativeSessionReplayCxxSpecJSI *>(&turboModule)->initialize(
|
|
16
|
-
rt,
|
|
17
|
-
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
|
|
18
|
-
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt),
|
|
19
|
-
count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asString(rt)
|
|
20
|
-
);
|
|
21
|
-
}
|
|
22
|
-
static jsi::Value __hostFunction_NativeMixpanelReactNativeSessionReplayCxxSpecJSI_startRecording(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
23
|
-
return static_cast<NativeMixpanelReactNativeSessionReplayCxxSpecJSI *>(&turboModule)->startRecording(
|
|
24
|
-
rt,
|
|
25
|
-
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber()
|
|
26
|
-
);
|
|
27
|
-
}
|
|
28
|
-
static jsi::Value __hostFunction_NativeMixpanelReactNativeSessionReplayCxxSpecJSI_stopRecording(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
29
|
-
return static_cast<NativeMixpanelReactNativeSessionReplayCxxSpecJSI *>(&turboModule)->stopRecording(
|
|
30
|
-
rt
|
|
31
|
-
);
|
|
32
|
-
}
|
|
33
|
-
static jsi::Value __hostFunction_NativeMixpanelReactNativeSessionReplayCxxSpecJSI_isRecording(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
34
|
-
return static_cast<NativeMixpanelReactNativeSessionReplayCxxSpecJSI *>(&turboModule)->isRecording(
|
|
35
|
-
rt
|
|
36
|
-
);
|
|
37
|
-
}
|
|
38
|
-
static jsi::Value __hostFunction_NativeMixpanelReactNativeSessionReplayCxxSpecJSI_identify(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
39
|
-
return static_cast<NativeMixpanelReactNativeSessionReplayCxxSpecJSI *>(&turboModule)->identify(
|
|
40
|
-
rt,
|
|
41
|
-
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt)
|
|
42
|
-
);
|
|
43
|
-
}
|
|
44
|
-
static jsi::Value __hostFunction_NativeMixpanelReactNativeSessionReplayCxxSpecJSI_getReplayId(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
45
|
-
return static_cast<NativeMixpanelReactNativeSessionReplayCxxSpecJSI *>(&turboModule)->getReplayId(
|
|
46
|
-
rt
|
|
47
|
-
);
|
|
48
|
-
}
|
|
49
|
-
static jsi::Value __hostFunction_NativeMixpanelReactNativeSessionReplayCxxSpecJSI_flush(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
50
|
-
return static_cast<NativeMixpanelReactNativeSessionReplayCxxSpecJSI *>(&turboModule)->flush(
|
|
51
|
-
rt
|
|
52
|
-
);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
NativeMixpanelReactNativeSessionReplayCxxSpecJSI::NativeMixpanelReactNativeSessionReplayCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker)
|
|
56
|
-
: TurboModule("MixpanelReactNativeSessionReplay", jsInvoker) {
|
|
57
|
-
methodMap_["initialize"] = MethodMetadata {3, __hostFunction_NativeMixpanelReactNativeSessionReplayCxxSpecJSI_initialize};
|
|
58
|
-
methodMap_["startRecording"] = MethodMetadata {1, __hostFunction_NativeMixpanelReactNativeSessionReplayCxxSpecJSI_startRecording};
|
|
59
|
-
methodMap_["stopRecording"] = MethodMetadata {0, __hostFunction_NativeMixpanelReactNativeSessionReplayCxxSpecJSI_stopRecording};
|
|
60
|
-
methodMap_["isRecording"] = MethodMetadata {0, __hostFunction_NativeMixpanelReactNativeSessionReplayCxxSpecJSI_isRecording};
|
|
61
|
-
methodMap_["identify"] = MethodMetadata {1, __hostFunction_NativeMixpanelReactNativeSessionReplayCxxSpecJSI_identify};
|
|
62
|
-
methodMap_["getReplayId"] = MethodMetadata {0, __hostFunction_NativeMixpanelReactNativeSessionReplayCxxSpecJSI_getReplayId};
|
|
63
|
-
methodMap_["flush"] = MethodMetadata {0, __hostFunction_NativeMixpanelReactNativeSessionReplayCxxSpecJSI_flush};
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
} // namespace facebook::react
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
3
|
-
*
|
|
4
|
-
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
5
|
-
* once the code is regenerated.
|
|
6
|
-
*
|
|
7
|
-
* @generated by codegen project: GenerateModuleH.js
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
#pragma once
|
|
11
|
-
|
|
12
|
-
#include <ReactCommon/TurboModule.h>
|
|
13
|
-
#include <react/bridging/Bridging.h>
|
|
14
|
-
|
|
15
|
-
namespace facebook::react {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
class JSI_EXPORT NativeMixpanelReactNativeSessionReplayCxxSpecJSI : public TurboModule {
|
|
19
|
-
protected:
|
|
20
|
-
NativeMixpanelReactNativeSessionReplayCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker);
|
|
21
|
-
|
|
22
|
-
public:
|
|
23
|
-
virtual jsi::Value initialize(jsi::Runtime &rt, jsi::String token, jsi::String distinctId, jsi::String configJSON) = 0;
|
|
24
|
-
virtual jsi::Value startRecording(jsi::Runtime &rt, double recordingSessionsPercent) = 0;
|
|
25
|
-
virtual jsi::Value stopRecording(jsi::Runtime &rt) = 0;
|
|
26
|
-
virtual jsi::Value isRecording(jsi::Runtime &rt) = 0;
|
|
27
|
-
virtual jsi::Value identify(jsi::Runtime &rt, jsi::String distinctId) = 0;
|
|
28
|
-
virtual jsi::Value getReplayId(jsi::Runtime &rt) = 0;
|
|
29
|
-
virtual jsi::Value flush(jsi::Runtime &rt) = 0;
|
|
30
|
-
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
template <typename T>
|
|
34
|
-
class JSI_EXPORT NativeMixpanelReactNativeSessionReplayCxxSpec : public TurboModule {
|
|
35
|
-
public:
|
|
36
|
-
jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override {
|
|
37
|
-
return delegate_.create(rt, propName);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
std::vector<jsi::PropNameID> getPropertyNames(jsi::Runtime& runtime) override {
|
|
41
|
-
return delegate_.getPropertyNames(runtime);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
static constexpr std::string_view kModuleName = "MixpanelReactNativeSessionReplay";
|
|
45
|
-
|
|
46
|
-
protected:
|
|
47
|
-
NativeMixpanelReactNativeSessionReplayCxxSpec(std::shared_ptr<CallInvoker> jsInvoker)
|
|
48
|
-
: TurboModule(std::string{NativeMixpanelReactNativeSessionReplayCxxSpec::kModuleName}, jsInvoker),
|
|
49
|
-
delegate_(reinterpret_cast<T*>(this), jsInvoker) {}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
private:
|
|
53
|
-
class Delegate : public NativeMixpanelReactNativeSessionReplayCxxSpecJSI {
|
|
54
|
-
public:
|
|
55
|
-
Delegate(T *instance, std::shared_ptr<CallInvoker> jsInvoker) :
|
|
56
|
-
NativeMixpanelReactNativeSessionReplayCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
jsi::Value initialize(jsi::Runtime &rt, jsi::String token, jsi::String distinctId, jsi::String configJSON) override {
|
|
61
|
-
static_assert(
|
|
62
|
-
bridging::getParameterCount(&T::initialize) == 4,
|
|
63
|
-
"Expected initialize(...) to have 4 parameters");
|
|
64
|
-
|
|
65
|
-
return bridging::callFromJs<jsi::Value>(
|
|
66
|
-
rt, &T::initialize, jsInvoker_, instance_, std::move(token), std::move(distinctId), std::move(configJSON));
|
|
67
|
-
}
|
|
68
|
-
jsi::Value startRecording(jsi::Runtime &rt, double recordingSessionsPercent) override {
|
|
69
|
-
static_assert(
|
|
70
|
-
bridging::getParameterCount(&T::startRecording) == 2,
|
|
71
|
-
"Expected startRecording(...) to have 2 parameters");
|
|
72
|
-
|
|
73
|
-
return bridging::callFromJs<jsi::Value>(
|
|
74
|
-
rt, &T::startRecording, jsInvoker_, instance_, std::move(recordingSessionsPercent));
|
|
75
|
-
}
|
|
76
|
-
jsi::Value stopRecording(jsi::Runtime &rt) override {
|
|
77
|
-
static_assert(
|
|
78
|
-
bridging::getParameterCount(&T::stopRecording) == 1,
|
|
79
|
-
"Expected stopRecording(...) to have 1 parameters");
|
|
80
|
-
|
|
81
|
-
return bridging::callFromJs<jsi::Value>(
|
|
82
|
-
rt, &T::stopRecording, jsInvoker_, instance_);
|
|
83
|
-
}
|
|
84
|
-
jsi::Value isRecording(jsi::Runtime &rt) override {
|
|
85
|
-
static_assert(
|
|
86
|
-
bridging::getParameterCount(&T::isRecording) == 1,
|
|
87
|
-
"Expected isRecording(...) to have 1 parameters");
|
|
88
|
-
|
|
89
|
-
return bridging::callFromJs<jsi::Value>(
|
|
90
|
-
rt, &T::isRecording, jsInvoker_, instance_);
|
|
91
|
-
}
|
|
92
|
-
jsi::Value identify(jsi::Runtime &rt, jsi::String distinctId) override {
|
|
93
|
-
static_assert(
|
|
94
|
-
bridging::getParameterCount(&T::identify) == 2,
|
|
95
|
-
"Expected identify(...) to have 2 parameters");
|
|
96
|
-
|
|
97
|
-
return bridging::callFromJs<jsi::Value>(
|
|
98
|
-
rt, &T::identify, jsInvoker_, instance_, std::move(distinctId));
|
|
99
|
-
}
|
|
100
|
-
jsi::Value getReplayId(jsi::Runtime &rt) override {
|
|
101
|
-
static_assert(
|
|
102
|
-
bridging::getParameterCount(&T::getReplayId) == 1,
|
|
103
|
-
"Expected getReplayId(...) to have 1 parameters");
|
|
104
|
-
|
|
105
|
-
return bridging::callFromJs<jsi::Value>(
|
|
106
|
-
rt, &T::getReplayId, jsInvoker_, instance_);
|
|
107
|
-
}
|
|
108
|
-
jsi::Value flush(jsi::Runtime &rt) override {
|
|
109
|
-
static_assert(
|
|
110
|
-
bridging::getParameterCount(&T::flush) == 1,
|
|
111
|
-
"Expected flush(...) to have 1 parameters");
|
|
112
|
-
|
|
113
|
-
return bridging::callFromJs<jsi::Value>(
|
|
114
|
-
rt, &T::flush, jsInvoker_, instance_);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
private:
|
|
118
|
-
friend class NativeMixpanelReactNativeSessionReplayCxxSpec;
|
|
119
|
-
T *instance_;
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
Delegate delegate_;
|
|
123
|
-
};
|
|
124
|
-
|
|
125
|
-
} // namespace facebook::react
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
-
*
|
|
5
|
-
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
-
* once the code is regenerated.
|
|
7
|
-
*
|
|
8
|
-
* @generated by codegen project: GenerateModuleJavaSpec.js
|
|
9
|
-
*
|
|
10
|
-
* @nolint
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
package com.mpsessionreplay;
|
|
14
|
-
|
|
15
|
-
import com.facebook.proguard.annotations.DoNotStrip;
|
|
16
|
-
import com.facebook.react.bridge.ReactApplicationContext;
|
|
17
|
-
import com.facebook.react.bridge.ReactContextBaseJavaModule;
|
|
18
|
-
import com.facebook.react.bridge.ReactMethod;
|
|
19
|
-
import com.facebook.react.turbomodule.core.interfaces.TurboModule;
|
|
20
|
-
import javax.annotation.Nonnull;
|
|
21
|
-
|
|
22
|
-
public abstract class NativeMpSessionReplaySpec extends ReactContextBaseJavaModule implements TurboModule {
|
|
23
|
-
public static final String NAME = "MpSessionReplay";
|
|
24
|
-
|
|
25
|
-
public NativeMpSessionReplaySpec(ReactApplicationContext reactContext) {
|
|
26
|
-
super(reactContext);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
@Override
|
|
30
|
-
public @Nonnull String getName() {
|
|
31
|
-
return NAME;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
@ReactMethod
|
|
35
|
-
@DoNotStrip
|
|
36
|
-
public abstract void startRecording();
|
|
37
|
-
|
|
38
|
-
@ReactMethod
|
|
39
|
-
@DoNotStrip
|
|
40
|
-
public abstract void stopRecording();
|
|
41
|
-
|
|
42
|
-
@ReactMethod
|
|
43
|
-
@DoNotStrip
|
|
44
|
-
public abstract void initialize(String token, String distinctId, String configJSON);
|
|
45
|
-
|
|
46
|
-
@ReactMethod
|
|
47
|
-
@DoNotStrip
|
|
48
|
-
public abstract void captureScreenshot();
|
|
49
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
-
#
|
|
3
|
-
# This source code is licensed under the MIT license found in the
|
|
4
|
-
# LICENSE file in the root directory of this source tree.
|
|
5
|
-
|
|
6
|
-
cmake_minimum_required(VERSION 3.13)
|
|
7
|
-
set(CMAKE_VERBOSE_MAKEFILE on)
|
|
8
|
-
|
|
9
|
-
file(GLOB react_codegen_SRCS CONFIGURE_DEPENDS *.cpp react/renderer/components/RNMpSessionReplaySpec/*.cpp)
|
|
10
|
-
|
|
11
|
-
add_library(
|
|
12
|
-
react_codegen_RNMpSessionReplaySpec
|
|
13
|
-
OBJECT
|
|
14
|
-
${react_codegen_SRCS}
|
|
15
|
-
)
|
|
16
|
-
|
|
17
|
-
target_include_directories(react_codegen_RNMpSessionReplaySpec PUBLIC . react/renderer/components/RNMpSessionReplaySpec)
|
|
18
|
-
|
|
19
|
-
target_link_libraries(
|
|
20
|
-
react_codegen_RNMpSessionReplaySpec
|
|
21
|
-
fbjni
|
|
22
|
-
jsi
|
|
23
|
-
# We need to link different libraries based on whether we are building rncore or not, that's necessary
|
|
24
|
-
# because we want to break a circular dependency between react_codegen_rncore and reactnative
|
|
25
|
-
reactnative
|
|
26
|
-
)
|
|
27
|
-
|
|
28
|
-
target_compile_options(
|
|
29
|
-
react_codegen_RNMpSessionReplaySpec
|
|
30
|
-
PRIVATE
|
|
31
|
-
-DLOG_TAG=\"ReactNative\"
|
|
32
|
-
-fexceptions
|
|
33
|
-
-frtti
|
|
34
|
-
-std=c++20
|
|
35
|
-
-Wall
|
|
36
|
-
)
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
-
*
|
|
5
|
-
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
-
* once the code is regenerated.
|
|
7
|
-
*
|
|
8
|
-
* @generated by codegen project: GenerateModuleJniCpp.js
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
#include "RNMpSessionReplaySpec.h"
|
|
12
|
-
|
|
13
|
-
namespace facebook::react {
|
|
14
|
-
|
|
15
|
-
static facebook::jsi::Value __hostFunction_NativeMpSessionReplaySpecJSI_startRecording(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
16
|
-
static jmethodID cachedMethodId = nullptr;
|
|
17
|
-
return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, VoidKind, "startRecording", "()V", args, count, cachedMethodId);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
static facebook::jsi::Value __hostFunction_NativeMpSessionReplaySpecJSI_stopRecording(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
21
|
-
static jmethodID cachedMethodId = nullptr;
|
|
22
|
-
return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, VoidKind, "stopRecording", "()V", args, count, cachedMethodId);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
static facebook::jsi::Value __hostFunction_NativeMpSessionReplaySpecJSI_initialize(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
26
|
-
static jmethodID cachedMethodId = nullptr;
|
|
27
|
-
return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, VoidKind, "initialize", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V", args, count, cachedMethodId);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
static facebook::jsi::Value __hostFunction_NativeMpSessionReplaySpecJSI_captureScreenshot(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
31
|
-
static jmethodID cachedMethodId = nullptr;
|
|
32
|
-
return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, VoidKind, "captureScreenshot", "()V", args, count, cachedMethodId);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
NativeMpSessionReplaySpecJSI::NativeMpSessionReplaySpecJSI(const JavaTurboModule::InitParams ¶ms)
|
|
36
|
-
: JavaTurboModule(params) {
|
|
37
|
-
methodMap_["startRecording"] = MethodMetadata {0, __hostFunction_NativeMpSessionReplaySpecJSI_startRecording};
|
|
38
|
-
methodMap_["stopRecording"] = MethodMetadata {0, __hostFunction_NativeMpSessionReplaySpecJSI_stopRecording};
|
|
39
|
-
methodMap_["initialize"] = MethodMetadata {3, __hostFunction_NativeMpSessionReplaySpecJSI_initialize};
|
|
40
|
-
methodMap_["captureScreenshot"] = MethodMetadata {0, __hostFunction_NativeMpSessionReplaySpecJSI_captureScreenshot};
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
std::shared_ptr<TurboModule> RNMpSessionReplaySpec_ModuleProvider(const std::string &moduleName, const JavaTurboModule::InitParams ¶ms) {
|
|
44
|
-
if (moduleName == "MpSessionReplay") {
|
|
45
|
-
return std::make_shared<NativeMpSessionReplaySpecJSI>(params);
|
|
46
|
-
}
|
|
47
|
-
return nullptr;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
} // namespace facebook::react
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
-
*
|
|
5
|
-
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
-
* once the code is regenerated.
|
|
7
|
-
*
|
|
8
|
-
* @generated by codegen project: GenerateModuleJniH.js
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
#pragma once
|
|
12
|
-
|
|
13
|
-
#include <ReactCommon/JavaTurboModule.h>
|
|
14
|
-
#include <ReactCommon/TurboModule.h>
|
|
15
|
-
#include <jsi/jsi.h>
|
|
16
|
-
|
|
17
|
-
namespace facebook::react {
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* JNI C++ class for module 'NativeMpSessionReplay'
|
|
21
|
-
*/
|
|
22
|
-
class JSI_EXPORT NativeMpSessionReplaySpecJSI : public JavaTurboModule {
|
|
23
|
-
public:
|
|
24
|
-
NativeMpSessionReplaySpecJSI(const JavaTurboModule::InitParams ¶ms);
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
JSI_EXPORT
|
|
29
|
-
std::shared_ptr<TurboModule> RNMpSessionReplaySpec_ModuleProvider(const std::string &moduleName, const JavaTurboModule::InitParams ¶ms);
|
|
30
|
-
|
|
31
|
-
} // namespace facebook::react
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
3
|
-
*
|
|
4
|
-
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
5
|
-
* once the code is regenerated.
|
|
6
|
-
*
|
|
7
|
-
* @generated by codegen project: GenerateModuleCpp.js
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
#include "RNMpSessionReplaySpecJSI.h"
|
|
11
|
-
|
|
12
|
-
namespace facebook::react {
|
|
13
|
-
|
|
14
|
-
static jsi::Value __hostFunction_NativeMpSessionReplayCxxSpecJSI_startRecording(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
15
|
-
static_cast<NativeMpSessionReplayCxxSpecJSI *>(&turboModule)->startRecording(
|
|
16
|
-
rt
|
|
17
|
-
);
|
|
18
|
-
return jsi::Value::undefined();
|
|
19
|
-
}
|
|
20
|
-
static jsi::Value __hostFunction_NativeMpSessionReplayCxxSpecJSI_stopRecording(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
21
|
-
static_cast<NativeMpSessionReplayCxxSpecJSI *>(&turboModule)->stopRecording(
|
|
22
|
-
rt
|
|
23
|
-
);
|
|
24
|
-
return jsi::Value::undefined();
|
|
25
|
-
}
|
|
26
|
-
static jsi::Value __hostFunction_NativeMpSessionReplayCxxSpecJSI_initialize(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
27
|
-
static_cast<NativeMpSessionReplayCxxSpecJSI *>(&turboModule)->initialize(
|
|
28
|
-
rt,
|
|
29
|
-
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
|
|
30
|
-
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt),
|
|
31
|
-
count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asString(rt)
|
|
32
|
-
);
|
|
33
|
-
return jsi::Value::undefined();
|
|
34
|
-
}
|
|
35
|
-
static jsi::Value __hostFunction_NativeMpSessionReplayCxxSpecJSI_captureScreenshot(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
36
|
-
static_cast<NativeMpSessionReplayCxxSpecJSI *>(&turboModule)->captureScreenshot(
|
|
37
|
-
rt
|
|
38
|
-
);
|
|
39
|
-
return jsi::Value::undefined();
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
NativeMpSessionReplayCxxSpecJSI::NativeMpSessionReplayCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker)
|
|
43
|
-
: TurboModule("MpSessionReplay", jsInvoker) {
|
|
44
|
-
methodMap_["startRecording"] = MethodMetadata {0, __hostFunction_NativeMpSessionReplayCxxSpecJSI_startRecording};
|
|
45
|
-
methodMap_["stopRecording"] = MethodMetadata {0, __hostFunction_NativeMpSessionReplayCxxSpecJSI_stopRecording};
|
|
46
|
-
methodMap_["initialize"] = MethodMetadata {3, __hostFunction_NativeMpSessionReplayCxxSpecJSI_initialize};
|
|
47
|
-
methodMap_["captureScreenshot"] = MethodMetadata {0, __hostFunction_NativeMpSessionReplayCxxSpecJSI_captureScreenshot};
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
} // namespace facebook::react
|