@luciq/react-native 19.3.0-40271-SNAPSHOT → 19.4.0-44237-SNAPSHOT
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 +15 -0
- package/README.md +118 -0
- package/RNLuciq.podspec +6 -2
- package/android/build.gradle +25 -0
- package/android/native.gradle +1 -1
- package/android/src/main/java/ai/luciq/reactlibrary/RNLuciqAPMModule.java +3 -12
- package/android/src/main/java/ai/luciq/reactlibrary/RNLuciqBugReportingModule.java +28 -24
- package/android/src/main/java/ai/luciq/reactlibrary/RNLuciqCrashReportingModule.java +18 -7
- package/android/src/main/java/ai/luciq/reactlibrary/RNLuciqFeatureRequestsModule.java +1 -2
- package/android/src/main/java/ai/luciq/reactlibrary/RNLuciqNetworkLoggerModule.java +29 -56
- package/android/src/main/java/ai/luciq/reactlibrary/RNLuciqReactnativeModule.java +121 -47
- package/android/src/main/java/ai/luciq/reactlibrary/RNLuciqReactnativePackage.java +2 -0
- package/android/src/main/java/ai/luciq/reactlibrary/RNLuciqRepliesModule.java +4 -16
- package/android/src/main/java/ai/luciq/reactlibrary/RNLuciqSessionReplayModule.java +5 -16
- package/android/src/main/java/ai/luciq/reactlibrary/RNLuciqSurveysModule.java +7 -15
- package/android/src/main/java/ai/luciq/reactlibrary/utils/EventEmitterModule.java +0 -7
- package/android/src/main/java/ai/luciq/reactlibrary/utils/ReportUtil.java +0 -7
- package/android/src/newarch/java/ai/luciq/reactlibrary/RNLuciqAPMBaseSpec.java +9 -0
- package/android/src/newarch/java/ai/luciq/reactlibrary/RNLuciqBaseSpec.java +33 -0
- package/android/src/newarch/java/ai/luciq/reactlibrary/RNLuciqBugReportingBaseSpec.java +33 -0
- package/android/src/newarch/java/ai/luciq/reactlibrary/RNLuciqCrashReportingBaseSpec.java +9 -0
- package/android/src/newarch/java/ai/luciq/reactlibrary/RNLuciqFeatureRequestsBaseSpec.java +9 -0
- package/android/src/newarch/java/ai/luciq/reactlibrary/RNLuciqNetworkLoggerBaseSpec.java +33 -0
- package/android/src/newarch/java/ai/luciq/reactlibrary/RNLuciqRepliesBaseSpec.java +33 -0
- package/android/src/newarch/java/ai/luciq/reactlibrary/RNLuciqSessionReplayBaseSpec.java +33 -0
- package/android/src/newarch/java/ai/luciq/reactlibrary/RNLuciqSurveysBaseSpec.java +33 -0
- package/android/src/oldarch/java/ai/luciq/reactlibrary/RNLuciqAPMBaseSpec.java +11 -0
- package/android/src/oldarch/java/ai/luciq/reactlibrary/RNLuciqBaseSpec.java +22 -0
- package/android/src/oldarch/java/ai/luciq/reactlibrary/RNLuciqBugReportingBaseSpec.java +22 -0
- package/android/src/oldarch/java/ai/luciq/reactlibrary/RNLuciqCrashReportingBaseSpec.java +10 -0
- package/android/src/oldarch/java/ai/luciq/reactlibrary/RNLuciqFeatureRequestsBaseSpec.java +10 -0
- package/android/src/oldarch/java/ai/luciq/reactlibrary/RNLuciqNetworkLoggerBaseSpec.java +22 -0
- package/android/src/oldarch/java/ai/luciq/reactlibrary/RNLuciqRepliesBaseSpec.java +22 -0
- package/android/src/oldarch/java/ai/luciq/reactlibrary/RNLuciqSessionReplayBaseSpec.java +22 -0
- package/android/src/oldarch/java/ai/luciq/reactlibrary/RNLuciqSurveysBaseSpec.java +22 -0
- package/dist/modules/BugReporting.js +3 -3
- package/dist/modules/Luciq.d.ts +15 -0
- package/dist/modules/Luciq.js +23 -3
- package/dist/modules/NetworkLogger.d.ts +5 -0
- package/dist/modules/NetworkLogger.js +1 -9
- package/dist/modules/Replies.js +1 -1
- package/dist/modules/Surveys.js +2 -2
- package/dist/native/NativeBugReporting.d.ts +4 -4
- package/dist/native/NativeCrashReporting.d.ts +2 -2
- package/dist/native/NativeLuciq.d.ts +5 -3
- package/dist/native/NativePackage.js +25 -2
- package/dist/native/NativeReplies.d.ts +1 -1
- package/dist/native/NativeSurveys.d.ts +2 -2
- package/dist/native/specs/NativeAPM.d.ts +21 -0
- package/dist/native/specs/NativeAPM.js +2 -0
- package/dist/native/specs/NativeBugReporting.d.ts +29 -0
- package/dist/native/specs/NativeBugReporting.js +2 -0
- package/dist/native/specs/NativeCrashReporting.d.ts +12 -0
- package/dist/native/specs/NativeCrashReporting.js +2 -0
- package/dist/native/specs/NativeFeatureRequests.d.ts +8 -0
- package/dist/native/specs/NativeFeatureRequests.js +2 -0
- package/dist/native/specs/NativeLuciq.d.ts +80 -0
- package/dist/native/specs/NativeLuciq.js +2 -0
- package/dist/native/specs/NativeNetworkLogger.d.ts +16 -0
- package/dist/native/specs/NativeNetworkLogger.js +2 -0
- package/dist/native/specs/NativeReplies.d.ts +21 -0
- package/dist/native/specs/NativeReplies.js +2 -0
- package/dist/native/specs/NativeSessionReplay.d.ts +17 -0
- package/dist/native/specs/NativeSessionReplay.js +2 -0
- package/dist/native/specs/NativeSurveys.d.ts +18 -0
- package/dist/native/specs/NativeSurveys.js +2 -0
- package/dist/utils/Enums.js +3 -1
- package/dist/utils/FeatureFlags.d.ts +0 -6
- package/dist/utils/FeatureFlags.js +0 -35
- package/dist/utils/LuciqUtils.d.ts +1 -1
- package/dist/utils/LuciqUtils.js +0 -9
- package/dist/utils/XhrNetworkInterceptor.js +53 -85
- package/ios/RNLuciq/LuciqAPMBridge.h +5 -5
- package/ios/RNLuciq/{LuciqAPMBridge.m → LuciqAPMBridge.mm} +48 -39
- package/ios/RNLuciq/LuciqBugReportingBridge.h +6 -6
- package/ios/RNLuciq/LuciqBugReportingBridge.mm +234 -0
- package/ios/RNLuciq/LuciqCrashReportingBridge.h +16 -5
- package/ios/RNLuciq/LuciqCrashReportingBridge.mm +91 -0
- package/ios/RNLuciq/LuciqFeatureRequestsBridge.h +1 -1
- package/ios/RNLuciq/{LuciqFeatureRequestsBridge.m → LuciqFeatureRequestsBridge.mm} +21 -16
- package/ios/RNLuciq/LuciqNetworkLoggerBridge.h +1 -30
- package/ios/RNLuciq/{LuciqNetworkLoggerBridge.m → LuciqNetworkLoggerBridge.mm} +46 -77
- package/ios/RNLuciq/LuciqReactBridge.h +13 -13
- package/ios/RNLuciq/{LuciqReactBridge.m → LuciqReactBridge.mm} +95 -34
- package/ios/RNLuciq/LuciqRepliesBridge.h +3 -3
- package/ios/RNLuciq/LuciqRepliesBridge.mm +86 -0
- package/ios/RNLuciq/LuciqSessionReplayBridge.h +5 -5
- package/ios/RNLuciq/{LuciqSessionReplayBridge.m → LuciqSessionReplayBridge.mm} +35 -25
- package/ios/RNLuciq/LuciqSurveysBridge.h +5 -5
- package/ios/RNLuciq/{LuciqSurveysBridge.m → LuciqSurveysBridge.mm} +34 -35
- package/ios/native.rb +1 -1
- package/package.json +9 -1
- package/src/modules/BugReporting.ts +3 -3
- package/src/modules/Luciq.ts +26 -4
- package/src/modules/NetworkLogger.ts +1 -26
- package/src/modules/Replies.ts +1 -1
- package/src/modules/Surveys.ts +2 -2
- package/src/native/NativeBugReporting.ts +3 -6
- package/src/native/NativeCrashReporting.ts +2 -2
- package/src/native/NativeLuciq.ts +7 -3
- package/src/native/NativePackage.ts +52 -2
- package/src/native/NativeReplies.ts +1 -1
- package/src/native/NativeSurveys.ts +2 -2
- package/src/native/specs/NativeAPM.ts +47 -0
- package/src/native/specs/NativeBugReporting.ts +53 -0
- package/src/native/specs/NativeCrashReporting.ts +23 -0
- package/src/native/specs/NativeFeatureRequests.ts +10 -0
- package/src/native/specs/NativeLuciq.ts +137 -0
- package/src/native/specs/NativeNetworkLogger.ts +31 -0
- package/src/native/specs/NativeReplies.ts +27 -0
- package/src/native/specs/NativeSessionReplay.ts +20 -0
- package/src/native/specs/NativeSurveys.ts +23 -0
- package/src/utils/Enums.ts +4 -1
- package/src/utils/FeatureFlags.ts +0 -44
- package/src/utils/LuciqUtils.ts +1 -21
- package/src/utils/XhrNetworkInterceptor.ts +55 -128
- package/ios/RNLuciq/LuciqBugReportingBridge.m +0 -249
- package/ios/RNLuciq/LuciqCrashReportingBridge.m +0 -68
- package/ios/RNLuciq/LuciqRepliesBridge.m +0 -80
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
package ai.luciq.reactlibrary;
|
|
2
2
|
|
|
3
3
|
import com.facebook.react.bridge.Arguments;
|
|
4
|
-
import com.facebook.react.bridge.Callback;
|
|
5
4
|
import com.facebook.react.bridge.Promise;
|
|
6
5
|
import com.facebook.react.bridge.ReactApplicationContext;
|
|
7
6
|
import com.facebook.react.bridge.ReactMethod;
|
|
8
7
|
import com.facebook.react.bridge.WritableArray;
|
|
9
8
|
import ai.luciq.library.Feature;
|
|
10
9
|
import ai.luciq.reactlibrary.utils.ArrayUtil;
|
|
11
|
-
import ai.luciq.reactlibrary.utils.EventEmitterModule;
|
|
12
10
|
import ai.luciq.reactlibrary.utils.LuciqUtil;
|
|
13
11
|
import ai.luciq.reactlibrary.utils.MainThreadHandler;
|
|
14
12
|
import ai.luciq.survey.callbacks.*;
|
|
@@ -21,7 +19,7 @@ import java.util.List;
|
|
|
21
19
|
|
|
22
20
|
import javax.annotation.Nonnull;
|
|
23
21
|
|
|
24
|
-
public class RNLuciqSurveysModule extends
|
|
22
|
+
public class RNLuciqSurveysModule extends RNLuciqSurveysBaseSpec {
|
|
25
23
|
|
|
26
24
|
public RNLuciqSurveysModule(ReactApplicationContext reactContext) {
|
|
27
25
|
super(reactContext);
|
|
@@ -33,16 +31,6 @@ public class RNLuciqSurveysModule extends EventEmitterModule {
|
|
|
33
31
|
return "LCQSurveys";
|
|
34
32
|
}
|
|
35
33
|
|
|
36
|
-
@ReactMethod
|
|
37
|
-
public void addListener(String event) {
|
|
38
|
-
super.addListener(event);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
@ReactMethod
|
|
42
|
-
public void removeListeners(Integer count) {
|
|
43
|
-
super.removeListeners(count);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
34
|
/**
|
|
47
35
|
* Returns true if the survey with a specific token was answered before.
|
|
48
36
|
* Will return false if the token does not exist or if the survey was not answered before.
|
|
@@ -139,7 +127,7 @@ public class RNLuciqSurveysModule extends EventEmitterModule {
|
|
|
139
127
|
* @param handler to run on the UI thread before showing any valid survey
|
|
140
128
|
*/
|
|
141
129
|
@ReactMethod
|
|
142
|
-
public void setOnShowHandler(
|
|
130
|
+
public void setOnShowHandler() {
|
|
143
131
|
MainThreadHandler.runOnMainThread(new Runnable() {
|
|
144
132
|
@Override
|
|
145
133
|
public void run() {
|
|
@@ -161,7 +149,7 @@ public class RNLuciqSurveysModule extends EventEmitterModule {
|
|
|
161
149
|
* @param handler to run on the UI thread after showing any valid survey
|
|
162
150
|
*/
|
|
163
151
|
@ReactMethod
|
|
164
|
-
public void setOnDismissHandler(
|
|
152
|
+
public void setOnDismissHandler() {
|
|
165
153
|
MainThreadHandler.runOnMainThread(new Runnable() {
|
|
166
154
|
@Override
|
|
167
155
|
public void run() {
|
|
@@ -234,4 +222,8 @@ public class RNLuciqSurveysModule extends EventEmitterModule {
|
|
|
234
222
|
}
|
|
235
223
|
});
|
|
236
224
|
}
|
|
225
|
+
|
|
226
|
+
@ReactMethod
|
|
227
|
+
public void setAppStoreURL(String appStoreURL) {
|
|
228
|
+
}
|
|
237
229
|
}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
package ai.luciq.reactlibrary.utils;
|
|
2
2
|
|
|
3
|
-
import android.util.Log;
|
|
4
|
-
|
|
5
3
|
import androidx.annotation.Nullable;
|
|
6
4
|
import androidx.annotation.VisibleForTesting;
|
|
7
5
|
|
|
@@ -12,7 +10,6 @@ import com.facebook.react.bridge.WritableMap;
|
|
|
12
10
|
import com.facebook.react.modules.core.DeviceEventManagerModule;
|
|
13
11
|
|
|
14
12
|
public abstract class EventEmitterModule extends ReactContextBaseJavaModule {
|
|
15
|
-
private static final String NET_TAG = "LCQ-RN-NET";
|
|
16
13
|
private int listenerCount = 0;
|
|
17
14
|
|
|
18
15
|
public EventEmitterModule(ReactApplicationContext context) {
|
|
@@ -25,18 +22,14 @@ public abstract class EventEmitterModule extends ReactContextBaseJavaModule {
|
|
|
25
22
|
getReactApplicationContext()
|
|
26
23
|
.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
|
|
27
24
|
.emit(event, params);
|
|
28
|
-
} else {
|
|
29
|
-
Log.w(NET_TAG, "[EventEmitter] Event DROPPED (no JS listeners): event=" + event + ", module=" + getName() + ", listenerCount=0");
|
|
30
25
|
}
|
|
31
26
|
}
|
|
32
27
|
|
|
33
28
|
protected void addListener(String ignoredEvent) {
|
|
34
29
|
listenerCount++;
|
|
35
|
-
Log.d(NET_TAG, "[EventEmitter] addListener — module=" + getName() + ", event=" + ignoredEvent + ", listenerCount=" + listenerCount);
|
|
36
30
|
}
|
|
37
31
|
|
|
38
32
|
protected void removeListeners(Integer count) {
|
|
39
33
|
listenerCount -= count;
|
|
40
|
-
Log.d(NET_TAG, "[EventEmitter] removeListeners — module=" + getName() + ", removed=" + count + ", listenerCount=" + listenerCount);
|
|
41
34
|
}
|
|
42
35
|
}
|
|
@@ -6,14 +6,7 @@ import com.facebook.react.bridge.ReadableArray;
|
|
|
6
6
|
import com.facebook.react.bridge.ReadableMap;
|
|
7
7
|
import com.facebook.react.bridge.ReadableMapKeySetIterator;
|
|
8
8
|
import com.facebook.react.bridge.ReadableType;
|
|
9
|
-
import com.facebook.react.bridge.WritableArray;
|
|
10
|
-
import com.facebook.react.bridge.WritableNativeArray;
|
|
11
9
|
import ai.luciq.library.model.Report;
|
|
12
|
-
import ai.luciq.library.model.a;
|
|
13
|
-
|
|
14
|
-
import org.json.JSONException;
|
|
15
|
-
|
|
16
|
-
import java.util.ArrayList;
|
|
17
10
|
|
|
18
11
|
|
|
19
12
|
/**
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
package ai.luciq.reactlibrary;
|
|
2
|
+
|
|
3
|
+
import androidx.annotation.Nullable;
|
|
4
|
+
|
|
5
|
+
import com.facebook.react.bridge.ReactApplicationContext;
|
|
6
|
+
import com.facebook.react.bridge.ReadableMap;
|
|
7
|
+
import com.facebook.react.modules.core.DeviceEventManagerModule;
|
|
8
|
+
|
|
9
|
+
abstract class RNLuciqBaseSpec extends NativeLuciqSpec {
|
|
10
|
+
private int listenerCount = 0;
|
|
11
|
+
|
|
12
|
+
RNLuciqBaseSpec(ReactApplicationContext context) {
|
|
13
|
+
super(context);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
public void sendEvent(String event, @Nullable ReadableMap params) {
|
|
17
|
+
if (listenerCount > 0) {
|
|
18
|
+
getReactApplicationContext()
|
|
19
|
+
.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
|
|
20
|
+
.emit(event, params);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@Override
|
|
25
|
+
public void addListener(String eventName) {
|
|
26
|
+
listenerCount++;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@Override
|
|
30
|
+
public void removeListeners(double count) {
|
|
31
|
+
listenerCount = Math.max(0, listenerCount - (int) count);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
package ai.luciq.reactlibrary;
|
|
2
|
+
|
|
3
|
+
import androidx.annotation.Nullable;
|
|
4
|
+
|
|
5
|
+
import com.facebook.react.bridge.ReactApplicationContext;
|
|
6
|
+
import com.facebook.react.bridge.ReadableMap;
|
|
7
|
+
import com.facebook.react.modules.core.DeviceEventManagerModule;
|
|
8
|
+
|
|
9
|
+
abstract class RNLuciqBugReportingBaseSpec extends NativeBugReportingSpec {
|
|
10
|
+
private int listenerCount = 0;
|
|
11
|
+
|
|
12
|
+
RNLuciqBugReportingBaseSpec(ReactApplicationContext context) {
|
|
13
|
+
super(context);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
public void sendEvent(String event, @Nullable ReadableMap params) {
|
|
17
|
+
if (listenerCount > 0) {
|
|
18
|
+
getReactApplicationContext()
|
|
19
|
+
.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
|
|
20
|
+
.emit(event, params);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@Override
|
|
25
|
+
public void addListener(String eventName) {
|
|
26
|
+
listenerCount++;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@Override
|
|
30
|
+
public void removeListeners(double count) {
|
|
31
|
+
listenerCount = Math.max(0, listenerCount - (int) count);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
package ai.luciq.reactlibrary;
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.bridge.ReactApplicationContext;
|
|
4
|
+
|
|
5
|
+
abstract class RNLuciqCrashReportingBaseSpec extends NativeCrashReportingSpec {
|
|
6
|
+
RNLuciqCrashReportingBaseSpec(ReactApplicationContext context) {
|
|
7
|
+
super(context);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
package ai.luciq.reactlibrary;
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.bridge.ReactApplicationContext;
|
|
4
|
+
|
|
5
|
+
abstract class RNLuciqFeatureRequestsBaseSpec extends NativeFeatureRequestsSpec {
|
|
6
|
+
RNLuciqFeatureRequestsBaseSpec(ReactApplicationContext context) {
|
|
7
|
+
super(context);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
package ai.luciq.reactlibrary;
|
|
2
|
+
|
|
3
|
+
import androidx.annotation.Nullable;
|
|
4
|
+
|
|
5
|
+
import com.facebook.react.bridge.ReactApplicationContext;
|
|
6
|
+
import com.facebook.react.bridge.ReadableMap;
|
|
7
|
+
import com.facebook.react.modules.core.DeviceEventManagerModule;
|
|
8
|
+
|
|
9
|
+
abstract class RNLuciqNetworkLoggerBaseSpec extends NativeNetworkLoggerSpec {
|
|
10
|
+
private int listenerCount = 0;
|
|
11
|
+
|
|
12
|
+
RNLuciqNetworkLoggerBaseSpec(ReactApplicationContext context) {
|
|
13
|
+
super(context);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
public void sendEvent(String event, @Nullable ReadableMap params) {
|
|
17
|
+
if (listenerCount > 0) {
|
|
18
|
+
getReactApplicationContext()
|
|
19
|
+
.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
|
|
20
|
+
.emit(event, params);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@Override
|
|
25
|
+
public void addListener(String eventName) {
|
|
26
|
+
listenerCount++;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@Override
|
|
30
|
+
public void removeListeners(double count) {
|
|
31
|
+
listenerCount = Math.max(0, listenerCount - (int) count);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
package ai.luciq.reactlibrary;
|
|
2
|
+
|
|
3
|
+
import androidx.annotation.Nullable;
|
|
4
|
+
|
|
5
|
+
import com.facebook.react.bridge.ReactApplicationContext;
|
|
6
|
+
import com.facebook.react.bridge.ReadableMap;
|
|
7
|
+
import com.facebook.react.modules.core.DeviceEventManagerModule;
|
|
8
|
+
|
|
9
|
+
abstract class RNLuciqRepliesBaseSpec extends NativeRepliesSpec {
|
|
10
|
+
private int listenerCount = 0;
|
|
11
|
+
|
|
12
|
+
RNLuciqRepliesBaseSpec(ReactApplicationContext context) {
|
|
13
|
+
super(context);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
public void sendEvent(String event, @Nullable ReadableMap params) {
|
|
17
|
+
if (listenerCount > 0) {
|
|
18
|
+
getReactApplicationContext()
|
|
19
|
+
.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
|
|
20
|
+
.emit(event, params);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@Override
|
|
25
|
+
public void addListener(String eventName) {
|
|
26
|
+
listenerCount++;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@Override
|
|
30
|
+
public void removeListeners(double count) {
|
|
31
|
+
listenerCount = Math.max(0, listenerCount - (int) count);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
package ai.luciq.reactlibrary;
|
|
2
|
+
|
|
3
|
+
import androidx.annotation.Nullable;
|
|
4
|
+
|
|
5
|
+
import com.facebook.react.bridge.ReactApplicationContext;
|
|
6
|
+
import com.facebook.react.bridge.ReadableMap;
|
|
7
|
+
import com.facebook.react.modules.core.DeviceEventManagerModule;
|
|
8
|
+
|
|
9
|
+
abstract class RNLuciqSessionReplayBaseSpec extends NativeSessionReplaySpec {
|
|
10
|
+
private int listenerCount = 0;
|
|
11
|
+
|
|
12
|
+
RNLuciqSessionReplayBaseSpec(ReactApplicationContext context) {
|
|
13
|
+
super(context);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
public void sendEvent(String event, @Nullable ReadableMap params) {
|
|
17
|
+
if (listenerCount > 0) {
|
|
18
|
+
getReactApplicationContext()
|
|
19
|
+
.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
|
|
20
|
+
.emit(event, params);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@Override
|
|
25
|
+
public void addListener(String eventName) {
|
|
26
|
+
listenerCount++;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@Override
|
|
30
|
+
public void removeListeners(double count) {
|
|
31
|
+
listenerCount = Math.max(0, listenerCount - (int) count);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
package ai.luciq.reactlibrary;
|
|
2
|
+
|
|
3
|
+
import androidx.annotation.Nullable;
|
|
4
|
+
|
|
5
|
+
import com.facebook.react.bridge.ReactApplicationContext;
|
|
6
|
+
import com.facebook.react.bridge.ReadableMap;
|
|
7
|
+
import com.facebook.react.modules.core.DeviceEventManagerModule;
|
|
8
|
+
|
|
9
|
+
abstract class RNLuciqSurveysBaseSpec extends NativeSurveysSpec {
|
|
10
|
+
private int listenerCount = 0;
|
|
11
|
+
|
|
12
|
+
RNLuciqSurveysBaseSpec(ReactApplicationContext context) {
|
|
13
|
+
super(context);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
public void sendEvent(String event, @Nullable ReadableMap params) {
|
|
17
|
+
if (listenerCount > 0) {
|
|
18
|
+
getReactApplicationContext()
|
|
19
|
+
.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
|
|
20
|
+
.emit(event, params);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@Override
|
|
25
|
+
public void addListener(String eventName) {
|
|
26
|
+
listenerCount++;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@Override
|
|
30
|
+
public void removeListeners(double count) {
|
|
31
|
+
listenerCount = Math.max(0, listenerCount - (int) count);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
package ai.luciq.reactlibrary;
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.bridge.ReactApplicationContext;
|
|
4
|
+
|
|
5
|
+
import ai.luciq.reactlibrary.utils.EventEmitterModule;
|
|
6
|
+
|
|
7
|
+
abstract class RNLuciqAPMBaseSpec extends EventEmitterModule {
|
|
8
|
+
RNLuciqAPMBaseSpec(ReactApplicationContext context) {
|
|
9
|
+
super(context);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
package ai.luciq.reactlibrary;
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.bridge.ReactApplicationContext;
|
|
4
|
+
import com.facebook.react.bridge.ReactMethod;
|
|
5
|
+
|
|
6
|
+
import ai.luciq.reactlibrary.utils.EventEmitterModule;
|
|
7
|
+
|
|
8
|
+
abstract class RNLuciqBaseSpec extends EventEmitterModule {
|
|
9
|
+
RNLuciqBaseSpec(ReactApplicationContext context) {
|
|
10
|
+
super(context);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@ReactMethod
|
|
14
|
+
public void addListener(String event) {
|
|
15
|
+
super.addListener(event);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@ReactMethod
|
|
19
|
+
public void removeListeners(Integer count) {
|
|
20
|
+
super.removeListeners(count);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
package ai.luciq.reactlibrary;
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.bridge.ReactApplicationContext;
|
|
4
|
+
import com.facebook.react.bridge.ReactMethod;
|
|
5
|
+
|
|
6
|
+
import ai.luciq.reactlibrary.utils.EventEmitterModule;
|
|
7
|
+
|
|
8
|
+
abstract class RNLuciqBugReportingBaseSpec extends EventEmitterModule {
|
|
9
|
+
RNLuciqBugReportingBaseSpec(ReactApplicationContext context) {
|
|
10
|
+
super(context);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@ReactMethod
|
|
14
|
+
public void addListener(String event) {
|
|
15
|
+
super.addListener(event);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@ReactMethod
|
|
19
|
+
public void removeListeners(Integer count) {
|
|
20
|
+
super.removeListeners(count);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
package ai.luciq.reactlibrary;
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.bridge.ReactApplicationContext;
|
|
4
|
+
import com.facebook.react.bridge.ReactContextBaseJavaModule;
|
|
5
|
+
|
|
6
|
+
abstract class RNLuciqCrashReportingBaseSpec extends ReactContextBaseJavaModule {
|
|
7
|
+
RNLuciqCrashReportingBaseSpec(ReactApplicationContext context) {
|
|
8
|
+
super(context);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
package ai.luciq.reactlibrary;
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.bridge.ReactApplicationContext;
|
|
4
|
+
import com.facebook.react.bridge.ReactContextBaseJavaModule;
|
|
5
|
+
|
|
6
|
+
abstract class RNLuciqFeatureRequestsBaseSpec extends ReactContextBaseJavaModule {
|
|
7
|
+
RNLuciqFeatureRequestsBaseSpec(ReactApplicationContext context) {
|
|
8
|
+
super(context);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
package ai.luciq.reactlibrary;
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.bridge.ReactApplicationContext;
|
|
4
|
+
import com.facebook.react.bridge.ReactMethod;
|
|
5
|
+
|
|
6
|
+
import ai.luciq.reactlibrary.utils.EventEmitterModule;
|
|
7
|
+
|
|
8
|
+
abstract class RNLuciqNetworkLoggerBaseSpec extends EventEmitterModule {
|
|
9
|
+
RNLuciqNetworkLoggerBaseSpec(ReactApplicationContext context) {
|
|
10
|
+
super(context);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@ReactMethod
|
|
14
|
+
public void addListener(String event) {
|
|
15
|
+
super.addListener(event);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@ReactMethod
|
|
19
|
+
public void removeListeners(Integer count) {
|
|
20
|
+
super.removeListeners(count);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
package ai.luciq.reactlibrary;
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.bridge.ReactApplicationContext;
|
|
4
|
+
import com.facebook.react.bridge.ReactMethod;
|
|
5
|
+
|
|
6
|
+
import ai.luciq.reactlibrary.utils.EventEmitterModule;
|
|
7
|
+
|
|
8
|
+
abstract class RNLuciqRepliesBaseSpec extends EventEmitterModule {
|
|
9
|
+
RNLuciqRepliesBaseSpec(ReactApplicationContext context) {
|
|
10
|
+
super(context);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@ReactMethod
|
|
14
|
+
public void addListener(String event) {
|
|
15
|
+
super.addListener(event);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@ReactMethod
|
|
19
|
+
public void removeListeners(Integer count) {
|
|
20
|
+
super.removeListeners(count);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
package ai.luciq.reactlibrary;
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.bridge.ReactApplicationContext;
|
|
4
|
+
import com.facebook.react.bridge.ReactMethod;
|
|
5
|
+
|
|
6
|
+
import ai.luciq.reactlibrary.utils.EventEmitterModule;
|
|
7
|
+
|
|
8
|
+
abstract class RNLuciqSessionReplayBaseSpec extends EventEmitterModule {
|
|
9
|
+
RNLuciqSessionReplayBaseSpec(ReactApplicationContext context) {
|
|
10
|
+
super(context);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@ReactMethod
|
|
14
|
+
public void addListener(String event) {
|
|
15
|
+
super.addListener(event);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@ReactMethod
|
|
19
|
+
public void removeListeners(Integer count) {
|
|
20
|
+
super.removeListeners(count);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
package ai.luciq.reactlibrary;
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.bridge.ReactApplicationContext;
|
|
4
|
+
import com.facebook.react.bridge.ReactMethod;
|
|
5
|
+
|
|
6
|
+
import ai.luciq.reactlibrary.utils.EventEmitterModule;
|
|
7
|
+
|
|
8
|
+
abstract class RNLuciqSurveysBaseSpec extends EventEmitterModule {
|
|
9
|
+
RNLuciqSurveysBaseSpec(ReactApplicationContext context) {
|
|
10
|
+
super(context);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@ReactMethod
|
|
14
|
+
public void addListener(String event) {
|
|
15
|
+
super.addListener(event);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@ReactMethod
|
|
19
|
+
public void removeListeners(Integer count) {
|
|
20
|
+
super.removeListeners(count);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -31,7 +31,7 @@ export const setOptions = (options) => {
|
|
|
31
31
|
*/
|
|
32
32
|
export const onInvokeHandler = (handler) => {
|
|
33
33
|
emitter.addListener(NativeEvents.ON_INVOKE_HANDLER, handler);
|
|
34
|
-
NativeBugReporting.setOnInvokeHandler(
|
|
34
|
+
NativeBugReporting.setOnInvokeHandler();
|
|
35
35
|
};
|
|
36
36
|
/**
|
|
37
37
|
* Sets a block of code to be executed right after the SDK's UI is dismissed.
|
|
@@ -43,7 +43,7 @@ export const onSDKDismissedHandler = (handler) => {
|
|
|
43
43
|
emitter.addListener(NativeEvents.ON_DISMISS_HANDLER, (payload) => {
|
|
44
44
|
handler(payload.dismissType, payload.reportType);
|
|
45
45
|
});
|
|
46
|
-
NativeBugReporting.setOnSDKDismissedHandler(
|
|
46
|
+
NativeBugReporting.setOnSDKDismissedHandler();
|
|
47
47
|
};
|
|
48
48
|
/**
|
|
49
49
|
* Sets the threshold value of the shake gesture for iPhone/iPod Touch
|
|
@@ -160,7 +160,7 @@ export const setDidSelectPromptOptionHandler = (handler) => {
|
|
|
160
160
|
emitter.addListener(NativeEvents.DID_SELECT_PROMPT_OPTION_HANDLER, (payload) => {
|
|
161
161
|
handler(payload.promptOption);
|
|
162
162
|
});
|
|
163
|
-
NativeBugReporting.setDidSelectPromptOptionHandler(
|
|
163
|
+
NativeBugReporting.setDidSelectPromptOptionHandler();
|
|
164
164
|
};
|
|
165
165
|
/**
|
|
166
166
|
* Sets the default edge and offset from the top at which the floating button
|
package/dist/modules/Luciq.d.ts
CHANGED
|
@@ -26,6 +26,21 @@ export declare const init: (config: LuciqConfig) => void;
|
|
|
26
26
|
* @param appVariant the current App variant name
|
|
27
27
|
*/
|
|
28
28
|
export declare const setAppVariant: (appVariant: string) => void;
|
|
29
|
+
/**
|
|
30
|
+
* Enables or disables WebView monitoring.
|
|
31
|
+
* @param isEnabled A boolean to enable/disable WebView monitoring.
|
|
32
|
+
*/
|
|
33
|
+
export declare const setWebViewMonitoringEnabled: (isEnabled: boolean) => void;
|
|
34
|
+
/**
|
|
35
|
+
* Enables or disables WebView network tracking.
|
|
36
|
+
* @param isEnabled A boolean to enable/disable WebView network tracking.
|
|
37
|
+
*/
|
|
38
|
+
export declare const setWebViewNetworkTrackingEnabled: (isEnabled: boolean) => void;
|
|
39
|
+
/**
|
|
40
|
+
* Enables or disables WebView user interactions tracking.
|
|
41
|
+
* @param isEnabled A boolean to enable/disable WebView user interactions tracking.
|
|
42
|
+
*/
|
|
43
|
+
export declare const setWebViewUserInteractionsTrackingEnabled: (isEnabled: boolean) => void;
|
|
29
44
|
/**
|
|
30
45
|
* Sets the Code Push version to be sent with each report.
|
|
31
46
|
* @param version the Code Push version.
|
package/dist/modules/Luciq.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AppState, findNodeHandle, Platform } from 'react-native';
|
|
2
2
|
import Report from '../models/Report';
|
|
3
3
|
import { emitter, NativeEvents, NativeLuciq } from '../native/NativeLuciq';
|
|
4
|
-
import { registerFeatureFlagsListener
|
|
4
|
+
import { registerFeatureFlagsListener } from '../utils/FeatureFlags';
|
|
5
5
|
import { LogLevel, NetworkInterceptionMode, ReproStepsMode, StringKey, } from '../utils/Enums';
|
|
6
6
|
import LuciqUtils, { checkNetworkRequestHandlers, resetNativeObfuscationListener, setApmNetworkFlagsIfChanged, stringifyIfNotString, } from '../utils/LuciqUtils';
|
|
7
7
|
import * as NetworkLogger from './NetworkLogger';
|
|
@@ -50,7 +50,6 @@ function reportCurrentViewForAndroid(screenName) {
|
|
|
50
50
|
* @param config SDK configurations. See {@link LuciqConfig} for more info.
|
|
51
51
|
*/
|
|
52
52
|
export const init = (config) => {
|
|
53
|
-
initFeatureFlagsCache();
|
|
54
53
|
if (Platform.OS === 'android') {
|
|
55
54
|
// Add android feature flags listener for android
|
|
56
55
|
registerFeatureFlagsListener();
|
|
@@ -91,6 +90,27 @@ export const init = (config) => {
|
|
|
91
90
|
export const setAppVariant = (appVariant) => {
|
|
92
91
|
NativeLuciq.setAppVariant(appVariant);
|
|
93
92
|
};
|
|
93
|
+
/**
|
|
94
|
+
* Enables or disables WebView monitoring.
|
|
95
|
+
* @param isEnabled A boolean to enable/disable WebView monitoring.
|
|
96
|
+
*/
|
|
97
|
+
export const setWebViewMonitoringEnabled = (isEnabled) => {
|
|
98
|
+
NativeLuciq.setWebViewMonitoringEnabled(isEnabled);
|
|
99
|
+
};
|
|
100
|
+
/**
|
|
101
|
+
* Enables or disables WebView network tracking.
|
|
102
|
+
* @param isEnabled A boolean to enable/disable WebView network tracking.
|
|
103
|
+
*/
|
|
104
|
+
export const setWebViewNetworkTrackingEnabled = (isEnabled) => {
|
|
105
|
+
NativeLuciq.setWebViewNetworkTrackingEnabled(isEnabled);
|
|
106
|
+
};
|
|
107
|
+
/**
|
|
108
|
+
* Enables or disables WebView user interactions tracking.
|
|
109
|
+
* @param isEnabled A boolean to enable/disable WebView user interactions tracking.
|
|
110
|
+
*/
|
|
111
|
+
export const setWebViewUserInteractionsTrackingEnabled = (isEnabled) => {
|
|
112
|
+
NativeLuciq.setWebViewUserInteractionsTrackingEnabled(isEnabled);
|
|
113
|
+
};
|
|
94
114
|
/**
|
|
95
115
|
* Handles app state changes and updates APM network flags if necessary.
|
|
96
116
|
*/
|
|
@@ -624,7 +644,7 @@ export const onReportSubmitHandler = (handler) => {
|
|
|
624
644
|
const reportObj = new Report(tags, consoleLogs, luciqLogs, userAttributes, fileAttachments);
|
|
625
645
|
handler && handler(reportObj);
|
|
626
646
|
});
|
|
627
|
-
NativeLuciq.setPreSendingHandler(
|
|
647
|
+
NativeLuciq.setPreSendingHandler();
|
|
628
648
|
};
|
|
629
649
|
export const onNavigationStateChange = (prevState, currentState, _action) => {
|
|
630
650
|
const currentScreen = LuciqUtils.getActiveRouteName(currentState);
|
|
@@ -3,6 +3,11 @@ import { NetworkData, ProgressCallback } from '../utils/XhrNetworkInterceptor';
|
|
|
3
3
|
import { NetworkListenerType } from '../native/NativeNetworkLogger';
|
|
4
4
|
export type { NetworkData };
|
|
5
5
|
export type NetworkDataObfuscationHandler = (data: NetworkData) => Promise<NetworkData>;
|
|
6
|
+
/**
|
|
7
|
+
* Sets whether network logs should be sent with bug reports.
|
|
8
|
+
* It is enabled by default.
|
|
9
|
+
* @param isEnabled
|
|
10
|
+
*/
|
|
6
11
|
export declare const setEnabled: (isEnabled: boolean) => void;
|
|
7
12
|
/**
|
|
8
13
|
* @internal
|