@luciq/react-native 19.0.0-286-SNAPSHOT → 19.1.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/CHANGELOG.md +13 -1
- package/android/native.gradle +1 -1
- package/android/src/main/java/ai/luciq/reactlibrary/ArgsRegistry.java +14 -0
- package/android/src/main/java/ai/luciq/reactlibrary/RNLuciqSessionReplayModule.java +51 -0
- package/bin/index.js +0 -0
- package/dist/modules/APM.js +0 -12
- package/dist/modules/BugReporting.js +0 -38
- package/dist/modules/CrashReporting.js +0 -3
- package/dist/modules/FeatureRequests.js +0 -6
- package/dist/modules/Luciq.js +0 -58
- package/dist/modules/NetworkLogger.js +3 -21
- package/dist/modules/Replies.js +0 -15
- package/dist/modules/SessionReplay.d.ts +54 -0
- package/dist/modules/SessionReplay.js +59 -6
- package/dist/modules/Surveys.js +0 -10
- package/dist/native/NativeConstants.d.ts +11 -1
- package/dist/native/NativeSessionReplay.d.ts +3 -0
- package/dist/utils/Enums.d.ts +37 -0
- package/dist/utils/Enums.js +39 -0
- package/ios/RNLuciq/ArgsRegistry.h +2 -0
- package/ios/RNLuciq/ArgsRegistry.m +18 -0
- package/ios/RNLuciq/LuciqSessionReplayBridge.h +6 -0
- package/ios/RNLuciq/LuciqSessionReplayBridge.m +11 -0
- package/ios/RNLuciq/RCTConvert+LuciqEnums.m +14 -0
- package/ios/native.rb +1 -1
- package/package.json +2 -1
- package/plugin/build/index.js +42078 -0
- package/src/modules/APM.ts +0 -12
- package/src/modules/BugReporting.ts +0 -38
- package/src/modules/CrashReporting.ts +0 -3
- package/src/modules/FeatureRequests.ts +0 -6
- package/src/modules/Luciq.ts +0 -58
- package/src/modules/NetworkLogger.ts +3 -21
- package/src/modules/Replies.ts +0 -15
- package/src/modules/SessionReplay.ts +63 -6
- package/src/modules/Surveys.ts +0 -10
- package/src/native/NativeConstants.ts +15 -1
- package/src/native/NativeSessionReplay.ts +3 -0
- package/src/utils/Enums.ts +39 -0
package/src/modules/Luciq.ts
CHANGED
|
@@ -53,7 +53,6 @@ let shouldEnableNativeInterception = false; // For Android: used to disable APM
|
|
|
53
53
|
* @param isEnabled A boolean to enable/disable Luciq.
|
|
54
54
|
*/
|
|
55
55
|
export const setEnabled = (isEnabled: boolean) => {
|
|
56
|
-
console.log('[LCQ-RN] Luciq.setEnabled called', { isEnabled });
|
|
57
56
|
NativeLuciq.setEnabled(isEnabled);
|
|
58
57
|
};
|
|
59
58
|
|
|
@@ -82,7 +81,6 @@ function reportCurrentViewForAndroid(screenName: string | null) {
|
|
|
82
81
|
* @param config SDK configurations. See {@link LuciqConfig} for more info.
|
|
83
82
|
*/
|
|
84
83
|
export const init = (config: LuciqConfig) => {
|
|
85
|
-
console.log('[LCQ-RN] Luciq.init called', { config });
|
|
86
84
|
if (Platform.OS === 'android') {
|
|
87
85
|
// Add android feature flags listener for android
|
|
88
86
|
registerFeatureFlagsListener();
|
|
@@ -129,7 +127,6 @@ export const init = (config: LuciqConfig) => {
|
|
|
129
127
|
* @param appVariant the current App variant name
|
|
130
128
|
*/
|
|
131
129
|
export const setAppVariant = (appVariant: string) => {
|
|
132
|
-
console.log('[LCQ-RN] Luciq.setAppVariant called', { appVariant });
|
|
133
130
|
NativeLuciq.setAppVariant(appVariant);
|
|
134
131
|
};
|
|
135
132
|
|
|
@@ -331,7 +328,6 @@ function addOnFeatureUpdatedListener(config: LuciqConfig) {
|
|
|
331
328
|
* @deprecated Use {@link setOverAirVersion} instead.
|
|
332
329
|
*/
|
|
333
330
|
export const setCodePushVersion = (version: string) => {
|
|
334
|
-
console.log('[LCQ-RN] Luciq.setCodePushVersion called', { version });
|
|
335
331
|
NativeLuciq.setCodePushVersion(version);
|
|
336
332
|
};
|
|
337
333
|
|
|
@@ -341,7 +337,6 @@ export const setCodePushVersion = (version: string) => {
|
|
|
341
337
|
*
|
|
342
338
|
*/
|
|
343
339
|
export const setOverAirVersion = (OTAserviceVersion: OverAirUpdate) => {
|
|
344
|
-
console.log('[LCQ-RN] Luciq.setOverAirVersion called', { OTAserviceVersion });
|
|
345
340
|
NativeLuciq.setOverAirVersion(OTAserviceVersion);
|
|
346
341
|
};
|
|
347
342
|
|
|
@@ -352,7 +347,6 @@ export const setOverAirVersion = (OTAserviceVersion: OverAirUpdate) => {
|
|
|
352
347
|
* @param data A string to be attached to each report, with a maximum size of 1,000 characters.
|
|
353
348
|
*/
|
|
354
349
|
export const setUserData = (data: string) => {
|
|
355
|
-
console.log('[LCQ-RN] Luciq.setUserData called', { data });
|
|
356
350
|
NativeLuciq.setUserData(data);
|
|
357
351
|
};
|
|
358
352
|
|
|
@@ -364,7 +358,6 @@ export const setUserData = (data: string) => {
|
|
|
364
358
|
* @param isEnabled A boolean to set user steps tracking to being enabled or disabled.
|
|
365
359
|
*/
|
|
366
360
|
export const setTrackUserSteps = (isEnabled: boolean) => {
|
|
367
|
-
console.log('[LCQ-RN] Luciq.setTrackUserSteps called', { isEnabled });
|
|
368
361
|
if (Platform.OS === 'ios') {
|
|
369
362
|
NativeLuciq.setTrackUserSteps(isEnabled);
|
|
370
363
|
}
|
|
@@ -376,7 +369,6 @@ export const setTrackUserSteps = (isEnabled: boolean) => {
|
|
|
376
369
|
* Xcode's console is enabled or not.
|
|
377
370
|
*/
|
|
378
371
|
export const setLCQLogPrintsToConsole = (printsToConsole: boolean) => {
|
|
379
|
-
console.log('[LCQ-RN] Luciq.setLCQLogPrintsToConsole called', { printsToConsole });
|
|
380
372
|
if (Platform.OS === 'ios') {
|
|
381
373
|
NativeLuciq.setLCQLogPrintsToConsole(printsToConsole);
|
|
382
374
|
}
|
|
@@ -388,7 +380,6 @@ export const setLCQLogPrintsToConsole = (printsToConsole: boolean) => {
|
|
|
388
380
|
* @param isEnabled A boolean parameter to enable or disable the feature.
|
|
389
381
|
*/
|
|
390
382
|
export const setSessionProfilerEnabled = (isEnabled: boolean) => {
|
|
391
|
-
console.log('[LCQ-RN] Luciq.setSessionProfilerEnabled called', { isEnabled });
|
|
392
383
|
NativeLuciq.setSessionProfilerEnabled(isEnabled);
|
|
393
384
|
};
|
|
394
385
|
|
|
@@ -399,7 +390,6 @@ export const setSessionProfilerEnabled = (isEnabled: boolean) => {
|
|
|
399
390
|
* @param sdkLocale A locale to set the SDK to.
|
|
400
391
|
*/
|
|
401
392
|
export const setLocale = (sdkLocale: Locale) => {
|
|
402
|
-
console.log('[LCQ-RN] Luciq.setLocale called', { sdkLocale });
|
|
403
393
|
NativeLuciq.setLocale(sdkLocale);
|
|
404
394
|
};
|
|
405
395
|
|
|
@@ -408,7 +398,6 @@ export const setLocale = (sdkLocale: Locale) => {
|
|
|
408
398
|
* @param sdkTheme
|
|
409
399
|
*/
|
|
410
400
|
export const setColorTheme = (sdkTheme: ColorTheme) => {
|
|
411
|
-
console.log('[LCQ-RN] Luciq.setColorTheme called', { sdkTheme });
|
|
412
401
|
NativeLuciq.setColorTheme(sdkTheme);
|
|
413
402
|
};
|
|
414
403
|
|
|
@@ -421,7 +410,6 @@ export const setColorTheme = (sdkTheme: ColorTheme) => {
|
|
|
421
410
|
* @deprecated Please migrate to the new UI customization API: {@link setTheme}
|
|
422
411
|
*/
|
|
423
412
|
export const setPrimaryColor = (color: string) => {
|
|
424
|
-
console.log('[LCQ-RN] Luciq.setPrimaryColor called', { color });
|
|
425
413
|
NativeLuciq.setTheme({ primaryColor: color });
|
|
426
414
|
};
|
|
427
415
|
|
|
@@ -431,7 +419,6 @@ export const setPrimaryColor = (color: string) => {
|
|
|
431
419
|
* @param tags An array of tags to append to current tags.
|
|
432
420
|
*/
|
|
433
421
|
export const appendTags = (tags: string[]) => {
|
|
434
|
-
console.log('[LCQ-RN] Luciq.appendTags called', { tags });
|
|
435
422
|
NativeLuciq.appendTags(tags);
|
|
436
423
|
};
|
|
437
424
|
|
|
@@ -439,7 +426,6 @@ export const appendTags = (tags: string[]) => {
|
|
|
439
426
|
* Manually removes all tags of reported feedback, bug or crash.
|
|
440
427
|
*/
|
|
441
428
|
export const resetTags = () => {
|
|
442
|
-
console.log('[LCQ-RN] Luciq.resetTags called');
|
|
443
429
|
NativeLuciq.resetTags();
|
|
444
430
|
};
|
|
445
431
|
|
|
@@ -447,7 +433,6 @@ export const resetTags = () => {
|
|
|
447
433
|
* Gets all tags of reported feedback, bug or crash.
|
|
448
434
|
*/
|
|
449
435
|
export const getTags = async (): Promise<string[] | null> => {
|
|
450
|
-
console.log('[LCQ-RN] Luciq.getTags called');
|
|
451
436
|
const tags = await NativeLuciq.getTags();
|
|
452
437
|
|
|
453
438
|
return tags;
|
|
@@ -460,7 +445,6 @@ export const getTags = async (): Promise<string[] | null> => {
|
|
|
460
445
|
* @param string String value to override the default one.
|
|
461
446
|
*/
|
|
462
447
|
export const setString = (key: StringKey, string: string) => {
|
|
463
|
-
console.log('[LCQ-RN] Luciq.setString called', { key, string });
|
|
464
448
|
// Suffix the repro steps list item numbering title with a # to unify the string key's
|
|
465
449
|
// behavior between Android and iOS
|
|
466
450
|
if (Platform.OS === 'android' && key === StringKey.reproStepsListItemNumberingTitle) {
|
|
@@ -480,7 +464,6 @@ export const setString = (key: StringKey, string: string) => {
|
|
|
480
464
|
* @param [id] ID of the user to be set.
|
|
481
465
|
*/
|
|
482
466
|
export const identifyUser = (email: string, name: string, id?: string) => {
|
|
483
|
-
console.log('[LCQ-RN] Luciq.identifyUser called', { email, name, id });
|
|
484
467
|
NativeLuciq.identifyUser(email, name, id);
|
|
485
468
|
};
|
|
486
469
|
|
|
@@ -490,7 +473,6 @@ export const identifyUser = (email: string, name: string, id?: string) => {
|
|
|
490
473
|
* It also reset the chats on device and removes user attributes, user data and completed surveys.
|
|
491
474
|
*/
|
|
492
475
|
export const logOut = () => {
|
|
493
|
-
console.log('[LCQ-RN] Luciq.logOut called');
|
|
494
476
|
NativeLuciq.logOut();
|
|
495
477
|
};
|
|
496
478
|
|
|
@@ -500,7 +482,6 @@ export const logOut = () => {
|
|
|
500
482
|
* @param name Event name.
|
|
501
483
|
*/
|
|
502
484
|
export const logUserEvent = (name: string) => {
|
|
503
|
-
console.log('[LCQ-RN] Luciq.logUserEvent called', { name });
|
|
504
485
|
NativeLuciq.logUserEvent(name);
|
|
505
486
|
};
|
|
506
487
|
|
|
@@ -515,7 +496,6 @@ export const logUserEvent = (name: string) => {
|
|
|
515
496
|
* @param message the message
|
|
516
497
|
*/
|
|
517
498
|
export const logVerbose = (message: string) => {
|
|
518
|
-
console.log('[LCQ-RN] Luciq.logVerbose called', { message });
|
|
519
499
|
if (!message) {
|
|
520
500
|
return;
|
|
521
501
|
}
|
|
@@ -534,7 +514,6 @@ export const logVerbose = (message: string) => {
|
|
|
534
514
|
* @param message the message
|
|
535
515
|
*/
|
|
536
516
|
export const logInfo = (message: string) => {
|
|
537
|
-
console.log('[LCQ-RN] Luciq.logInfo called', { message });
|
|
538
517
|
if (!message) {
|
|
539
518
|
return;
|
|
540
519
|
}
|
|
@@ -553,7 +532,6 @@ export const logInfo = (message: string) => {
|
|
|
553
532
|
* @param message the message
|
|
554
533
|
*/
|
|
555
534
|
export const logDebug = (message: string) => {
|
|
556
|
-
console.log('[LCQ-RN] Luciq.logDebug called', { message });
|
|
557
535
|
if (!message) {
|
|
558
536
|
return;
|
|
559
537
|
}
|
|
@@ -572,7 +550,6 @@ export const logDebug = (message: string) => {
|
|
|
572
550
|
* @param message the message
|
|
573
551
|
*/
|
|
574
552
|
export const logError = (message: string) => {
|
|
575
|
-
console.log('[LCQ-RN] Luciq.logError called', { message });
|
|
576
553
|
if (!message) {
|
|
577
554
|
return;
|
|
578
555
|
}
|
|
@@ -591,7 +568,6 @@ export const logError = (message: string) => {
|
|
|
591
568
|
* @param message the message
|
|
592
569
|
*/
|
|
593
570
|
export const logWarn = (message: string) => {
|
|
594
|
-
console.log('[LCQ-RN] Luciq.logWarn called', { message });
|
|
595
571
|
if (!message) {
|
|
596
572
|
return;
|
|
597
573
|
}
|
|
@@ -603,7 +579,6 @@ export const logWarn = (message: string) => {
|
|
|
603
579
|
* Clear all Luciq logs, console logs, network logs and user steps.
|
|
604
580
|
*/
|
|
605
581
|
export const clearLogs = () => {
|
|
606
|
-
console.log('[LCQ-RN] Luciq.clearLogs called');
|
|
607
582
|
NativeLuciq.clearLogs();
|
|
608
583
|
};
|
|
609
584
|
|
|
@@ -622,7 +597,6 @@ export const clearLogs = () => {
|
|
|
622
597
|
* ```
|
|
623
598
|
*/
|
|
624
599
|
export const setReproStepsConfig = (config: ReproConfig) => {
|
|
625
|
-
console.log('[LCQ-RN] Luciq.setReproStepsConfig called', { config });
|
|
626
600
|
let bug = config.bug ?? ReproStepsMode.enabled;
|
|
627
601
|
let crash = config.crash ?? ReproStepsMode.enabledWithNoScreenshots;
|
|
628
602
|
let sessionReplay = config.sessionReplay ?? ReproStepsMode.enabled;
|
|
@@ -643,7 +617,6 @@ export const setReproStepsConfig = (config: ReproConfig) => {
|
|
|
643
617
|
* @param value the value
|
|
644
618
|
*/
|
|
645
619
|
export const setUserAttribute = (key: string, value: string) => {
|
|
646
|
-
console.log('[LCQ-RN] Luciq.setUserAttribute called', { key, value });
|
|
647
620
|
if (!key || typeof key !== 'string' || typeof value !== 'string') {
|
|
648
621
|
Logger.error(LuciqConstants.SET_USER_ATTRIBUTES_ERROR_TYPE_MESSAGE);
|
|
649
622
|
return;
|
|
@@ -657,7 +630,6 @@ export const setUserAttribute = (key: string, value: string) => {
|
|
|
657
630
|
* @param key The attribute key as string
|
|
658
631
|
*/
|
|
659
632
|
export const getUserAttribute = async (key: string): Promise<string | null> => {
|
|
660
|
-
console.log('[LCQ-RN] Luciq.getUserAttribute called', { key });
|
|
661
633
|
const attribute = await NativeLuciq.getUserAttribute(key);
|
|
662
634
|
|
|
663
635
|
return attribute;
|
|
@@ -670,7 +642,6 @@ export const getUserAttribute = async (key: string): Promise<string | null> => {
|
|
|
670
642
|
* @see {@link setUserAttribute}
|
|
671
643
|
*/
|
|
672
644
|
export const removeUserAttribute = (key: string) => {
|
|
673
|
-
console.log('[LCQ-RN] Luciq.removeUserAttribute called', { key });
|
|
674
645
|
if (!key || typeof key !== 'string') {
|
|
675
646
|
Logger.error(LuciqConstants.REMOVE_USER_ATTRIBUTES_ERROR_TYPE_MESSAGE);
|
|
676
647
|
|
|
@@ -684,7 +655,6 @@ export const removeUserAttribute = (key: string) => {
|
|
|
684
655
|
* set user attributes, or an empty dictionary if no user attributes have been set.
|
|
685
656
|
*/
|
|
686
657
|
export const getAllUserAttributes = async (): Promise<Record<string, string>> => {
|
|
687
|
-
console.log('[LCQ-RN] Luciq.getAllUserAttributes called');
|
|
688
658
|
const attributes = await NativeLuciq.getAllUserAttributes();
|
|
689
659
|
|
|
690
660
|
return attributes;
|
|
@@ -694,7 +664,6 @@ export const getAllUserAttributes = async (): Promise<Record<string, string>> =>
|
|
|
694
664
|
* Clears all user attributes if exists.
|
|
695
665
|
*/
|
|
696
666
|
export const clearAllUserAttributes = () => {
|
|
697
|
-
console.log('[LCQ-RN] Luciq.clearAllUserAttributes called');
|
|
698
667
|
NativeLuciq.clearAllUserAttributes();
|
|
699
668
|
};
|
|
700
669
|
|
|
@@ -703,7 +672,6 @@ export const clearAllUserAttributes = () => {
|
|
|
703
672
|
* @param mode An enum to set the welcome message mode to live, or beta.
|
|
704
673
|
*/
|
|
705
674
|
export const showWelcomeMessage = (mode: WelcomeMessageMode) => {
|
|
706
|
-
console.log('[LCQ-RN] Luciq.showWelcomeMessage called', { mode });
|
|
707
675
|
NativeLuciq.showWelcomeMessageWithMode(mode);
|
|
708
676
|
};
|
|
709
677
|
|
|
@@ -712,7 +680,6 @@ export const showWelcomeMessage = (mode: WelcomeMessageMode) => {
|
|
|
712
680
|
* @param mode An enum to set the welcome message mode to live, beta or disabled.
|
|
713
681
|
*/
|
|
714
682
|
export const setWelcomeMessageMode = (mode: WelcomeMessageMode) => {
|
|
715
|
-
console.log('[LCQ-RN] Luciq.setWelcomeMessageMode called', { mode });
|
|
716
683
|
NativeLuciq.setWelcomeMessageMode(mode);
|
|
717
684
|
};
|
|
718
685
|
|
|
@@ -722,7 +689,6 @@ export const setWelcomeMessageMode = (mode: WelcomeMessageMode) => {
|
|
|
722
689
|
* @param fileName
|
|
723
690
|
*/
|
|
724
691
|
export const addFileAttachment = (filePath: string, fileName: string) => {
|
|
725
|
-
console.log('[LCQ-RN] Luciq.addFileAttachment called', { filePath, fileName });
|
|
726
692
|
if (Platform.OS === 'android') {
|
|
727
693
|
NativeLuciq.setFileAttachment(filePath, fileName);
|
|
728
694
|
} else {
|
|
@@ -735,7 +701,6 @@ export const addFileAttachment = (filePath: string, fileName: string) => {
|
|
|
735
701
|
* @param viewRef the ref of the component to hide
|
|
736
702
|
*/
|
|
737
703
|
export const addPrivateView = (viewRef: number | React.Component | React.ComponentClass) => {
|
|
738
|
-
console.log('[LCQ-RN] Luciq.addPrivateView called', { viewRef });
|
|
739
704
|
const nativeTag = findNodeHandle(viewRef);
|
|
740
705
|
NativeLuciq.addPrivateView(nativeTag);
|
|
741
706
|
};
|
|
@@ -746,7 +711,6 @@ export const addPrivateView = (viewRef: number | React.Component | React.Compone
|
|
|
746
711
|
* @param viewRef the ref of the component to remove from hidden views
|
|
747
712
|
*/
|
|
748
713
|
export const removePrivateView = (viewRef: number | React.Component | React.ComponentClass) => {
|
|
749
|
-
console.log('[LCQ-RN] Luciq.removePrivateView called', { viewRef });
|
|
750
714
|
const nativeTag = findNodeHandle(viewRef);
|
|
751
715
|
NativeLuciq.removePrivateView(nativeTag);
|
|
752
716
|
};
|
|
@@ -755,12 +719,10 @@ export const removePrivateView = (viewRef: number | React.Component | React.Comp
|
|
|
755
719
|
* Shows default Luciq prompt.
|
|
756
720
|
*/
|
|
757
721
|
export const show = () => {
|
|
758
|
-
console.log('[LCQ-RN] Luciq.show called');
|
|
759
722
|
NativeLuciq.show();
|
|
760
723
|
};
|
|
761
724
|
|
|
762
725
|
export const onReportSubmitHandler = (handler?: (report: Report) => void) => {
|
|
763
|
-
console.log('[LCQ-RN] Luciq.onReportSubmitHandler called');
|
|
764
726
|
emitter.addListener(NativeEvents.PRESENDING_HANDLER, (report) => {
|
|
765
727
|
const { tags, consoleLogs, luciqLogs, userAttributes, fileAttachments } = report;
|
|
766
728
|
const reportObj = new Report(tags, consoleLogs, luciqLogs, userAttributes, fileAttachments);
|
|
@@ -775,11 +737,6 @@ export const onNavigationStateChange = (
|
|
|
775
737
|
currentState: NavigationStateV4,
|
|
776
738
|
_action: NavigationAction,
|
|
777
739
|
) => {
|
|
778
|
-
console.log('[LCQ-RN] Luciq.onNavigationStateChange called', {
|
|
779
|
-
prevState,
|
|
780
|
-
currentState,
|
|
781
|
-
_action,
|
|
782
|
-
});
|
|
783
740
|
const currentScreen = LuciqUtils.getActiveRouteName(currentState);
|
|
784
741
|
const prevScreen = LuciqUtils.getActiveRouteName(prevState);
|
|
785
742
|
|
|
@@ -800,7 +757,6 @@ export const onNavigationStateChange = (
|
|
|
800
757
|
};
|
|
801
758
|
|
|
802
759
|
export const onStateChange = (state?: NavigationStateV5) => {
|
|
803
|
-
console.log('[LCQ-RN] Luciq.onStateChange called', { state });
|
|
804
760
|
if (!state) {
|
|
805
761
|
return;
|
|
806
762
|
}
|
|
@@ -829,14 +785,12 @@ export const onStateChange = (state?: NavigationStateV5) => {
|
|
|
829
785
|
export const setNavigationListener = (
|
|
830
786
|
navigationRef: NavigationContainerRefWithCurrent<ReactNavigation.RootParamList>,
|
|
831
787
|
) => {
|
|
832
|
-
console.log('[LCQ-RN] Luciq.setNavigationListener called', { navigationRef });
|
|
833
788
|
return navigationRef.addListener('state', () => {
|
|
834
789
|
onStateChange(navigationRef.getRootState());
|
|
835
790
|
});
|
|
836
791
|
};
|
|
837
792
|
|
|
838
793
|
export const reportScreenChange = (screenName: string) => {
|
|
839
|
-
console.log('[LCQ-RN] Luciq.reportScreenChange called', { screenName });
|
|
840
794
|
NativeLuciq.reportScreenChange(screenName);
|
|
841
795
|
};
|
|
842
796
|
|
|
@@ -845,7 +799,6 @@ export const reportScreenChange = (screenName: string) => {
|
|
|
845
799
|
* @param featureFlags An array of feature flags to add to the next report.
|
|
846
800
|
*/
|
|
847
801
|
export const addFeatureFlags = (featureFlags: FeatureFlag[]) => {
|
|
848
|
-
console.log('[LCQ-RN] Luciq.addFeatureFlags called', { featureFlags });
|
|
849
802
|
const entries = featureFlags.map((item) => [item.name, item.variant || '']);
|
|
850
803
|
const flags = Object.fromEntries(entries);
|
|
851
804
|
NativeLuciq.addFeatureFlags(flags);
|
|
@@ -855,7 +808,6 @@ export const addFeatureFlags = (featureFlags: FeatureFlag[]) => {
|
|
|
855
808
|
* Add a feature flag to the to next report.
|
|
856
809
|
*/
|
|
857
810
|
export const addFeatureFlag = (featureFlag: FeatureFlag) => {
|
|
858
|
-
console.log('[LCQ-RN] Luciq.addFeatureFlag called', { featureFlag });
|
|
859
811
|
addFeatureFlags([featureFlag]);
|
|
860
812
|
};
|
|
861
813
|
|
|
@@ -864,7 +816,6 @@ export const addFeatureFlag = (featureFlag: FeatureFlag) => {
|
|
|
864
816
|
* @param featureFlags An array of feature flags to remove from the next report.
|
|
865
817
|
*/
|
|
866
818
|
export const removeFeatureFlags = (featureFlags: string[]) => {
|
|
867
|
-
console.log('[LCQ-RN] Luciq.removeFeatureFlags called', { featureFlags });
|
|
868
819
|
NativeLuciq.removeFeatureFlags(featureFlags);
|
|
869
820
|
};
|
|
870
821
|
|
|
@@ -873,7 +824,6 @@ export const removeFeatureFlags = (featureFlags: string[]) => {
|
|
|
873
824
|
* @param name the name of the feature flag to remove from the next report.
|
|
874
825
|
*/
|
|
875
826
|
export const removeFeatureFlag = (name: string) => {
|
|
876
|
-
console.log('[LCQ-RN] Luciq.removeFeatureFlag called', { name });
|
|
877
827
|
removeFeatureFlags([name]);
|
|
878
828
|
};
|
|
879
829
|
|
|
@@ -881,7 +831,6 @@ export const removeFeatureFlag = (name: string) => {
|
|
|
881
831
|
* Clear all feature flags
|
|
882
832
|
*/
|
|
883
833
|
export const removeAllFeatureFlags = () => {
|
|
884
|
-
console.log('[LCQ-RN] Luciq.removeAllFeatureFlags called');
|
|
885
834
|
NativeLuciq.removeAllFeatureFlags();
|
|
886
835
|
};
|
|
887
836
|
|
|
@@ -889,7 +838,6 @@ export const removeAllFeatureFlags = () => {
|
|
|
889
838
|
* This API has to be call when using custom app rating prompt
|
|
890
839
|
*/
|
|
891
840
|
export const willRedirectToStore = () => {
|
|
892
|
-
console.log('[LCQ-RN] Luciq.willRedirectToStore called');
|
|
893
841
|
NativeLuciq.willRedirectToStore();
|
|
894
842
|
};
|
|
895
843
|
|
|
@@ -897,12 +845,10 @@ export const willRedirectToStore = () => {
|
|
|
897
845
|
* This API has be called when changing the default Metro server port (8081) to exclude the DEV URL from network logging.
|
|
898
846
|
*/
|
|
899
847
|
export const setMetroDevServerPort = (port: number) => {
|
|
900
|
-
console.log('[LCQ-RN] Luciq.setMetroDevServerPort called', { port });
|
|
901
848
|
LuciqRNConfig.metroDevServerPort = port.toString();
|
|
902
849
|
};
|
|
903
850
|
|
|
904
851
|
export const componentDidAppearListener = (event: ComponentDidAppearEvent) => {
|
|
905
|
-
console.log('[LCQ-RN] Luciq.componentDidAppearListener called', { event });
|
|
906
852
|
if (_isFirstScreen) {
|
|
907
853
|
_lastScreen = event.componentName;
|
|
908
854
|
_isFirstScreen = false;
|
|
@@ -926,7 +872,6 @@ export const _registerFeatureFlagsChangeListener = (
|
|
|
926
872
|
networkBodyLimit: number;
|
|
927
873
|
}) => void,
|
|
928
874
|
) => {
|
|
929
|
-
console.log('[LCQ-RN] Luciq._registerFeatureFlagsChangeListener called');
|
|
930
875
|
emitter.addListener(NativeEvents.ON_FEATURE_FLAGS_CHANGE, (payload) => {
|
|
931
876
|
handler(payload);
|
|
932
877
|
});
|
|
@@ -938,7 +883,6 @@ export const _registerFeatureFlagsChangeListener = (
|
|
|
938
883
|
* @param autoMaskingTypes The masking type to be applied.
|
|
939
884
|
*/
|
|
940
885
|
export const enableAutoMasking = (autoMaskingTypes: AutoMaskingType[]) => {
|
|
941
|
-
console.log('[LCQ-RN] Luciq.enableAutoMasking called', { autoMaskingTypes });
|
|
942
886
|
NativeLuciq.enableAutoMasking(autoMaskingTypes);
|
|
943
887
|
};
|
|
944
888
|
|
|
@@ -977,7 +921,6 @@ export const enableAutoMasking = (autoMaskingTypes: AutoMaskingType[]) => {
|
|
|
977
921
|
* ```
|
|
978
922
|
*/
|
|
979
923
|
export const setTheme = (theme: ThemeConfig) => {
|
|
980
|
-
console.log('[LCQ-RN] Luciq.setTheme called', { theme });
|
|
981
924
|
NativeLuciq.setTheme(theme);
|
|
982
925
|
};
|
|
983
926
|
/**
|
|
@@ -985,7 +928,6 @@ export const setTheme = (theme: ThemeConfig) => {
|
|
|
985
928
|
* @param isEnabled A boolean to enable/disable setFullscreen.
|
|
986
929
|
*/
|
|
987
930
|
export const setFullscreen = (isEnabled: boolean) => {
|
|
988
|
-
console.log('[LCQ-RN] Luciq.setFullscreen called', { isEnabled });
|
|
989
931
|
if (Platform.OS === 'android') {
|
|
990
932
|
NativeLuciq.setFullscreen(isEnabled);
|
|
991
933
|
}
|
|
@@ -40,7 +40,6 @@ function getPortFromUrl(url: string) {
|
|
|
40
40
|
* @param isEnabled
|
|
41
41
|
*/
|
|
42
42
|
export const setEnabled = (isEnabled: boolean) => {
|
|
43
|
-
console.log('[LCQ-RN] NetworkLogger.setEnabled called', { isEnabled });
|
|
44
43
|
if (isEnabled) {
|
|
45
44
|
xhr.enableInterception();
|
|
46
45
|
xhr.setOnDoneCallback(async (network) => {
|
|
@@ -116,24 +115,14 @@ export const setEnabled = (isEnabled: boolean) => {
|
|
|
116
115
|
* @param isEnabled
|
|
117
116
|
*/
|
|
118
117
|
export const setNativeInterceptionEnabled = (isEnabled: boolean) => {
|
|
119
|
-
console.log('[LCQ-RN] NetworkLogger.setNativeInterceptionEnabled called', { isEnabled });
|
|
120
118
|
_isNativeInterceptionEnabled = isEnabled;
|
|
121
119
|
};
|
|
122
120
|
|
|
123
|
-
export const getNetworkDataObfuscationHandler = () =>
|
|
124
|
-
console.log('[LCQ-RN] NetworkLogger.getNetworkDataObfuscationHandler called');
|
|
125
|
-
return _networkDataObfuscationHandler;
|
|
126
|
-
};
|
|
121
|
+
export const getNetworkDataObfuscationHandler = () => _networkDataObfuscationHandler;
|
|
127
122
|
|
|
128
|
-
export const getRequestFilterExpression = () =>
|
|
129
|
-
console.log('[LCQ-RN] NetworkLogger.getRequestFilterExpression called');
|
|
130
|
-
return _requestFilterExpression;
|
|
131
|
-
};
|
|
123
|
+
export const getRequestFilterExpression = () => _requestFilterExpression;
|
|
132
124
|
|
|
133
|
-
export const hasRequestFilterExpression = () =>
|
|
134
|
-
console.log('[LCQ-RN] NetworkLogger.hasRequestFilterExpression called');
|
|
135
|
-
return hasFilterExpression;
|
|
136
|
-
};
|
|
125
|
+
export const hasRequestFilterExpression = () => hasFilterExpression;
|
|
137
126
|
|
|
138
127
|
/**
|
|
139
128
|
* Obfuscates any response data.
|
|
@@ -142,7 +131,6 @@ export const hasRequestFilterExpression = () => {
|
|
|
142
131
|
export const setNetworkDataObfuscationHandler = (
|
|
143
132
|
handler?: NetworkDataObfuscationHandler | null | undefined,
|
|
144
133
|
) => {
|
|
145
|
-
console.log('[LCQ-RN] NetworkLogger.setNetworkDataObfuscationHandler called', { handler });
|
|
146
134
|
_networkDataObfuscationHandler = handler;
|
|
147
135
|
if (_isNativeInterceptionEnabled && Platform.OS === 'ios') {
|
|
148
136
|
if (hasFilterExpression) {
|
|
@@ -158,7 +146,6 @@ export const setNetworkDataObfuscationHandler = (
|
|
|
158
146
|
* @param expression
|
|
159
147
|
*/
|
|
160
148
|
export const setRequestFilterExpression = (expression: string) => {
|
|
161
|
-
console.log('[LCQ-RN] NetworkLogger.setRequestFilterExpression called', { expression });
|
|
162
149
|
_requestFilterExpression = expression;
|
|
163
150
|
hasFilterExpression = true;
|
|
164
151
|
|
|
@@ -176,12 +163,10 @@ export const setRequestFilterExpression = (expression: string) => {
|
|
|
176
163
|
* @param handler
|
|
177
164
|
*/
|
|
178
165
|
export const setProgressHandlerForRequest = (handler: ProgressCallback) => {
|
|
179
|
-
console.log('[LCQ-RN] NetworkLogger.setProgressHandlerForRequest called', { handler });
|
|
180
166
|
xhr.setOnProgressCallback(handler);
|
|
181
167
|
};
|
|
182
168
|
|
|
183
169
|
export const apolloLinkRequestHandler: RequestHandler = (operation, forward) => {
|
|
184
|
-
console.log('[LCQ-RN] NetworkLogger.apolloLinkRequestHandler called', { operation });
|
|
185
170
|
try {
|
|
186
171
|
operation.setContext((context: Record<string, any>) => {
|
|
187
172
|
const newHeaders: Record<string, any> = context.headers ?? {};
|
|
@@ -200,7 +185,6 @@ export const apolloLinkRequestHandler: RequestHandler = (operation, forward) =>
|
|
|
200
185
|
* @param isEnabled
|
|
201
186
|
*/
|
|
202
187
|
export const setNetworkLogBodyEnabled = (isEnabled: boolean) => {
|
|
203
|
-
console.log('[LCQ-RN] NetworkLogger.setNetworkLogBodyEnabled called', { isEnabled });
|
|
204
188
|
NativeLuciq.setNetworkLogBodyEnabled(isEnabled);
|
|
205
189
|
};
|
|
206
190
|
|
|
@@ -209,7 +193,6 @@ export const setNetworkLogBodyEnabled = (isEnabled: boolean) => {
|
|
|
209
193
|
* Exported for internal/testing purposes only.
|
|
210
194
|
*/
|
|
211
195
|
export const resetNetworkListener = () => {
|
|
212
|
-
console.log('[LCQ-RN] NetworkLogger.resetNetworkListener called');
|
|
213
196
|
if (process.env.NODE_ENV === 'test') {
|
|
214
197
|
_networkListener = null;
|
|
215
198
|
NativeNetworkLogger.resetNetworkLogsListener();
|
|
@@ -228,7 +211,6 @@ export const registerNetworkLogsListener = (
|
|
|
228
211
|
type: NetworkListenerType,
|
|
229
212
|
handler?: (networkSnapshot: NetworkData) => void,
|
|
230
213
|
) => {
|
|
231
|
-
console.log('[LCQ-RN] NetworkLogger.registerNetworkLogsListener called', { type, handler });
|
|
232
214
|
if (Platform.OS === 'ios') {
|
|
233
215
|
// remove old listeners
|
|
234
216
|
if (NetworkLoggerEmitter.listenerCount(NativeNetworkLoggerEvent.NETWORK_LOGGER_HANDLER) > 0) {
|
package/src/modules/Replies.ts
CHANGED
|
@@ -7,7 +7,6 @@ import { NativeEvents, NativeReplies, emitter } from '../native/NativeReplies';
|
|
|
7
7
|
* @param isEnabled
|
|
8
8
|
*/
|
|
9
9
|
export const setEnabled = (isEnabled: boolean) => {
|
|
10
|
-
console.log('[LCQ-RN] Replies.setEnabled called', { isEnabled });
|
|
11
10
|
NativeReplies.setEnabled(isEnabled);
|
|
12
11
|
};
|
|
13
12
|
|
|
@@ -15,7 +14,6 @@ export const setEnabled = (isEnabled: boolean) => {
|
|
|
15
14
|
* Tells whether the user has chats already or not.
|
|
16
15
|
*/
|
|
17
16
|
export const hasChats = async (): Promise<boolean> => {
|
|
18
|
-
console.log('[LCQ-RN] Replies.hasChats called');
|
|
19
17
|
const result = await NativeReplies.hasChats();
|
|
20
18
|
|
|
21
19
|
return result;
|
|
@@ -25,7 +23,6 @@ export const hasChats = async (): Promise<boolean> => {
|
|
|
25
23
|
* Manual invocation for replies.
|
|
26
24
|
*/
|
|
27
25
|
export const show = () => {
|
|
28
|
-
console.log('[LCQ-RN] Replies.show called');
|
|
29
26
|
NativeReplies.show();
|
|
30
27
|
};
|
|
31
28
|
|
|
@@ -34,7 +31,6 @@ export const show = () => {
|
|
|
34
31
|
* @param handler A callback that gets executed when a new message is received.
|
|
35
32
|
*/
|
|
36
33
|
export const setOnNewReplyReceivedHandler = (handler: () => void) => {
|
|
37
|
-
console.log('[LCQ-RN] Replies.setOnNewReplyReceivedHandler called');
|
|
38
34
|
emitter.addListener(NativeEvents.ON_REPLY_RECEIVED_HANDLER, handler);
|
|
39
35
|
NativeReplies.setOnNewReplyReceivedHandler(handler);
|
|
40
36
|
};
|
|
@@ -46,7 +42,6 @@ export const setOnNewReplyReceivedHandler = (handler: () => void) => {
|
|
|
46
42
|
* Notifications count, or -1 in case the SDK has not been initialized.
|
|
47
43
|
*/
|
|
48
44
|
export const getUnreadRepliesCount = async (): Promise<number> => {
|
|
49
|
-
console.log('[LCQ-RN] Replies.getUnreadRepliesCount called');
|
|
50
45
|
const count = await NativeReplies.getUnreadRepliesCount();
|
|
51
46
|
|
|
52
47
|
return count;
|
|
@@ -59,7 +54,6 @@ export const getUnreadRepliesCount = async (): Promise<number> => {
|
|
|
59
54
|
* notifications are enabled or disabled.
|
|
60
55
|
*/
|
|
61
56
|
export const setInAppNotificationsEnabled = (isEnabled: boolean) => {
|
|
62
|
-
console.log('[LCQ-RN] Replies.setInAppNotificationsEnabled called', { isEnabled });
|
|
63
57
|
NativeReplies.setInAppNotificationEnabled(isEnabled);
|
|
64
58
|
};
|
|
65
59
|
|
|
@@ -71,7 +65,6 @@ export const setInAppNotificationsEnabled = (isEnabled: boolean) => {
|
|
|
71
65
|
* @param isEnabled desired state of conversation sounds
|
|
72
66
|
*/
|
|
73
67
|
export const setInAppNotificationSound = (isEnabled: boolean) => {
|
|
74
|
-
console.log('[LCQ-RN] Replies.setInAppNotificationSound called', { isEnabled });
|
|
75
68
|
if (Platform.OS === 'android') {
|
|
76
69
|
NativeReplies.setInAppNotificationSound(isEnabled);
|
|
77
70
|
}
|
|
@@ -83,7 +76,6 @@ export const setInAppNotificationSound = (isEnabled: boolean) => {
|
|
|
83
76
|
* @param isEnabled A boolean to indicate whether push notifications are enabled or disabled.
|
|
84
77
|
*/
|
|
85
78
|
export const setPushNotificationsEnabled = (isEnabled: boolean) => {
|
|
86
|
-
console.log('[LCQ-RN] Replies.setPushNotificationsEnabled called', { isEnabled });
|
|
87
79
|
NativeReplies.setPushNotificationsEnabled(isEnabled);
|
|
88
80
|
};
|
|
89
81
|
|
|
@@ -93,7 +85,6 @@ export const setPushNotificationsEnabled = (isEnabled: boolean) => {
|
|
|
93
85
|
* @param token the GCM registration token
|
|
94
86
|
*/
|
|
95
87
|
export const setPushNotificationRegistrationTokenAndroid = (token: string) => {
|
|
96
|
-
console.log('[LCQ-RN] Replies.setPushNotificationRegistrationTokenAndroid called', { token });
|
|
97
88
|
if (Platform.OS === 'android') {
|
|
98
89
|
NativeReplies.setPushNotificationRegistrationToken(token);
|
|
99
90
|
}
|
|
@@ -105,7 +96,6 @@ export const setPushNotificationRegistrationTokenAndroid = (token: string) => {
|
|
|
105
96
|
* @param data the data bundle related to Luciq
|
|
106
97
|
*/
|
|
107
98
|
export const showNotificationAndroid = (data: Record<string, string>) => {
|
|
108
|
-
console.log('[LCQ-RN] Replies.showNotificationAndroid called', { data });
|
|
109
99
|
if (Platform.OS === 'android') {
|
|
110
100
|
NativeReplies.showNotification(data);
|
|
111
101
|
}
|
|
@@ -117,7 +107,6 @@ export const showNotificationAndroid = (data: Record<string, string>) => {
|
|
|
117
107
|
* @param resourceId the notification icon resource ID
|
|
118
108
|
*/
|
|
119
109
|
export const setNotificationIconAndroid = (resourceId: number) => {
|
|
120
|
-
console.log('[LCQ-RN] Replies.setNotificationIconAndroid called', { resourceId });
|
|
121
110
|
if (Platform.OS === 'android') {
|
|
122
111
|
NativeReplies.setNotificationIcon(resourceId);
|
|
123
112
|
}
|
|
@@ -130,7 +119,6 @@ export const setNotificationIconAndroid = (resourceId: number) => {
|
|
|
130
119
|
* @param id an id to a notification channel that notifications
|
|
131
120
|
*/
|
|
132
121
|
export const setPushNotificationChannelIdAndroid = (id: string) => {
|
|
133
|
-
console.log('[LCQ-RN] Replies.setPushNotificationChannelIdAndroid called', { id });
|
|
134
122
|
if (Platform.OS === 'android') {
|
|
135
123
|
NativeReplies.setPushNotificationChannelId(id);
|
|
136
124
|
}
|
|
@@ -143,9 +131,6 @@ export const setPushNotificationChannelIdAndroid = (id: string) => {
|
|
|
143
131
|
* @param isEnabled desired state of conversation sounds
|
|
144
132
|
*/
|
|
145
133
|
export const setSystemReplyNotificationSoundEnabledAndroid = (isEnabled: boolean) => {
|
|
146
|
-
console.log('[LCQ-RN] Replies.setSystemReplyNotificationSoundEnabledAndroid called', {
|
|
147
|
-
isEnabled,
|
|
148
|
-
});
|
|
149
134
|
if (Platform.OS === 'android') {
|
|
150
135
|
NativeReplies.setSystemReplyNotificationSoundEnabled(isEnabled);
|
|
151
136
|
}
|