clevertap-react-native 3.0.0 → 3.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +29 -0
- package/android/build.gradle +3 -3
- package/android/gradle/wrapper/gradle-wrapper.properties +3 -3
- package/android/gradlew +0 -0
- package/android/src/main/java/com/clevertap/react/CleverTapCustomTemplates.kt +66 -0
- package/android/src/main/java/com/clevertap/react/CleverTapEvent.kt +9 -2
- package/android/src/main/java/com/clevertap/react/CleverTapModuleImpl.java +180 -0
- package/android/src/main/java/com/clevertap/react/CleverTapUtils.java +5 -7
- package/android/src/newarch/CleverTapModule.kt +92 -0
- package/android/src/oldarch/CleverTapModule.kt +108 -2
- package/clevertap-react-native.podspec +1 -1
- package/docs/CustomCodeTemplates.md +215 -0
- package/docs/Variables.md +55 -0
- package/docs/integration.md +42 -46
- package/ios/CleverTapReact/CleverTapReact.h +8 -1
- package/ios/CleverTapReact/CleverTapReact.mm +208 -23
- package/ios/CleverTapReact/CleverTapReactAppFunctionPresenter.h +20 -0
- package/ios/CleverTapReact/CleverTapReactAppFunctionPresenter.mm +21 -0
- package/ios/CleverTapReact/CleverTapReactCustomTemplates.h +42 -0
- package/ios/CleverTapReact/CleverTapReactCustomTemplates.mm +51 -0
- package/ios/CleverTapReact/CleverTapReactManager.h +0 -1
- package/ios/CleverTapReact/CleverTapReactManager.mm +0 -17
- package/ios/CleverTapReact/CleverTapReactTemplatePresenter.h +22 -0
- package/ios/CleverTapReact/CleverTapReactTemplatePresenter.mm +21 -0
- package/ios/CleverTapReact.xcodeproj/project.pbxproj +24 -0
- package/package.json +3 -3
- package/src/NativeCleverTapModule.ts +24 -1
- package/src/index.d.ts +150 -10
- package/src/index.js +187 -3
- package/android/.gradle/8.2/checksums/checksums.lock +0 -0
- package/android/.gradle/8.2/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/8.2/checksums/sha1-checksums.bin +0 -0
- package/android/.gradle/8.2/dependencies-accessors/dependencies-accessors.lock +0 -0
- package/android/.gradle/8.2/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/8.2/executionHistory/executionHistory.bin +0 -0
- package/android/.gradle/8.2/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/8.2/fileChanges/last-build.bin +0 -0
- package/android/.gradle/8.2/fileHashes/fileHashes.bin +0 -0
- package/android/.gradle/8.2/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/8.2/fileHashes/resourceHashesCache.bin +0 -0
- package/android/.gradle/8.2/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +0 -2
- package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
- package/android/.gradle/checksums/checksums.lock +0 -0
- package/android/.gradle/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/checksums/sha1-checksums.bin +0 -0
- package/android/.gradle/config.properties +0 -2
- package/android/.gradle/file-system.probe +0 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/.settings/org.eclipse.buildship.core.prefs +0 -2
- package/android/local.properties +0 -8
|
@@ -7,12 +7,15 @@ export interface Spec extends TurboModule {
|
|
|
7
7
|
CleverTapProfileSync: string;
|
|
8
8
|
CleverTapInAppNotificationDismissed: string;
|
|
9
9
|
CleverTapInAppNotificationShowed: string;
|
|
10
|
+
CleverTapInAppNotificationButtonTapped: string;
|
|
11
|
+
CleverTapCustomTemplatePresent: string;
|
|
12
|
+
CleverTapCustomTemplateClose: string;
|
|
13
|
+
CleverTapCustomFunctionPresent: string;
|
|
10
14
|
CleverTapInboxDidInitialize: string;
|
|
11
15
|
CleverTapInboxMessagesDidUpdate: string;
|
|
12
16
|
CleverTapInboxMessageButtonTapped: string;
|
|
13
17
|
CleverTapInboxMessageTapped: string;
|
|
14
18
|
CleverTapDisplayUnitsLoaded: string;
|
|
15
|
-
CleverTapInAppNotificationButtonTapped: string;
|
|
16
19
|
CleverTapFeatureFlagsDidUpdate: string;
|
|
17
20
|
CleverTapProductConfigDidInitialize: string;
|
|
18
21
|
CleverTapProductConfigDidFetch: string;
|
|
@@ -20,7 +23,11 @@ export interface Spec extends TurboModule {
|
|
|
20
23
|
CleverTapPushNotificationClicked: string;
|
|
21
24
|
CleverTapPushPermissionResponseReceived: string;
|
|
22
25
|
CleverTapOnVariablesChanged: string;
|
|
26
|
+
CleverTapOnOneTimeVariablesChanged: string;
|
|
23
27
|
CleverTapOnValueChanged: string;
|
|
28
|
+
CleverTapOnVariablesChangedAndNoDownloadsPending: string;
|
|
29
|
+
CleverTapOnceVariablesChangedAndNoDownloadsPending: string;
|
|
30
|
+
CleverTapOnFileValueChanged: string;
|
|
24
31
|
HPS: string;
|
|
25
32
|
FCM: string;
|
|
26
33
|
BPS: string;
|
|
@@ -191,6 +198,17 @@ export interface Spec extends TurboModule {
|
|
|
191
198
|
resumeInAppNotifications(): void;
|
|
192
199
|
fetchInApps(callback: ((error: Object, result: boolean) => void) | null): void;
|
|
193
200
|
clearInAppResources(expiredOnly: boolean): void;
|
|
201
|
+
customTemplateSetDismissed(templateName: string): Promise<void>;
|
|
202
|
+
customTemplateSetPresented(templateName: string): Promise<void>;
|
|
203
|
+
customTemplateRunAction(templateName: string, argName: string): Promise<void>;
|
|
204
|
+
customTemplateGetStringArg(templateName: string, argName: string): Promise<string>;
|
|
205
|
+
customTemplateGetNumberArg(templateName: string, argName: string): Promise<number>;
|
|
206
|
+
customTemplateGetBooleanArg(templateName: string, argName: string): Promise<boolean>;
|
|
207
|
+
customTemplateGetFileArg(templateName: string, argName: string): Promise<string>;
|
|
208
|
+
customTemplateGetObjectArg(templateName: string, argName: string): Promise<any>;
|
|
209
|
+
customTemplateContextToString(templateName: string): Promise<string>;
|
|
210
|
+
syncCustomTemplates(): void;
|
|
211
|
+
syncCustomTemplatesInProd(isProduction: boolean): void;
|
|
194
212
|
promptForPushPermission(showFallbackSettings: boolean): void;
|
|
195
213
|
promptPushPrimer(json: Object): void;
|
|
196
214
|
isPushPermissionGranted(callback: ((error: Object, result: boolean) => void) | null): void;
|
|
@@ -205,8 +223,13 @@ export interface Spec extends TurboModule {
|
|
|
205
223
|
defineVariables(
|
|
206
224
|
variables: Object | null
|
|
207
225
|
): void;
|
|
226
|
+
defineFileVariable(name: string): void;
|
|
208
227
|
onVariablesChanged(): void;
|
|
228
|
+
onOneTimeVariablesChanged(): void;
|
|
209
229
|
onValueChanged(name: string): void;
|
|
230
|
+
onVariablesChangedAndNoDownloadsPending(): void;
|
|
231
|
+
onceVariablesChangedAndNoDownloadsPending(): void;
|
|
232
|
+
onFileValueChanged(name: string): void;
|
|
210
233
|
|
|
211
234
|
onEventListenerAdded(eventType: string): void;
|
|
212
235
|
// NativeEventEmitter methods for the New Architecture.
|
package/src/index.d.ts
CHANGED
|
@@ -4,9 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Add a CleverTap event listener
|
|
7
|
-
* supported events are CleverTap.CleverTapProfileDidInitialize, CleverTap.CleverTapProfileSync and CleverTap.CleverTapInAppNotificationDismissed
|
|
8
7
|
* @param {string} eventName - the CleverTap event name
|
|
9
|
-
* @param {function(event)}
|
|
8
|
+
* @param {function(event)} handler - Event handler
|
|
10
9
|
*/
|
|
11
10
|
export function addListener(
|
|
12
11
|
eventName: string,
|
|
@@ -685,6 +684,20 @@ export function isPushPermissionGranted(callback: CallbackString): void;
|
|
|
685
684
|
*/
|
|
686
685
|
export function resumeInAppNotifications(): void;
|
|
687
686
|
|
|
687
|
+
/**
|
|
688
|
+
* Fetches In Apps from server.
|
|
689
|
+
*
|
|
690
|
+
* @param {function(err, res)} callback a callback with a boolean flag whether the fetching was successful
|
|
691
|
+
*/
|
|
692
|
+
export function fetchInApps(callback: Callback): void;
|
|
693
|
+
|
|
694
|
+
/**
|
|
695
|
+
* Deletes all images and gifs which are preloaded for inapps in cs mode
|
|
696
|
+
*
|
|
697
|
+
* @param {boolean} expiredOnly to clear only assets which will not be needed further for inapps
|
|
698
|
+
*/
|
|
699
|
+
export function clearInAppResources(expiredOnly: boolean): void;
|
|
700
|
+
|
|
688
701
|
/*******************
|
|
689
702
|
* Instances
|
|
690
703
|
******************/
|
|
@@ -727,6 +740,13 @@ export function isPushPermissionGranted(callback: CallbackString): void;
|
|
|
727
740
|
*/
|
|
728
741
|
export function defineVariables(variables: object): void;
|
|
729
742
|
|
|
743
|
+
/**
|
|
744
|
+
* Create File variables.
|
|
745
|
+
*
|
|
746
|
+
* @param {string} fileVariable - the file variable string.
|
|
747
|
+
*/
|
|
748
|
+
export function defineFileVariable(fileVariable: string): void;
|
|
749
|
+
|
|
730
750
|
/**
|
|
731
751
|
* Get all variables via a JSON object.
|
|
732
752
|
*
|
|
@@ -747,6 +767,13 @@ export function isPushPermissionGranted(callback: CallbackString): void;
|
|
|
747
767
|
*/
|
|
748
768
|
export function onVariablesChanged(handler: Function): void;
|
|
749
769
|
|
|
770
|
+
/**
|
|
771
|
+
* Adds a callback to be invoked only once on app start, or when added if server values are already received
|
|
772
|
+
*
|
|
773
|
+
* @param {function} handler The callback to add
|
|
774
|
+
*/
|
|
775
|
+
export function onOneTimeVariablesChanged(handler: Function): void;
|
|
776
|
+
|
|
750
777
|
/**
|
|
751
778
|
* Called when the value of the variable changes.
|
|
752
779
|
*
|
|
@@ -755,20 +782,126 @@ export function isPushPermissionGranted(callback: CallbackString): void;
|
|
|
755
782
|
*/
|
|
756
783
|
export function onValueChanged(name: string, handler: Function): void;
|
|
757
784
|
|
|
785
|
+
/**
|
|
786
|
+
* Adds a callback to be invoked when no files need to be downloaded or all downloads have been completed. It is called each time new values are fetched and downloads are completed. *
|
|
787
|
+
*
|
|
788
|
+
* @param {function} handler The callback to add
|
|
789
|
+
*/
|
|
790
|
+
export function onVariablesChangedAndNoDownloadsPending(handler: Function): void;
|
|
758
791
|
|
|
759
792
|
/**
|
|
760
|
-
|
|
793
|
+
* Adds a callback to be invoked only once for when new values are fetched and downloaded
|
|
794
|
+
*
|
|
795
|
+
* @param {function} handler The callback to add
|
|
796
|
+
*/
|
|
797
|
+
export function onceVariablesChangedAndNoDownloadsPending(handler: Function): void;
|
|
798
|
+
|
|
799
|
+
/**
|
|
800
|
+
* Called when the value of the file variable is downloaded and ready. This is only available for File variables.
|
|
801
|
+
*
|
|
802
|
+
* @param {name} string the name of the file variable
|
|
803
|
+
* @param {function} handler The callback to add
|
|
804
|
+
*/
|
|
805
|
+
export function onFileValueChanged(name: string, handler: Function): void;
|
|
806
|
+
|
|
807
|
+
/**
|
|
808
|
+
/*******************
|
|
809
|
+
* Custom Templates
|
|
810
|
+
******************/
|
|
811
|
+
|
|
812
|
+
/**
|
|
813
|
+
* Uploads Custom in-app templates and app functions to the server.
|
|
814
|
+
* Requires Development/Debug build/configuration.
|
|
815
|
+
*/
|
|
816
|
+
export function syncCustomTemplates(): void;
|
|
817
|
+
|
|
818
|
+
/**
|
|
819
|
+
* Uploads Custom in-app templates and app functions to the server.
|
|
820
|
+
*
|
|
821
|
+
* @param isProduction Provide `true` if templates must be sync in Productuon build/configuration.
|
|
822
|
+
*/
|
|
823
|
+
export function syncCustomTemplatesInProd(isProduction: boolean): void;
|
|
824
|
+
|
|
825
|
+
/**
|
|
826
|
+
* Notify the SDK that an active custom template is dismissed. The active custom template is considered to be
|
|
827
|
+
* visible to the user until this method is called. Since the SDK can show only one InApp message at a time, all
|
|
828
|
+
* other messages will be queued until the current one is dismissed.
|
|
829
|
+
*
|
|
830
|
+
* @param templateName The name of the active template
|
|
831
|
+
*/
|
|
832
|
+
export function customTemplateSetDismissed(templateName: string): Promise<void>;
|
|
833
|
+
|
|
834
|
+
/**
|
|
835
|
+
* Notify the SDK that an active custom template is presented to the user
|
|
836
|
+
*
|
|
837
|
+
* @param templateName The name of the active template
|
|
838
|
+
*/
|
|
839
|
+
export function customTemplateSetPresented(templateName: string): Promise<void>;
|
|
840
|
+
|
|
841
|
+
/**
|
|
842
|
+
* Trigger a custom template action argument by name.
|
|
843
|
+
*
|
|
844
|
+
* @param templateName The name of an active template for which the action is defined
|
|
845
|
+
* @param argName The action argument name
|
|
846
|
+
*/
|
|
847
|
+
export function customTemplateRunAction(templateName: string, argName: string): Promise<void>;
|
|
848
|
+
|
|
849
|
+
/**
|
|
850
|
+
* Retrieve a string argument by name.
|
|
761
851
|
*
|
|
762
|
-
* @param
|
|
852
|
+
* @param templateName The name of an active template for which the argument is defined
|
|
853
|
+
* @param argName The action argument name
|
|
854
|
+
*
|
|
855
|
+
* @returns The argument value or null if no such argument is defined for the template.
|
|
763
856
|
*/
|
|
764
|
-
export function
|
|
857
|
+
export function customTemplateGetStringArg(templateName: string, argName: string): Promise<string>;
|
|
765
858
|
|
|
766
859
|
/**
|
|
767
|
-
*
|
|
860
|
+
* Retrieve a number argument by name.
|
|
768
861
|
*
|
|
769
|
-
* @param
|
|
862
|
+
* @param templateName The name of an active template for which the argument is defined
|
|
863
|
+
* @param argName The action argument name
|
|
864
|
+
*
|
|
865
|
+
* @returns The argument value or null if no such argument is defined for the template.
|
|
770
866
|
*/
|
|
771
|
-
export function
|
|
867
|
+
export function customTemplateGetNumberArg(templateName: string, argName: string): Promise<number>;
|
|
868
|
+
|
|
869
|
+
/**
|
|
870
|
+
* Retrieve a boolean argument by name.
|
|
871
|
+
*
|
|
872
|
+
* @param templateName The name of an active template for which the argument is defined
|
|
873
|
+
* @param argName The action argument name
|
|
874
|
+
*
|
|
875
|
+
* @returns The argument value or null if no such argument is defined for the template.
|
|
876
|
+
*/
|
|
877
|
+
export function customTemplateGetBooleanArg(templateName: string, argName: string): Promise<boolean>;
|
|
878
|
+
|
|
879
|
+
/**
|
|
880
|
+
* Retrieve a file argument by name.
|
|
881
|
+
*
|
|
882
|
+
* @param templateName The name of an active template for which the argument is defined
|
|
883
|
+
* @param argName The action argument name
|
|
884
|
+
*
|
|
885
|
+
* @returns The file path to the file or null if no such argument is defined for the template.
|
|
886
|
+
*/
|
|
887
|
+
export function customTemplateGetFileArg(templateName: string, argName: string): Promise<string>;
|
|
888
|
+
|
|
889
|
+
/**
|
|
890
|
+
* Retrieve an object argument by name.
|
|
891
|
+
*
|
|
892
|
+
* @param templateName The name of an active template for which the argument is defined
|
|
893
|
+
* @param argName The action argument name
|
|
894
|
+
*
|
|
895
|
+
* @returns The argument value or null if no such argument is defined for the template.
|
|
896
|
+
*/
|
|
897
|
+
export function customTemplateGetObjectArg(templateName: string, argName: string): Promise<any>;
|
|
898
|
+
|
|
899
|
+
/**
|
|
900
|
+
* Get a string representation of an active's template context with information about all arguments.
|
|
901
|
+
*
|
|
902
|
+
* @param templateName The name of an active template
|
|
903
|
+
*/
|
|
904
|
+
export function customTemplateContextToString(templateName: string): Promise<string>;
|
|
772
905
|
|
|
773
906
|
/*******************
|
|
774
907
|
* Developer Options
|
|
@@ -789,12 +922,15 @@ export function isPushPermissionGranted(callback: CallbackString): void;
|
|
|
789
922
|
export const CleverTapProfileSync: string;
|
|
790
923
|
export const CleverTapInAppNotificationDismissed: string;
|
|
791
924
|
export const CleverTapInAppNotificationShowed: string;
|
|
925
|
+
export const CleverTapInAppNotificationButtonTapped: string;
|
|
926
|
+
export const CleverTapCustomTemplatePresent: string;
|
|
927
|
+
export const CleverTapCustomTemplateClose: string;
|
|
928
|
+
export const CleverTapCustomFunctionPresent: string;
|
|
792
929
|
export const CleverTapInboxDidInitialize: string;
|
|
793
930
|
export const CleverTapInboxMessagesDidUpdate: string;
|
|
794
931
|
export const CleverTapInboxMessageButtonTapped: string;
|
|
795
932
|
export const CleverTapInboxMessageTapped: string;
|
|
796
933
|
export const CleverTapDisplayUnitsLoaded: string;
|
|
797
|
-
export const CleverTapInAppNotificationButtonTapped: string;
|
|
798
934
|
export const CleverTapFeatureFlagsDidUpdate: string;
|
|
799
935
|
export const CleverTapProductConfigDidInitialize: string;
|
|
800
936
|
export const CleverTapProductConfigDidFetch: string;
|
|
@@ -802,4 +938,8 @@ export function isPushPermissionGranted(callback: CallbackString): void;
|
|
|
802
938
|
export const CleverTapPushNotificationClicked: string;
|
|
803
939
|
export const CleverTapPushPermissionResponseReceived: string;
|
|
804
940
|
export const CleverTapOnVariablesChanged: string;
|
|
805
|
-
export const
|
|
941
|
+
export const CleverTapOnOneTimeVariablesChanged: string;
|
|
942
|
+
export const CleverTapOnValueChanged: string;
|
|
943
|
+
export const CleverTapOnVariablesChangedAndNoDownloadsPending: string;
|
|
944
|
+
export const CleverTapOnceVariablesChangedAndNoDownloadsPending: string;
|
|
945
|
+
export const CleverTapOnFileValueChanged: string;
|
package/src/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { DeviceEventEmitter, NativeEventEmitter, NativeModules } from 'react-native';
|
|
1
|
+
import { DeviceEventEmitter, NativeEventEmitter, NativeModules, Platform } from 'react-native';
|
|
2
|
+
|
|
2
3
|
const CleverTapReact = require('./NativeCleverTapModule').default;
|
|
3
4
|
const EventEmitter = Platform.select({
|
|
4
5
|
ios: new NativeEventEmitter(CleverTapReact),
|
|
@@ -11,7 +12,7 @@ const EventEmitter = Platform.select({
|
|
|
11
12
|
* @param {int} libVersion - The updated library version. If current version is 1.1.0 then pass as 10100
|
|
12
13
|
*/
|
|
13
14
|
const libName = 'React-Native';
|
|
14
|
-
const libVersion =
|
|
15
|
+
const libVersion = 30101;
|
|
15
16
|
CleverTapReact.setLibrary(libName,libVersion);
|
|
16
17
|
|
|
17
18
|
function defaultCallback(method, err, res) {
|
|
@@ -49,6 +50,10 @@ var CleverTap = {
|
|
|
49
50
|
CleverTapProfileSync: CleverTapReact.getConstants().CleverTapProfileSync,
|
|
50
51
|
CleverTapInAppNotificationDismissed: CleverTapReact.getConstants().CleverTapInAppNotificationDismissed,
|
|
51
52
|
CleverTapInAppNotificationShowed: CleverTapReact.getConstants().CleverTapInAppNotificationShowed,
|
|
53
|
+
CleverTapInAppNotificationButtonTapped: CleverTapReact.getConstants().CleverTapInAppNotificationButtonTapped,
|
|
54
|
+
CleverTapCustomTemplatePresent: CleverTapReact.getConstants().CleverTapCustomTemplatePresent,
|
|
55
|
+
CleverTapCustomFunctionPresent: CleverTapReact.getConstants().CleverTapCustomFunctionPresent,
|
|
56
|
+
CleverTapCustomTemplateClose: CleverTapReact.getConstants().CleverTapCustomTemplateClose,
|
|
52
57
|
FCM: CleverTapReact.getConstants().FCM,
|
|
53
58
|
BPS: CleverTapReact.getConstants().BPS,
|
|
54
59
|
HPS: CleverTapReact.getConstants().HPS,
|
|
@@ -57,7 +62,6 @@ var CleverTap = {
|
|
|
57
62
|
CleverTapInboxMessageButtonTapped: CleverTapReact.getConstants().CleverTapInboxMessageButtonTapped,
|
|
58
63
|
CleverTapInboxMessageTapped: CleverTapReact.getConstants().CleverTapInboxMessageTapped,
|
|
59
64
|
CleverTapDisplayUnitsLoaded: CleverTapReact.getConstants().CleverTapDisplayUnitsLoaded,
|
|
60
|
-
CleverTapInAppNotificationButtonTapped: CleverTapReact.getConstants().CleverTapInAppNotificationButtonTapped,
|
|
61
65
|
CleverTapFeatureFlagsDidUpdate: CleverTapReact.getConstants().CleverTapFeatureFlagsDidUpdate, // @deprecated - Since version 1.1.0 and will be removed in the future versions of this SDK.
|
|
62
66
|
CleverTapProductConfigDidInitialize: CleverTapReact.getConstants().CleverTapProductConfigDidInitialize, // @deprecated - Since version 1.1.0 and will be removed in the future versions of this SDK.
|
|
63
67
|
CleverTapProductConfigDidFetch: CleverTapReact.getConstants().CleverTapProductConfigDidFetch, // @deprecated - Since version 1.1.0 and will be removed in the future versions of this SDK.
|
|
@@ -65,7 +69,11 @@ var CleverTap = {
|
|
|
65
69
|
CleverTapPushNotificationClicked: CleverTapReact.getConstants().CleverTapPushNotificationClicked,
|
|
66
70
|
CleverTapPushPermissionResponseReceived: CleverTapReact.getConstants().CleverTapPushPermissionResponseReceived,
|
|
67
71
|
CleverTapOnVariablesChanged: CleverTapReact.getConstants().CleverTapOnVariablesChanged,
|
|
72
|
+
CleverTapOnOneTimeVariablesChanged: CleverTapReact.getConstants().CleverTapOnOneTimeVariablesChanged,
|
|
68
73
|
CleverTapOnValueChanged: CleverTapReact.getConstants().CleverTapOnValueChanged,
|
|
74
|
+
CleverTapOnVariablesChangedAndNoDownloadsPending: CleverTapReact.getConstants().CleverTapOnVariablesChangedAndNoDownloadsPending,
|
|
75
|
+
CleverTapOnceVariablesChangedAndNoDownloadsPending: CleverTapReact.getConstants().CleverTapOnceVariablesChangedAndNoDownloadsPending,
|
|
76
|
+
CleverTapOnFileValueChanged: CleverTapReact.getConstants().CleverTapOnFileValueChanged,
|
|
69
77
|
|
|
70
78
|
/**
|
|
71
79
|
* Add a CleverTap event listener
|
|
@@ -80,6 +88,16 @@ var CleverTap = {
|
|
|
80
88
|
CleverTapReact.onEventListenerAdded(eventName);
|
|
81
89
|
}
|
|
82
90
|
},
|
|
91
|
+
addOneTimeListener: function (eventName, handler) {
|
|
92
|
+
if (EventEmitter) {
|
|
93
|
+
const subscription = EventEmitter.addListener(eventName, (args) =>
|
|
94
|
+
{
|
|
95
|
+
handler(args);
|
|
96
|
+
subscription.remove();
|
|
97
|
+
});
|
|
98
|
+
CleverTapReact.onEventListenerAdded(eventName);
|
|
99
|
+
}
|
|
100
|
+
},
|
|
83
101
|
|
|
84
102
|
/**
|
|
85
103
|
* Removes all of the registered listeners for given eventName.
|
|
@@ -908,6 +926,14 @@ var CleverTap = {
|
|
|
908
926
|
CleverTapReact.defineVariables(variables);
|
|
909
927
|
},
|
|
910
928
|
|
|
929
|
+
/**
|
|
930
|
+
* Create File Variable
|
|
931
|
+
* @param {string} fileVariable - the file variable string
|
|
932
|
+
*/
|
|
933
|
+
defineFileVariable: function (fileVariable) {
|
|
934
|
+
CleverTapReact.defineFileVariable(fileVariable)
|
|
935
|
+
},
|
|
936
|
+
|
|
911
937
|
/**
|
|
912
938
|
* Get a variable or a group for the specified name.
|
|
913
939
|
*
|
|
@@ -935,6 +961,16 @@ var CleverTap = {
|
|
|
935
961
|
this.addListener(CleverTapReact.getConstants().CleverTapOnVariablesChanged, handler);
|
|
936
962
|
},
|
|
937
963
|
|
|
964
|
+
/**
|
|
965
|
+
* Adds a callback to be invoked only once on app start, or when added if server values are already received
|
|
966
|
+
*
|
|
967
|
+
* @param {function} handler The callback to add
|
|
968
|
+
*/
|
|
969
|
+
onOneTimeVariablesChanged: function (handler) {
|
|
970
|
+
this.addOneTimeListener(CleverTapReact.getConstants().CleverTapOnOneTimeVariablesChanged, handler);
|
|
971
|
+
CleverTapReact.onOneTimeVariablesChanged();
|
|
972
|
+
},
|
|
973
|
+
|
|
938
974
|
/**
|
|
939
975
|
* Called when the value of the variable changes.
|
|
940
976
|
*
|
|
@@ -946,6 +982,37 @@ var CleverTap = {
|
|
|
946
982
|
this.addListener(CleverTapReact.getConstants().CleverTapOnValueChanged, handler);
|
|
947
983
|
},
|
|
948
984
|
|
|
985
|
+
/**
|
|
986
|
+
* Adds a callback to be invoked when variables are initialised with server values. Will be called each time new values are fetched.
|
|
987
|
+
*
|
|
988
|
+
* @param {function} handler The callback to add
|
|
989
|
+
*/
|
|
990
|
+
onVariablesChangedAndNoDownloadsPending: function (handler) {
|
|
991
|
+
this.addListener(CleverTapReact.getConstants().CleverTapOnVariablesChangedAndNoDownloadsPending, handler);
|
|
992
|
+
CleverTapReact.onVariablesChangedAndNoDownloadsPending();
|
|
993
|
+
},
|
|
994
|
+
|
|
995
|
+
/**
|
|
996
|
+
* Adds a callback to be invoked only once for when new values are fetched and downloaded
|
|
997
|
+
*
|
|
998
|
+
* @param {function} handler The callback to add
|
|
999
|
+
*/
|
|
1000
|
+
onceVariablesChangedAndNoDownloadsPending: function (handler) {
|
|
1001
|
+
this.addOneTimeListener(CleverTapReact.getConstants().CleverTapOnceVariablesChangedAndNoDownloadsPending, handler);
|
|
1002
|
+
CleverTapReact.onceVariablesChangedAndNoDownloadsPending();
|
|
1003
|
+
},
|
|
1004
|
+
|
|
1005
|
+
/**
|
|
1006
|
+
* Called when the value of the file variable is downloaded and ready.
|
|
1007
|
+
*
|
|
1008
|
+
* @param {name} string the name of the file variable
|
|
1009
|
+
* @param {function} handler The callback to add
|
|
1010
|
+
*/
|
|
1011
|
+
onFileValueChanged: function (name, handler) {
|
|
1012
|
+
this.addListener(CleverTapReact.getConstants().CleverTapOnFileValueChanged, handler);
|
|
1013
|
+
CleverTapReact.onFileValueChanged(name);
|
|
1014
|
+
},
|
|
1015
|
+
|
|
949
1016
|
/**
|
|
950
1017
|
* Fetches In Apps from server.
|
|
951
1018
|
*
|
|
@@ -962,6 +1029,123 @@ var CleverTap = {
|
|
|
962
1029
|
*/
|
|
963
1030
|
clearInAppResources: function (expiredOnly) {
|
|
964
1031
|
CleverTapReact.clearInAppResources(expiredOnly);
|
|
1032
|
+
},
|
|
1033
|
+
|
|
1034
|
+
/**
|
|
1035
|
+
* Uploads Custom in-app templates and app functions to the server.
|
|
1036
|
+
* Requires Development/Debug build/configuration.
|
|
1037
|
+
*/
|
|
1038
|
+
syncCustomTemplates: function () {
|
|
1039
|
+
CleverTapReact.syncCustomTemplates();
|
|
1040
|
+
},
|
|
1041
|
+
|
|
1042
|
+
/**
|
|
1043
|
+
* Uploads Custom in-app templates and app functions to the server.
|
|
1044
|
+
*
|
|
1045
|
+
* @param {boolean} isProduction Provide `true` if templates must be sync in Productuon build/configuration.
|
|
1046
|
+
*/
|
|
1047
|
+
syncCustomTemplatesInProd: function (isProduction) {
|
|
1048
|
+
CleverTapReact.syncCustomTemplatesInProd(isProduction)
|
|
1049
|
+
},
|
|
1050
|
+
|
|
1051
|
+
/**
|
|
1052
|
+
* Notify the SDK that an active custom template is dismissed. The active custom template is considered to be
|
|
1053
|
+
* visible to the user until this method is called. Since the SDK can show only one InApp message at a time, all
|
|
1054
|
+
* other messages will be queued until the current one is dismissed.
|
|
1055
|
+
*
|
|
1056
|
+
* @param {string} templateName The name of the active template
|
|
1057
|
+
*/
|
|
1058
|
+
customTemplateSetDismissed: function (templateName) {
|
|
1059
|
+
return CleverTapReact.customTemplateSetDismissed(templateName);
|
|
1060
|
+
},
|
|
1061
|
+
|
|
1062
|
+
/**
|
|
1063
|
+
* Notify the SDK that an active custom template is presented to the user
|
|
1064
|
+
*
|
|
1065
|
+
* @param {string} templateName The name of the active template
|
|
1066
|
+
*/
|
|
1067
|
+
customTemplateSetPresented: function (templateName) {
|
|
1068
|
+
return CleverTapReact.customTemplateSetPresented(templateName);
|
|
1069
|
+
},
|
|
1070
|
+
|
|
1071
|
+
/**
|
|
1072
|
+
* Trigger a custom template action argument by name.
|
|
1073
|
+
*
|
|
1074
|
+
* @param {string} templateName The name of an active template for which the action is defined
|
|
1075
|
+
* @param {string} argName The action argument name
|
|
1076
|
+
*/
|
|
1077
|
+
customTemplateRunAction: function (templateName, argName) {
|
|
1078
|
+
return CleverTapReact.customTemplateRunAction(templateName, argName);
|
|
1079
|
+
},
|
|
1080
|
+
|
|
1081
|
+
/**
|
|
1082
|
+
* Retrieve a string argument by name.
|
|
1083
|
+
*
|
|
1084
|
+
* @param {string} templateName The name of an active template for which the argument is defined
|
|
1085
|
+
* @param {string} argName The action argument name
|
|
1086
|
+
*
|
|
1087
|
+
* @returns {string} The argument value or null if no such argument is defined for the template.
|
|
1088
|
+
*/
|
|
1089
|
+
customTemplateGetStringArg: function (templateName, argName) {
|
|
1090
|
+
return CleverTapReact.customTemplateGetStringArg(templateName, argName);
|
|
1091
|
+
},
|
|
1092
|
+
|
|
1093
|
+
/**
|
|
1094
|
+
* Retrieve a number argument by name.
|
|
1095
|
+
*
|
|
1096
|
+
* @param {string} templateName The name of an active template for which the argument is defined
|
|
1097
|
+
* @param {string} argName The action argument name
|
|
1098
|
+
*
|
|
1099
|
+
* @returns {number} The argument value or null if no such argument is defined for the template.
|
|
1100
|
+
*/
|
|
1101
|
+
customTemplateGetNumberArg: function (templateName, argName) {
|
|
1102
|
+
return CleverTapReact.customTemplateGetNumberArg(templateName, argName);
|
|
1103
|
+
},
|
|
1104
|
+
|
|
1105
|
+
/**
|
|
1106
|
+
* Retrieve a boolean argument by name.
|
|
1107
|
+
*
|
|
1108
|
+
* @param {string} templateName The name of an active template for which the argument is defined
|
|
1109
|
+
* @param {stirng} argName The action argument name
|
|
1110
|
+
*
|
|
1111
|
+
* @returns {boolean} The argument value or null if no such argument is defined for the template.
|
|
1112
|
+
*/
|
|
1113
|
+
customTemplateGetBooleanArg: function (templateName, argName) {
|
|
1114
|
+
return CleverTapReact.customTemplateGetBooleanArg(templateName, argName);
|
|
1115
|
+
},
|
|
1116
|
+
|
|
1117
|
+
/**
|
|
1118
|
+
* Retrieve a file argument by name.
|
|
1119
|
+
*
|
|
1120
|
+
* @param {string} templateName The name of an active template for which the argument is defined
|
|
1121
|
+
* @param {string} argName The action argument name
|
|
1122
|
+
*
|
|
1123
|
+
* @returns {string} The file path to the file or null if no such argument is defined for the template.
|
|
1124
|
+
*/
|
|
1125
|
+
customTemplateGetFileArg: function (templateName, argName) {
|
|
1126
|
+
return CleverTapReact.customTemplateGetFileArg(templateName, argName);
|
|
1127
|
+
},
|
|
1128
|
+
|
|
1129
|
+
/**
|
|
1130
|
+
* Retrieve an object argument by name.
|
|
1131
|
+
*
|
|
1132
|
+
* @param {string} templateName The name of an active template for which the argument is defined
|
|
1133
|
+
* @param {string} argName The action argument name
|
|
1134
|
+
*
|
|
1135
|
+
* @returns {any} The argument value or null if no such argument is defined for the template.
|
|
1136
|
+
*/
|
|
1137
|
+
customTemplateGetObjectArg: function (templateName, argName) {
|
|
1138
|
+
return CleverTapReact.customTemplateGetObjectArg(templateName, argName);
|
|
1139
|
+
},
|
|
1140
|
+
|
|
1141
|
+
/**
|
|
1142
|
+
* Get a string representation of an active's template context with information about all arguments.
|
|
1143
|
+
*
|
|
1144
|
+
* @param {string} templateName The name of an active template
|
|
1145
|
+
* @returns {string}
|
|
1146
|
+
*/
|
|
1147
|
+
customTemplateContextToString: function (templateName) {
|
|
1148
|
+
return CleverTapReact.customTemplateContextToString(templateName);
|
|
965
1149
|
}
|
|
966
1150
|
};
|
|
967
1151
|
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
package/android/local.properties
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
## This file must *NOT* be checked into Version Control Systems,
|
|
2
|
-
# as it contains information specific to your local configuration.
|
|
3
|
-
#
|
|
4
|
-
# Location of the SDK. This is only used by Gradle.
|
|
5
|
-
# For customization when using a Version Control System, please read the
|
|
6
|
-
# header note.
|
|
7
|
-
#Tue Mar 05 15:18:18 IST 2024
|
|
8
|
-
sdk.dir=/Users/anush/Library/Android/sdk
|