@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
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [19.4.0](https://github.com/luciqai/luciq-reactnative-sdk/compare/v19.4.0...19.3.0)
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- **WebView Monitoring**: Added comprehensive WebView monitoring to capture performance metrics, user interactions, and network requests from WebView components.
|
|
8
|
+
- `Luciq.setWebViewMonitoringEnabled(boolean)` - Enable/disable master WebView monitoring
|
|
9
|
+
- `Luciq.setWebViewUserInteractionsTrackingEnabled(boolean)` - Enable/disable user interaction tracking in WebViews
|
|
10
|
+
- `Luciq.setWebViewNetworkTrackingEnabled(boolean`) - Enable/disable network logging from WebViews
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- Bump Luciq iOS SDK to v19.5.1 ([#42](https://github.com/luciqai/luciq-reactnative-sdk/pull/42)). [See release notes](https://github.com/luciqai/Luciq-iOS-sdk/releases/tag/19.5.1).
|
|
15
|
+
|
|
16
|
+
- Bump Luciq Android SDK to v19.4.0 ([#42](https://github.com/luciqai/luciq-reactnative-sdk/pull/42)). [See release notes](https://github.com/luciqai/Luciq-Android-sdk/releases/tag/v19.4.0).
|
|
17
|
+
|
|
3
18
|
## [19.3.0](https://github.com/luciqai/luciq-reactnative-sdk/compare/v19.3.0...19.2.1)
|
|
4
19
|
|
|
5
20
|
### Added
|
package/README.md
CHANGED
|
@@ -231,3 +231,121 @@ await APM.addCompletedCustomSpan('Background Task', start, end);
|
|
|
231
231
|
## Documentation
|
|
232
232
|
|
|
233
233
|
For more details about the supported APIs and how to use them, check our [**Documentation**](https://docs.luciq.ai/docs/react-native-overview).
|
|
234
|
+
|
|
235
|
+
## Contributing: Adding a Native Method
|
|
236
|
+
|
|
237
|
+
The library is a dual-architecture TurboModule — one spec drives codegen for both the legacy bridge and the new architecture. When you add a new native method, you'll touch the files listed below. The exact Android step depends on which pattern the target module uses.
|
|
238
|
+
|
|
239
|
+
### 1. Spec (one file, source of truth)
|
|
240
|
+
|
|
241
|
+
Declare the method in the corresponding spec file under `src/native/specs/`:
|
|
242
|
+
|
|
243
|
+
| Module | Spec file |
|
|
244
|
+
| -------------------- | -------------------------- |
|
|
245
|
+
| Core | `NativeLuciq.ts` |
|
|
246
|
+
| `LCQBugReporting` | `NativeBugReporting.ts` |
|
|
247
|
+
| `LCQCrashReporting` | `NativeCrashReporting.ts` |
|
|
248
|
+
| `LCQAPM` | `NativeAPM.ts` |
|
|
249
|
+
| `LCQSurveys` | `NativeSurveys.ts` |
|
|
250
|
+
| `LCQReplies` | `NativeReplies.ts` |
|
|
251
|
+
| `LCQFeatureRequests` | `NativeFeatureRequests.ts` |
|
|
252
|
+
| `LCQSessionReplay` | `NativeSessionReplay.ts` |
|
|
253
|
+
| `LCQNetworkLogger` | `NativeNetworkLogger.ts` |
|
|
254
|
+
|
|
255
|
+
Example — adding `setFoo(value: string): Promise<boolean>` to Crash Reporting:
|
|
256
|
+
|
|
257
|
+
```ts
|
|
258
|
+
// src/native/specs/NativeCrashReporting.ts
|
|
259
|
+
export interface Spec extends TurboModule {
|
|
260
|
+
// …existing methods…
|
|
261
|
+
setFoo(value: string): Promise<boolean>;
|
|
262
|
+
}
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
Spec type constraints to keep in mind:
|
|
266
|
+
|
|
267
|
+
- Parameter types must be: `boolean`, `number`, `string`, `Object`, `UnsafeObject`, `Array<T>`, or explicit `T | null`. No TS enums, no unions of non-null types, no optional `?` parameters, no `Record<K,V>`.
|
|
268
|
+
- Enums → `string`. The rich enum type stays in the public wrapper (`src/modules/*.ts`), which converts to the string value before the native call.
|
|
269
|
+
- Nullable args → explicit `| null`, not `?`.
|
|
270
|
+
- Arbitrary object payloads → `UnsafeObject` (from `react-native/Libraries/Types/CodegenTypes`).
|
|
271
|
+
- Callback function args aren't supported. Use a no-arg method plus a `NativeEventEmitter` subscription on the JS side.
|
|
272
|
+
|
|
273
|
+
### 2. JS wrapper types
|
|
274
|
+
|
|
275
|
+
Add the method to the legacy interface so public code type-checks:
|
|
276
|
+
|
|
277
|
+
```ts
|
|
278
|
+
// src/native/NativeCrashReporting.ts
|
|
279
|
+
export interface CrashReportingNativeModule extends NativeModule {
|
|
280
|
+
// …existing methods…
|
|
281
|
+
setFoo(value: string): Promise<boolean>;
|
|
282
|
+
}
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
If the method is part of the developer-facing API, also expose it from `src/modules/*.ts` with rich types (enums, overloads, etc.). That wrapper is responsible for converting rich types to the spec-compatible primitives.
|
|
286
|
+
|
|
287
|
+
### 3. iOS (one file — `.mm`)
|
|
288
|
+
|
|
289
|
+
Add an `RCT_EXPORT_METHOD` block to the corresponding bridge under `ios/RNLuciq/`:
|
|
290
|
+
|
|
291
|
+
```objc
|
|
292
|
+
// ios/RNLuciq/LuciqCrashReportingBridge.mm
|
|
293
|
+
RCT_EXPORT_METHOD(setFoo:(NSString *)value
|
|
294
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
295
|
+
reject:(RCTPromiseRejectBlock)reject) {
|
|
296
|
+
// implementation
|
|
297
|
+
resolve(@YES);
|
|
298
|
+
}
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
The same `RCT_EXPORT_METHOD` serves both old and new architecture. Match the selector labels (`resolve:`, `reject:`) to the codegen-generated protocol — don't use `resolver:` / `rejecter:`. The `#ifdef RCT_NEW_ARCH_ENABLED` block at the bottom of each bridge (`getTurboModule:`) is already in place; you don't need to touch it.
|
|
302
|
+
|
|
303
|
+
### 4. Android
|
|
304
|
+
|
|
305
|
+
All 9 modules use the **shim pattern**. Add the method directly to the real module file in `android/src/main/java/ai/luciq/reactlibrary/RNLuciqXModule.java` with an `@ReactMethod` annotation whose signature matches the spec exactly:
|
|
306
|
+
|
|
307
|
+
```java
|
|
308
|
+
@ReactMethod
|
|
309
|
+
public void setFoo(String value, Promise promise) {
|
|
310
|
+
MainThreadHandler.runOnMainThread(() -> {
|
|
311
|
+
// implementation
|
|
312
|
+
promise.resolve(true);
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
How it works under the hood: each module extends a thin `RNLuciqXBaseSpec` abstract class that exists in two flavors:
|
|
318
|
+
|
|
319
|
+
- `android/src/oldarch/java/.../RNLuciqXBaseSpec.java` — extends `EventEmitterModule` or `ReactContextBaseJavaModule`
|
|
320
|
+
- `android/src/newarch/java/.../RNLuciqXBaseSpec.java` — extends the codegen-generated `NativeXSpec`
|
|
321
|
+
|
|
322
|
+
Gradle activates one or the other based on `newArchEnabled`. You don't edit these shim files when adding a method — only the main module file. On old arch `@ReactMethod` handles dispatch; on new arch your method's signature overrides the abstract method on `NativeXSpec`.
|
|
323
|
+
|
|
324
|
+
If the new-arch abstract signature uses `double` (codegen maps TS `number` → `double`) or `@Nullable Double` (for `number | null`), make sure your method matches exactly — the compiler will tell you if it doesn't.
|
|
325
|
+
|
|
326
|
+
### 5. Verify
|
|
327
|
+
|
|
328
|
+
Run the full check:
|
|
329
|
+
|
|
330
|
+
```bash
|
|
331
|
+
# Type-check and unit tests
|
|
332
|
+
yarn build:lib && yarn test
|
|
333
|
+
|
|
334
|
+
# Android — old arch
|
|
335
|
+
cd examples/default/android && ./gradlew :app:compileDebugJavaWithJavac
|
|
336
|
+
|
|
337
|
+
# Android — new arch
|
|
338
|
+
./gradlew :app:compileDebugJavaWithJavac -PnewArchEnabled=true
|
|
339
|
+
|
|
340
|
+
# iOS — old arch
|
|
341
|
+
cd examples/default/ios && pod install && xcodebuild -workspace LuciqExample.xcworkspace -scheme LuciqExample -configuration Debug -destination 'generic/platform=iOS Simulator' -sdk iphonesimulator build
|
|
342
|
+
|
|
343
|
+
# iOS — new arch
|
|
344
|
+
RCT_NEW_ARCH_ENABLED=1 pod install && RCT_NEW_ARCH_ENABLED=1 xcodebuild -workspace LuciqExample.xcworkspace -scheme LuciqExample -configuration Debug -destination 'generic/platform=iOS Simulator' -sdk iphonesimulator build
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
All four builds must pass before merging.
|
|
348
|
+
|
|
349
|
+
### Platform-only methods
|
|
350
|
+
|
|
351
|
+
If a method only applies to one platform (e.g. `setNotificationIcon` for Android, `setShakingThresholdForiPad` for iOS), still declare it in the spec — then stub it as a no-op on the other platform so the unified abstract class stays satisfied.
|
package/RNLuciq.podspec
CHANGED
|
@@ -15,7 +15,11 @@ Pod::Spec.new do |s|
|
|
|
15
15
|
s.platform = :ios, "15.0"
|
|
16
16
|
s.source_files = "ios/**/*.{h,m,mm}"
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
if respond_to?(:install_modules_dependencies, true)
|
|
19
|
+
install_modules_dependencies(s)
|
|
20
|
+
else
|
|
21
|
+
s.dependency 'React-Core'
|
|
22
|
+
end
|
|
20
23
|
|
|
24
|
+
use_luciq!(s)
|
|
21
25
|
end
|
package/android/build.gradle
CHANGED
|
@@ -1,4 +1,19 @@
|
|
|
1
|
+
boolean isNewArchitectureEnabled() {
|
|
2
|
+
// Checks `newArchEnabled=true` in any of:
|
|
3
|
+
// * consuming app's `android/gradle.properties` (via rootProject)
|
|
4
|
+
// * this library's `gradle.properties` (via project)
|
|
5
|
+
// * `-PnewArchEnabled=true` on the command line
|
|
6
|
+
def fromRoot = rootProject.hasProperty("newArchEnabled") &&
|
|
7
|
+
rootProject.getProperty("newArchEnabled") == "true"
|
|
8
|
+
def fromProject = project.hasProperty("newArchEnabled") &&
|
|
9
|
+
project.getProperty("newArchEnabled") == "true"
|
|
10
|
+
return fromRoot || fromProject
|
|
11
|
+
}
|
|
12
|
+
|
|
1
13
|
apply plugin: 'com.android.library'
|
|
14
|
+
if (isNewArchitectureEnabled()) {
|
|
15
|
+
apply plugin: 'com.facebook.react'
|
|
16
|
+
}
|
|
2
17
|
|
|
3
18
|
apply from: './jacoco.gradle'
|
|
4
19
|
apply from: './native.gradle'
|
|
@@ -69,6 +84,16 @@ android {
|
|
|
69
84
|
abortOnError true
|
|
70
85
|
// SuppressLint WrongConstant was used to suppress errors when using arrays of ints to represent annotations.
|
|
71
86
|
}
|
|
87
|
+
|
|
88
|
+
sourceSets {
|
|
89
|
+
main {
|
|
90
|
+
if (isNewArchitectureEnabled()) {
|
|
91
|
+
java.srcDirs += ['src/newarch/java']
|
|
92
|
+
} else {
|
|
93
|
+
java.srcDirs += ['src/oldarch/java']
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
72
97
|
}
|
|
73
98
|
|
|
74
99
|
dependencies {
|
package/android/native.gradle
CHANGED
|
@@ -28,9 +28,7 @@ import ai.luciq.apm.networkinterception.cp.APMCPNetworkLog;
|
|
|
28
28
|
import ai.luciq.reactlibrary.utils.EventEmitterModule;
|
|
29
29
|
import ai.luciq.reactlibrary.utils.MainThreadHandler;
|
|
30
30
|
|
|
31
|
-
public class RNLuciqAPMModule extends
|
|
32
|
-
|
|
33
|
-
private static final String NET_TAG = "LCQ-RN-NET";
|
|
31
|
+
public class RNLuciqAPMModule extends RNLuciqAPMBaseSpec {
|
|
34
32
|
|
|
35
33
|
public RNLuciqAPMModule(ReactApplicationContext reactApplicationContext) {
|
|
36
34
|
super(reactApplicationContext);
|
|
@@ -47,7 +45,7 @@ public class RNLuciqAPMModule extends EventEmitterModule {
|
|
|
47
45
|
* Pauses the current thread for 3 seconds.
|
|
48
46
|
*/
|
|
49
47
|
@ReactMethod
|
|
50
|
-
public void
|
|
48
|
+
public void lcqSleep() {
|
|
51
49
|
MainThreadHandler.runOnMainThread(new Runnable() {
|
|
52
50
|
@Override
|
|
53
51
|
public void run() {
|
|
@@ -312,7 +310,7 @@ public class RNLuciqAPMModule extends EventEmitterModule {
|
|
|
312
310
|
* debugging and troubleshooting network-related issues.
|
|
313
311
|
*/
|
|
314
312
|
@ReactMethod
|
|
315
|
-
|
|
313
|
+
public void networkLogAndroid(final double requestStartTime,
|
|
316
314
|
final double requestDuration,
|
|
317
315
|
final String requestHeaders,
|
|
318
316
|
final String requestBody,
|
|
@@ -330,7 +328,6 @@ public class RNLuciqAPMModule extends EventEmitterModule {
|
|
|
330
328
|
@Nullable final String gqLCQueryName,
|
|
331
329
|
@Nullable final String serverErrorMessage
|
|
332
330
|
) {
|
|
333
|
-
Log.d(NET_TAG, "[networkLogAndroid-APM] Received from JS: " + requestMethod + " " + requestUrl + ", status=" + (int) statusCode + ", duration=" + (long) requestDuration + "ms, startTime=" + (long) requestStartTime + ", error=" + errorDomain + ", gqlQuery=" + gqLCQueryName);
|
|
334
331
|
try {
|
|
335
332
|
APMNetworkLogger networkLogger = new APMNetworkLogger();
|
|
336
333
|
|
|
@@ -352,10 +349,8 @@ public class RNLuciqAPMModule extends EventEmitterModule {
|
|
|
352
349
|
}
|
|
353
350
|
|
|
354
351
|
} catch (Exception e) {
|
|
355
|
-
Log.e(NET_TAG, "[networkLogAndroid-APM] Error parsing W3C attributes for " + requestMethod + " " + requestUrl, e);
|
|
356
352
|
e.printStackTrace();
|
|
357
353
|
}
|
|
358
|
-
Log.d(NET_TAG, "[networkLogAndroid-APM] W3C attrs — isW3cHeaderFound=" + isW3cHeaderFound + ", partialId=" + partialId + ", networkStartTimeInSeconds=" + networkStartTimeInSeconds + ", generatedHeader=" + (w3cAttributes != null && !w3cAttributes.isNull("w3cGeneratedHeader") ? w3cAttributes.getString("w3cGeneratedHeader") : "null") + ", caughtHeader=" + (w3cAttributes != null && !w3cAttributes.isNull("w3cCaughtHeader") ? w3cAttributes.getString("w3cCaughtHeader") : "null"));
|
|
359
354
|
APMCPNetworkLog.W3CExternalTraceAttributes w3cExternalTraceAttributes =
|
|
360
355
|
new APMCPNetworkLog.W3CExternalTraceAttributes(
|
|
361
356
|
isW3cHeaderFound,
|
|
@@ -387,17 +382,13 @@ public class RNLuciqAPMModule extends EventEmitterModule {
|
|
|
387
382
|
serverErrorMessage,
|
|
388
383
|
w3cExternalTraceAttributes
|
|
389
384
|
);
|
|
390
|
-
Log.d(NET_TAG, "[networkLogAndroid-APM] Successfully invoked APMNetworkLogger.log via reflection: " + requestMethod + " " + requestUrl);
|
|
391
385
|
} else {
|
|
392
|
-
Log.e(NET_TAG, "[networkLogAndroid-APM] APMNetworkLogger.log method NOT found by reflection — network log will be lost: " + requestMethod + " " + requestUrl);
|
|
393
386
|
Log.e("IB-CP-Bridge", "APMNetworkLogger.log was not found by reflection");
|
|
394
387
|
}
|
|
395
388
|
} catch (Throwable e) {
|
|
396
|
-
Log.e(NET_TAG, "[networkLogAndroid-APM] Exception invoking APMNetworkLogger.log: " + e.getMessage() + " for " + requestMethod + " " + requestUrl, e);
|
|
397
389
|
e.printStackTrace();
|
|
398
390
|
}
|
|
399
391
|
} catch (Throwable e) {
|
|
400
|
-
Log.e(NET_TAG, "[networkLogAndroid-APM] Top-level exception: " + e.getMessage() + " for " + requestMethod + " " + requestUrl, e);
|
|
401
392
|
e.printStackTrace();
|
|
402
393
|
}
|
|
403
394
|
}
|
|
@@ -5,7 +5,6 @@ import android.annotation.TargetApi;
|
|
|
5
5
|
import androidx.annotation.Nullable;
|
|
6
6
|
|
|
7
7
|
import com.facebook.react.bridge.Arguments;
|
|
8
|
-
import com.facebook.react.bridge.Callback;
|
|
9
8
|
import com.facebook.react.bridge.ReactApplicationContext;
|
|
10
9
|
import com.facebook.react.bridge.ReactMethod;
|
|
11
10
|
import com.facebook.react.bridge.ReadableArray;
|
|
@@ -20,7 +19,6 @@ import ai.luciq.library.invocation.OnInvokeCallback;
|
|
|
20
19
|
import ai.luciq.library.invocation.util.LuciqFloatingButtonEdge;
|
|
21
20
|
import ai.luciq.library.invocation.util.LuciqVideoRecordingButtonPosition;
|
|
22
21
|
import ai.luciq.reactlibrary.utils.ArrayUtil;
|
|
23
|
-
import ai.luciq.reactlibrary.utils.EventEmitterModule;
|
|
24
22
|
import ai.luciq.reactlibrary.utils.MainThreadHandler;
|
|
25
23
|
import ai.luciq.bug.userConsent.ActionType;
|
|
26
24
|
import java.util.ArrayList;
|
|
@@ -29,7 +27,7 @@ import ai.luciq.bug.ProactiveReportingConfigs;
|
|
|
29
27
|
|
|
30
28
|
import javax.annotation.Nonnull;
|
|
31
29
|
|
|
32
|
-
public class RNLuciqBugReportingModule extends
|
|
30
|
+
public class RNLuciqBugReportingModule extends RNLuciqBugReportingBaseSpec {
|
|
33
31
|
public RNLuciqBugReportingModule(ReactApplicationContext reactContext) {
|
|
34
32
|
super(reactContext);
|
|
35
33
|
}
|
|
@@ -40,16 +38,6 @@ public class RNLuciqBugReportingModule extends EventEmitterModule {
|
|
|
40
38
|
return "LCQBugReporting";
|
|
41
39
|
}
|
|
42
40
|
|
|
43
|
-
@ReactMethod
|
|
44
|
-
public void addListener(String event) {
|
|
45
|
-
super.addListener(event);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
@ReactMethod
|
|
49
|
-
public void removeListeners(Integer count) {
|
|
50
|
-
super.removeListeners(count);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
41
|
/**
|
|
54
42
|
* Enable or disable all BugReporting related features.
|
|
55
43
|
* @param isEnabled boolean indicating enabled or disabled.
|
|
@@ -241,7 +229,7 @@ public class RNLuciqBugReportingModule extends EventEmitterModule {
|
|
|
241
229
|
* invoking the SDK
|
|
242
230
|
*/
|
|
243
231
|
@ReactMethod
|
|
244
|
-
public void setOnInvokeHandler(
|
|
232
|
+
public void setOnInvokeHandler() {
|
|
245
233
|
MainThreadHandler.runOnMainThread(new Runnable() {
|
|
246
234
|
@Override
|
|
247
235
|
public void run() {
|
|
@@ -265,13 +253,13 @@ public class RNLuciqBugReportingModule extends EventEmitterModule {
|
|
|
265
253
|
* @param floatingButtonOffset integer offset from the left or right edge of the screen.
|
|
266
254
|
*/
|
|
267
255
|
@ReactMethod
|
|
268
|
-
public void setFloatingButtonEdge(final String floatingButtonEdge, final
|
|
256
|
+
public void setFloatingButtonEdge(final String floatingButtonEdge, final double floatingButtonOffset) {
|
|
269
257
|
MainThreadHandler.runOnMainThread(new Runnable() {
|
|
270
258
|
@Override
|
|
271
259
|
public void run() {
|
|
272
260
|
final LuciqFloatingButtonEdge parsedEdge = ArgsRegistry.floatingButtonEdges
|
|
273
261
|
.getOrDefault(floatingButtonEdge, LuciqFloatingButtonEdge.RIGHT);
|
|
274
|
-
BugReporting.setFloatingButtonOffset(floatingButtonOffset);
|
|
262
|
+
BugReporting.setFloatingButtonOffset((int) floatingButtonOffset);
|
|
275
263
|
BugReporting.setFloatingButtonEdge(parsedEdge);
|
|
276
264
|
}
|
|
277
265
|
});
|
|
@@ -286,7 +274,7 @@ public class RNLuciqBugReportingModule extends EventEmitterModule {
|
|
|
286
274
|
* dismissing the SDK.
|
|
287
275
|
*/
|
|
288
276
|
@ReactMethod
|
|
289
|
-
public void setOnSDKDismissedHandler(
|
|
277
|
+
public void setOnSDKDismissedHandler() {
|
|
290
278
|
MainThreadHandler.runOnMainThread(new Runnable() {
|
|
291
279
|
@Override
|
|
292
280
|
public void run() {
|
|
@@ -316,12 +304,12 @@ public class RNLuciqBugReportingModule extends EventEmitterModule {
|
|
|
316
304
|
* @param androidThreshold Threshold for android devices.
|
|
317
305
|
*/
|
|
318
306
|
@ReactMethod
|
|
319
|
-
public void setShakingThresholdForAndroid(final
|
|
307
|
+
public void setShakingThresholdForAndroid(final double androidThreshold) {
|
|
320
308
|
MainThreadHandler.runOnMainThread(new Runnable() {
|
|
321
309
|
@Override
|
|
322
310
|
public void run() {
|
|
323
311
|
try {
|
|
324
|
-
BugReporting.setShakingThreshold(androidThreshold);
|
|
312
|
+
BugReporting.setShakingThreshold((int) androidThreshold);
|
|
325
313
|
} catch (Exception e) {
|
|
326
314
|
e.printStackTrace();
|
|
327
315
|
}
|
|
@@ -396,7 +384,7 @@ public class RNLuciqBugReportingModule extends EventEmitterModule {
|
|
|
396
384
|
* @param reportTypes (Optional) Array of reportType. If it's not passed, the limit will apply to all report types.
|
|
397
385
|
*/
|
|
398
386
|
@ReactMethod
|
|
399
|
-
public void setCommentMinimumCharacterCount(final
|
|
387
|
+
public void setCommentMinimumCharacterCount(final double limit, final ReadableArray reportTypes){
|
|
400
388
|
MainThreadHandler.runOnMainThread(new Runnable() {
|
|
401
389
|
@SuppressLint("WrongConstant")
|
|
402
390
|
@Override
|
|
@@ -410,7 +398,7 @@ public class RNLuciqBugReportingModule extends EventEmitterModule {
|
|
|
410
398
|
typesInts[i] = types.get(i);
|
|
411
399
|
}
|
|
412
400
|
|
|
413
|
-
BugReporting.setCommentMinimumCharacterCountForBugReportType(limit, typesInts); } catch (Exception e) {
|
|
401
|
+
BugReporting.setCommentMinimumCharacterCountForBugReportType((int) limit, typesInts); } catch (Exception e) {
|
|
414
402
|
e.printStackTrace();
|
|
415
403
|
}
|
|
416
404
|
}
|
|
@@ -448,13 +436,13 @@ public class RNLuciqBugReportingModule extends EventEmitterModule {
|
|
|
448
436
|
* @param gapBetweenModals controls the time gap between showing 2 proactive reporting dialogs in seconds
|
|
449
437
|
*/
|
|
450
438
|
@ReactMethod
|
|
451
|
-
public void setProactiveReportingConfigurations(final boolean enabled, final
|
|
439
|
+
public void setProactiveReportingConfigurations(final boolean enabled, final double gapBetweenModals, final double modalDelayAfterDetection) {
|
|
452
440
|
MainThreadHandler.runOnMainThread(new Runnable() {
|
|
453
441
|
@Override
|
|
454
442
|
public void run() {
|
|
455
443
|
ProactiveReportingConfigs configs = new ProactiveReportingConfigs.Builder()
|
|
456
|
-
.setGapBetweenModals(gapBetweenModals) // Time in seconds
|
|
457
|
-
.setModalDelayAfterDetection(modalDelayAfterDetection) // Time in seconds
|
|
444
|
+
.setGapBetweenModals((int) gapBetweenModals) // Time in seconds
|
|
445
|
+
.setModalDelayAfterDetection((int) modalDelayAfterDetection) // Time in seconds
|
|
458
446
|
.isEnabled(enabled) //Enable/disable
|
|
459
447
|
.build();
|
|
460
448
|
BugReporting.setProactiveReportingConfigurations(configs);
|
|
@@ -463,4 +451,20 @@ public class RNLuciqBugReportingModule extends EventEmitterModule {
|
|
|
463
451
|
}
|
|
464
452
|
});
|
|
465
453
|
}
|
|
454
|
+
|
|
455
|
+
@ReactMethod
|
|
456
|
+
public void setAutoScreenRecordingDuration(double maxDuration) {
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
@ReactMethod
|
|
460
|
+
public void setShakingThresholdForiPhone(double threshold) {
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
@ReactMethod
|
|
464
|
+
public void setShakingThresholdForiPad(double threshold) {
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
@ReactMethod
|
|
468
|
+
public void setDidSelectPromptOptionHandler() {
|
|
469
|
+
}
|
|
466
470
|
}
|
|
@@ -6,7 +6,6 @@ import androidx.annotation.NonNull;
|
|
|
6
6
|
|
|
7
7
|
import com.facebook.react.bridge.Promise;
|
|
8
8
|
import com.facebook.react.bridge.ReactApplicationContext;
|
|
9
|
-
import com.facebook.react.bridge.ReactContextBaseJavaModule;
|
|
10
9
|
import com.facebook.react.bridge.ReactMethod;
|
|
11
10
|
import com.facebook.react.bridge.ReadableMap;
|
|
12
11
|
import ai.luciq.crash.CrashReporting;
|
|
@@ -24,7 +23,7 @@ import java.util.Map;
|
|
|
24
23
|
import javax.annotation.Nonnull;
|
|
25
24
|
import javax.annotation.Nullable;
|
|
26
25
|
|
|
27
|
-
public class RNLuciqCrashReportingModule extends
|
|
26
|
+
public class RNLuciqCrashReportingModule extends RNLuciqCrashReportingBaseSpec {
|
|
28
27
|
|
|
29
28
|
public RNLuciqCrashReportingModule(ReactApplicationContext reactApplicationContext) {
|
|
30
29
|
super(reactApplicationContext);
|
|
@@ -67,9 +66,9 @@ public class RNLuciqCrashReportingModule extends ReactContextBaseJavaModule {
|
|
|
67
66
|
* finishes processing/handling the crash.
|
|
68
67
|
*/
|
|
69
68
|
@ReactMethod
|
|
70
|
-
public void sendJSCrash(final
|
|
69
|
+
public void sendJSCrash(final ReadableMap exceptionObject, final Promise promise) {
|
|
71
70
|
try {
|
|
72
|
-
JSONObject jsonObject = new JSONObject(exceptionObject);
|
|
71
|
+
JSONObject jsonObject = exceptionObject == null ? new JSONObject() : new JSONObject(exceptionObject.toHashMap());
|
|
73
72
|
sendJSCrashByReflection(jsonObject, false, new Runnable() {
|
|
74
73
|
@Override
|
|
75
74
|
public void run() {
|
|
@@ -90,9 +89,9 @@ public class RNLuciqCrashReportingModule extends ReactContextBaseJavaModule {
|
|
|
90
89
|
* @param level different severity levels for errors
|
|
91
90
|
*/
|
|
92
91
|
@ReactMethod
|
|
93
|
-
public void sendHandledJSCrash(final
|
|
92
|
+
public void sendHandledJSCrash(final ReadableMap exceptionObject, @Nullable final ReadableMap userAttributes, @Nullable final String fingerprint, @Nullable final String level, final Promise promise) {
|
|
94
93
|
try {
|
|
95
|
-
final JSONObject jsonObject = new JSONObject(exceptionObject);
|
|
94
|
+
final JSONObject jsonObject = exceptionObject == null ? new JSONObject() : new JSONObject(exceptionObject.toHashMap());
|
|
96
95
|
MainThreadHandler.runOnMainThread(new Runnable() {
|
|
97
96
|
@Override
|
|
98
97
|
public void run() {
|
|
@@ -108,14 +107,17 @@ public class RNLuciqCrashReportingModule extends ReactContextBaseJavaModule {
|
|
|
108
107
|
|
|
109
108
|
RNLuciqReactnativeModule.clearCurrentReport();
|
|
110
109
|
}
|
|
110
|
+
promise.resolve(null);
|
|
111
111
|
} catch (ClassNotFoundException | IllegalAccessException |
|
|
112
112
|
InvocationTargetException e) {
|
|
113
113
|
e.printStackTrace();
|
|
114
|
+
promise.resolve(null);
|
|
114
115
|
}
|
|
115
116
|
}
|
|
116
117
|
});
|
|
117
118
|
} catch (Throwable e) {
|
|
118
119
|
e.printStackTrace();
|
|
120
|
+
promise.resolve(null);
|
|
119
121
|
}
|
|
120
122
|
}
|
|
121
123
|
|
|
@@ -150,7 +152,7 @@ public class RNLuciqCrashReportingModule extends ReactContextBaseJavaModule {
|
|
|
150
152
|
* @param isEnabled boolean indicating enabled or disabled.
|
|
151
153
|
*/
|
|
152
154
|
@ReactMethod
|
|
153
|
-
public void setNDKCrashesEnabled(final boolean isEnabled) {
|
|
155
|
+
public void setNDKCrashesEnabled(final boolean isEnabled, final Promise promise) {
|
|
154
156
|
MainThreadHandler.runOnMainThread(new Runnable() {
|
|
155
157
|
@Override
|
|
156
158
|
public void run() {
|
|
@@ -163,7 +165,16 @@ public class RNLuciqCrashReportingModule extends ReactContextBaseJavaModule {
|
|
|
163
165
|
} catch (Exception e) {
|
|
164
166
|
e.printStackTrace();
|
|
165
167
|
}
|
|
168
|
+
promise.resolve(null);
|
|
166
169
|
}
|
|
167
170
|
});
|
|
168
171
|
}
|
|
172
|
+
|
|
173
|
+
@ReactMethod
|
|
174
|
+
public void addListener(String eventName) {
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
@ReactMethod
|
|
178
|
+
public void removeListeners(double count) {
|
|
179
|
+
}
|
|
169
180
|
}
|
|
@@ -3,7 +3,6 @@ package ai.luciq.reactlibrary;
|
|
|
3
3
|
import android.annotation.SuppressLint;
|
|
4
4
|
|
|
5
5
|
import com.facebook.react.bridge.ReactApplicationContext;
|
|
6
|
-
import com.facebook.react.bridge.ReactContextBaseJavaModule;
|
|
7
6
|
import com.facebook.react.bridge.ReactMethod;
|
|
8
7
|
import com.facebook.react.bridge.ReadableArray;
|
|
9
8
|
import ai.luciq.featuresrequest.FeatureRequests;
|
|
@@ -15,7 +14,7 @@ import java.util.ArrayList;
|
|
|
15
14
|
|
|
16
15
|
import javax.annotation.Nonnull;
|
|
17
16
|
|
|
18
|
-
public class RNLuciqFeatureRequestsModule extends
|
|
17
|
+
public class RNLuciqFeatureRequestsModule extends RNLuciqFeatureRequestsBaseSpec {
|
|
19
18
|
|
|
20
19
|
public RNLuciqFeatureRequestsModule(ReactApplicationContext reactApplicationContext) {
|
|
21
20
|
super(reactApplicationContext);
|