clevertap-react-native 3.9.0 → 4.0.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.
Files changed (321) hide show
  1. package/.claude/worktrees/ecstatic-goldberg/.claude/settings.local.json +12 -0
  2. package/.claude/worktrees/ecstatic-goldberg/.codebeatignore +1 -0
  3. package/.claude/worktrees/ecstatic-goldberg/.eslintrc.json +34 -0
  4. package/.claude/worktrees/ecstatic-goldberg/.vscode/settings.json +3 -0
  5. package/.claude/worktrees/ecstatic-goldberg/CHANGELOG.md +689 -0
  6. package/.claude/worktrees/ecstatic-goldberg/LICENSE +9 -0
  7. package/.claude/worktrees/ecstatic-goldberg/README.md +52 -0
  8. package/.claude/worktrees/ecstatic-goldberg/android/.gradle/8.5/checksums/checksums.lock +0 -0
  9. package/.claude/worktrees/ecstatic-goldberg/android/.gradle/8.5/dependencies-accessors/dependencies-accessors.lock +0 -0
  10. package/.claude/worktrees/ecstatic-goldberg/android/.gradle/8.5/fileChanges/last-build.bin +0 -0
  11. package/.claude/worktrees/ecstatic-goldberg/android/.gradle/8.5/fileHashes/fileHashes.lock +0 -0
  12. package/.claude/worktrees/ecstatic-goldberg/android/.gradle/8.5/gc.properties +0 -0
  13. package/.claude/worktrees/ecstatic-goldberg/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  14. package/.claude/worktrees/ecstatic-goldberg/android/.gradle/buildOutputCleanup/cache.properties +2 -0
  15. package/.claude/worktrees/ecstatic-goldberg/android/.gradle/vcs-1/gc.properties +0 -0
  16. package/.claude/worktrees/ecstatic-goldberg/android/build.gradle +63 -0
  17. package/.claude/worktrees/ecstatic-goldberg/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  18. package/.claude/worktrees/ecstatic-goldberg/android/gradle/wrapper/gradle-wrapper.properties +6 -0
  19. package/.claude/worktrees/ecstatic-goldberg/android/gradle.properties +2 -0
  20. package/.claude/worktrees/ecstatic-goldberg/android/gradlew +160 -0
  21. package/.claude/worktrees/ecstatic-goldberg/android/gradlew.bat +90 -0
  22. package/{android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt → .claude/worktrees/ecstatic-goldberg/android/src/main}/AndroidManifest.xml +2 -7
  23. package/.claude/worktrees/ecstatic-goldberg/android/src/main/java/com/clevertap/react/CleverTapApplication.kt +12 -0
  24. package/.claude/worktrees/ecstatic-goldberg/android/src/main/java/com/clevertap/react/CleverTapCustomTemplates.kt +66 -0
  25. package/.claude/worktrees/ecstatic-goldberg/android/src/main/java/com/clevertap/react/CleverTapEvent.kt +42 -0
  26. package/.claude/worktrees/ecstatic-goldberg/android/src/main/java/com/clevertap/react/CleverTapEventEmitter.kt +128 -0
  27. package/.claude/worktrees/ecstatic-goldberg/android/src/main/java/com/clevertap/react/CleverTapListenerProxy.kt +225 -0
  28. package/.claude/worktrees/ecstatic-goldberg/android/src/main/java/com/clevertap/react/CleverTapModuleImpl.java +2112 -0
  29. package/.claude/worktrees/ecstatic-goldberg/android/src/main/java/com/clevertap/react/CleverTapPackage.kt +36 -0
  30. package/.claude/worktrees/ecstatic-goldberg/android/src/main/java/com/clevertap/react/CleverTapRnAPI.kt +35 -0
  31. package/.claude/worktrees/ecstatic-goldberg/android/src/main/java/com/clevertap/react/CleverTapUtils.java +333 -0
  32. package/.claude/worktrees/ecstatic-goldberg/android/src/main/java/com/clevertap/react/Constants.kt +13 -0
  33. package/.claude/worktrees/ecstatic-goldberg/android/src/newarch/CleverTapModule.kt +622 -0
  34. package/.claude/worktrees/ecstatic-goldberg/android/src/oldarch/CleverTapModule.kt +716 -0
  35. package/.claude/worktrees/ecstatic-goldberg/clevertap-react-native.podspec +37 -0
  36. package/.claude/worktrees/ecstatic-goldberg/docs/CustomCodeTemplates.md +215 -0
  37. package/.claude/worktrees/ecstatic-goldberg/docs/Variables.md +191 -0
  38. package/.claude/worktrees/ecstatic-goldberg/docs/callbackPayloadFormat.md +26 -0
  39. package/.claude/worktrees/ecstatic-goldberg/docs/install.md +162 -0
  40. package/.claude/worktrees/ecstatic-goldberg/docs/integration.md +122 -0
  41. package/.claude/worktrees/ecstatic-goldberg/docs/iospushtemplates.md +582 -0
  42. package/.claude/worktrees/ecstatic-goldberg/docs/pushprimer.md +99 -0
  43. package/.claude/worktrees/ecstatic-goldberg/docs/usage.md +524 -0
  44. package/.claude/worktrees/ecstatic-goldberg/ios/CleverTapReact/CleverTapReact.h +41 -0
  45. package/.claude/worktrees/ecstatic-goldberg/ios/CleverTapReact/CleverTapReact.mm +1428 -0
  46. package/.claude/worktrees/ecstatic-goldberg/ios/CleverTapReact/CleverTapReactAppFunctionPresenter.h +20 -0
  47. package/.claude/worktrees/ecstatic-goldberg/ios/CleverTapReact/CleverTapReactAppFunctionPresenter.mm +21 -0
  48. package/.claude/worktrees/ecstatic-goldberg/ios/CleverTapReact/CleverTapReactCustomTemplates.h +42 -0
  49. package/.claude/worktrees/ecstatic-goldberg/ios/CleverTapReact/CleverTapReactCustomTemplates.mm +51 -0
  50. package/.claude/worktrees/ecstatic-goldberg/ios/CleverTapReact/CleverTapReactManager.h +14 -0
  51. package/.claude/worktrees/ecstatic-goldberg/ios/CleverTapReact/CleverTapReactManager.mm +168 -0
  52. package/.claude/worktrees/ecstatic-goldberg/ios/CleverTapReact/CleverTapReactPendingEvent.h +14 -0
  53. package/.claude/worktrees/ecstatic-goldberg/ios/CleverTapReact/CleverTapReactPendingEvent.mm +14 -0
  54. package/.claude/worktrees/ecstatic-goldberg/ios/CleverTapReact/CleverTapReactTemplatePresenter.h +22 -0
  55. package/.claude/worktrees/ecstatic-goldberg/ios/CleverTapReact/CleverTapReactTemplatePresenter.mm +21 -0
  56. package/.claude/worktrees/ecstatic-goldberg/ios/CleverTapReact.xcodeproj/project.pbxproj +371 -0
  57. package/.claude/worktrees/ecstatic-goldberg/package-lock.json +9891 -0
  58. package/.claude/worktrees/ecstatic-goldberg/package.json +57 -0
  59. package/.claude/worktrees/ecstatic-goldberg/src/NativeCleverTapModule.ts +252 -0
  60. package/.claude/worktrees/ecstatic-goldberg/src/index.d.ts +1031 -0
  61. package/.claude/worktrees/ecstatic-goldberg/src/index.js +1258 -0
  62. package/.claude/worktrees/ecstatic-goldberg/static/Finder.png +0 -0
  63. package/.claude/worktrees/ecstatic-goldberg/static/GenerateSpecs.png +0 -0
  64. package/.claude/worktrees/ecstatic-goldberg/static/NotificationContent.png +0 -0
  65. package/.claude/worktrees/ecstatic-goldberg/static/NotificationContentStoryboard.png +0 -0
  66. package/.claude/worktrees/ecstatic-goldberg/static/NotificationContentTarget.png +0 -0
  67. package/.claude/worktrees/ecstatic-goldberg/static/NotificationServiceTarget.png +0 -0
  68. package/.claude/worktrees/vigilant-davinci/.claude/settings.local.json +7 -0
  69. package/.claude/worktrees/vigilant-davinci/.codebeatignore +1 -0
  70. package/.claude/worktrees/vigilant-davinci/.eslintrc.json +34 -0
  71. package/.claude/worktrees/vigilant-davinci/.vscode/settings.json +3 -0
  72. package/.claude/worktrees/vigilant-davinci/CHANGELOG.md +702 -0
  73. package/.claude/worktrees/vigilant-davinci/LICENSE +9 -0
  74. package/.claude/worktrees/vigilant-davinci/README.md +52 -0
  75. package/.claude/worktrees/vigilant-davinci/android/.gradle/8.5/checksums/checksums.lock +0 -0
  76. package/.claude/worktrees/vigilant-davinci/android/.gradle/8.5/dependencies-accessors/dependencies-accessors.lock +0 -0
  77. package/.claude/worktrees/vigilant-davinci/android/.gradle/8.5/dependencies-accessors/gc.properties +0 -0
  78. package/.claude/worktrees/vigilant-davinci/android/.gradle/8.5/fileChanges/last-build.bin +0 -0
  79. package/.claude/worktrees/vigilant-davinci/android/.gradle/8.5/fileHashes/fileHashes.lock +0 -0
  80. package/.claude/worktrees/vigilant-davinci/android/.gradle/8.5/gc.properties +0 -0
  81. package/.claude/worktrees/vigilant-davinci/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  82. package/.claude/worktrees/vigilant-davinci/android/.gradle/buildOutputCleanup/cache.properties +2 -0
  83. package/.claude/worktrees/vigilant-davinci/android/.gradle/vcs-1/gc.properties +0 -0
  84. package/.claude/worktrees/vigilant-davinci/android/build.gradle +63 -0
  85. package/.claude/worktrees/vigilant-davinci/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  86. package/.claude/worktrees/vigilant-davinci/android/gradle/wrapper/gradle-wrapper.properties +6 -0
  87. package/.claude/worktrees/vigilant-davinci/android/gradle.properties +2 -0
  88. package/.claude/worktrees/vigilant-davinci/android/gradlew +160 -0
  89. package/.claude/worktrees/vigilant-davinci/android/gradlew.bat +90 -0
  90. package/{android/build/intermediates/merged_manifest/debug → .claude/worktrees/vigilant-davinci/android/src/main}/AndroidManifest.xml +2 -7
  91. package/.claude/worktrees/vigilant-davinci/android/src/main/java/com/clevertap/react/CleverTapApplication.kt +12 -0
  92. package/.claude/worktrees/vigilant-davinci/android/src/main/java/com/clevertap/react/CleverTapCustomTemplates.kt +66 -0
  93. package/.claude/worktrees/vigilant-davinci/android/src/main/java/com/clevertap/react/CleverTapEvent.kt +42 -0
  94. package/.claude/worktrees/vigilant-davinci/android/src/main/java/com/clevertap/react/CleverTapEventEmitter.kt +128 -0
  95. package/.claude/worktrees/vigilant-davinci/android/src/main/java/com/clevertap/react/CleverTapListenerProxy.kt +225 -0
  96. package/.claude/worktrees/vigilant-davinci/android/src/main/java/com/clevertap/react/CleverTapModuleImpl.java +2139 -0
  97. package/.claude/worktrees/vigilant-davinci/android/src/main/java/com/clevertap/react/CleverTapPackage.kt +36 -0
  98. package/.claude/worktrees/vigilant-davinci/android/src/main/java/com/clevertap/react/CleverTapRnAPI.kt +35 -0
  99. package/.claude/worktrees/vigilant-davinci/android/src/main/java/com/clevertap/react/CleverTapUtils.java +333 -0
  100. package/.claude/worktrees/vigilant-davinci/android/src/main/java/com/clevertap/react/Constants.kt +13 -0
  101. package/.claude/worktrees/vigilant-davinci/android/src/newarch/CleverTapModule.kt +622 -0
  102. package/.claude/worktrees/vigilant-davinci/android/src/oldarch/CleverTapModule.kt +716 -0
  103. package/.claude/worktrees/vigilant-davinci/clevertap-react-native.podspec +37 -0
  104. package/.claude/worktrees/vigilant-davinci/docs/CustomCodeTemplates.md +215 -0
  105. package/.claude/worktrees/vigilant-davinci/docs/Variables.md +191 -0
  106. package/.claude/worktrees/vigilant-davinci/docs/callbackPayloadFormat.md +26 -0
  107. package/.claude/worktrees/vigilant-davinci/docs/install.md +162 -0
  108. package/.claude/worktrees/vigilant-davinci/docs/integration.md +122 -0
  109. package/.claude/worktrees/vigilant-davinci/docs/iospushtemplates.md +582 -0
  110. package/.claude/worktrees/vigilant-davinci/docs/pushprimer.md +99 -0
  111. package/.claude/worktrees/vigilant-davinci/docs/usage.md +524 -0
  112. package/.claude/worktrees/vigilant-davinci/ios/CleverTapReact/CleverTapReact.h +41 -0
  113. package/.claude/worktrees/vigilant-davinci/ios/CleverTapReact/CleverTapReact.mm +1428 -0
  114. package/.claude/worktrees/vigilant-davinci/ios/CleverTapReact/CleverTapReactAppFunctionPresenter.h +20 -0
  115. package/.claude/worktrees/vigilant-davinci/ios/CleverTapReact/CleverTapReactAppFunctionPresenter.mm +21 -0
  116. package/.claude/worktrees/vigilant-davinci/ios/CleverTapReact/CleverTapReactCustomTemplates.h +42 -0
  117. package/.claude/worktrees/vigilant-davinci/ios/CleverTapReact/CleverTapReactCustomTemplates.mm +51 -0
  118. package/.claude/worktrees/vigilant-davinci/ios/CleverTapReact/CleverTapReactManager.h +14 -0
  119. package/.claude/worktrees/vigilant-davinci/ios/CleverTapReact/CleverTapReactManager.mm +168 -0
  120. package/.claude/worktrees/vigilant-davinci/ios/CleverTapReact/CleverTapReactPendingEvent.h +14 -0
  121. package/.claude/worktrees/vigilant-davinci/ios/CleverTapReact/CleverTapReactPendingEvent.mm +14 -0
  122. package/.claude/worktrees/vigilant-davinci/ios/CleverTapReact/CleverTapReactTemplatePresenter.h +22 -0
  123. package/.claude/worktrees/vigilant-davinci/ios/CleverTapReact/CleverTapReactTemplatePresenter.mm +21 -0
  124. package/.claude/worktrees/vigilant-davinci/ios/CleverTapReact.xcodeproj/project.pbxproj +371 -0
  125. package/.claude/worktrees/vigilant-davinci/package-lock.json +9891 -0
  126. package/.claude/worktrees/vigilant-davinci/package.json +57 -0
  127. package/.claude/worktrees/vigilant-davinci/src/NativeCleverTapModule.ts +252 -0
  128. package/.claude/worktrees/vigilant-davinci/src/index.d.ts +1031 -0
  129. package/.claude/worktrees/vigilant-davinci/src/index.js +1270 -0
  130. package/.claude/worktrees/vigilant-davinci/static/Finder.png +0 -0
  131. package/.claude/worktrees/vigilant-davinci/static/GenerateSpecs.png +0 -0
  132. package/.claude/worktrees/vigilant-davinci/static/NotificationContent.png +0 -0
  133. package/.claude/worktrees/vigilant-davinci/static/NotificationContentStoryboard.png +0 -0
  134. package/.claude/worktrees/vigilant-davinci/static/NotificationContentTarget.png +0 -0
  135. package/.claude/worktrees/vigilant-davinci/static/NotificationServiceTarget.png +0 -0
  136. package/CHANGELOG.md +13 -0
  137. package/android/.gradle/8.5/checksums/checksums.lock +0 -0
  138. package/android/{build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i → .gradle/8.5/checksums/sha1-checksums.bin} +0 -0
  139. package/android/.gradle/8.5/dependencies-accessors/dependencies-accessors.lock +0 -0
  140. package/android/.gradle/8.5/fileHashes/fileHashes.lock +0 -0
  141. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  142. package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
  143. package/android/build.gradle +3 -3
  144. package/clevertap-react-native.podspec +1 -1
  145. package/docs/install.md +1 -1
  146. package/ios/CleverTapReact/CleverTapReactManager.mm +8 -0
  147. package/package.json +1 -1
  148. package/src/index.js +1 -1
  149. package/android/.settings/org.eclipse.buildship.core.prefs +0 -13
  150. package/android/build/generated/source/buildConfig/debug/com/clevertap/react/BuildConfig.java +0 -12
  151. package/android/build/generated/source/codegen/java/com/clevertap/react/NativeCleverTapModuleSpec.java +0 -582
  152. package/android/build/generated/source/codegen/jni/CMakeLists.txt +0 -49
  153. package/android/build/generated/source/codegen/jni/CTTurboModuleSpec-generated.cpp +0 -764
  154. package/android/build/generated/source/codegen/jni/CTTurboModuleSpec.h +0 -31
  155. package/android/build/generated/source/codegen/jni/react/renderer/components/CTTurboModuleSpec/CTTurboModuleSpecJSI-generated.cpp +0 -1035
  156. package/android/build/generated/source/codegen/jni/react/renderer/components/CTTurboModuleSpec/CTTurboModuleSpecJSI.h +0 -1161
  157. package/android/build/generated/source/codegen/jni/react/renderer/components/CTTurboModuleSpec/ComponentDescriptors.cpp +0 -22
  158. package/android/build/generated/source/codegen/jni/react/renderer/components/CTTurboModuleSpec/ComponentDescriptors.h +0 -24
  159. package/android/build/generated/source/codegen/jni/react/renderer/components/CTTurboModuleSpec/EventEmitters.cpp +0 -16
  160. package/android/build/generated/source/codegen/jni/react/renderer/components/CTTurboModuleSpec/EventEmitters.h +0 -17
  161. package/android/build/generated/source/codegen/jni/react/renderer/components/CTTurboModuleSpec/Props.cpp +0 -19
  162. package/android/build/generated/source/codegen/jni/react/renderer/components/CTTurboModuleSpec/Props.h +0 -18
  163. package/android/build/generated/source/codegen/jni/react/renderer/components/CTTurboModuleSpec/ShadowNodes.cpp +0 -17
  164. package/android/build/generated/source/codegen/jni/react/renderer/components/CTTurboModuleSpec/ShadowNodes.h +0 -23
  165. package/android/build/generated/source/codegen/jni/react/renderer/components/CTTurboModuleSpec/States.cpp +0 -16
  166. package/android/build/generated/source/codegen/jni/react/renderer/components/CTTurboModuleSpec/States.h +0 -21
  167. package/android/build/generated/source/codegen/schema.json +0 -3695
  168. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/output-metadata.json +0 -18
  169. package/android/build/intermediates/aar_main_jar/debug/classes.jar +0 -0
  170. package/android/build/intermediates/aar_metadata/debug/aar-metadata.properties +0 -6
  171. package/android/build/intermediates/annotation_processor_list/debug/annotationProcessors.json +0 -1
  172. package/android/build/intermediates/compile_library_classes_jar/debug/classes.jar +0 -0
  173. package/android/build/intermediates/compile_r_class_jar/debug/R.jar +0 -0
  174. package/android/build/intermediates/compile_symbol_list/debug/R.txt +0 -7705
  175. package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +0 -1
  176. package/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +0 -2
  177. package/android/build/intermediates/incremental/debug-mergeJavaRes/merge-state +0 -0
  178. package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +0 -2
  179. package/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +0 -2
  180. package/android/build/intermediates/incremental/packageDebugAssets/merger.xml +0 -2
  181. package/android/build/intermediates/java_res/debug/out/META-INF/clevertap-react-native_debug.kotlin_module +0 -0
  182. package/android/build/intermediates/javac/debug/classes/com/clevertap/react/BuildConfig.class +0 -0
  183. package/android/build/intermediates/javac/debug/classes/com/clevertap/react/CleverTapModuleImpl$1.class +0 -0
  184. package/android/build/intermediates/javac/debug/classes/com/clevertap/react/CleverTapModuleImpl$10.class +0 -0
  185. package/android/build/intermediates/javac/debug/classes/com/clevertap/react/CleverTapModuleImpl$2.class +0 -0
  186. package/android/build/intermediates/javac/debug/classes/com/clevertap/react/CleverTapModuleImpl$3.class +0 -0
  187. package/android/build/intermediates/javac/debug/classes/com/clevertap/react/CleverTapModuleImpl$4.class +0 -0
  188. package/android/build/intermediates/javac/debug/classes/com/clevertap/react/CleverTapModuleImpl$5.class +0 -0
  189. package/android/build/intermediates/javac/debug/classes/com/clevertap/react/CleverTapModuleImpl$6.class +0 -0
  190. package/android/build/intermediates/javac/debug/classes/com/clevertap/react/CleverTapModuleImpl$7.class +0 -0
  191. package/android/build/intermediates/javac/debug/classes/com/clevertap/react/CleverTapModuleImpl$8.class +0 -0
  192. package/android/build/intermediates/javac/debug/classes/com/clevertap/react/CleverTapModuleImpl$9.class +0 -0
  193. package/android/build/intermediates/javac/debug/classes/com/clevertap/react/CleverTapModuleImpl$InBoxMessages.class +0 -0
  194. package/android/build/intermediates/javac/debug/classes/com/clevertap/react/CleverTapModuleImpl$TemplateContextAction.class +0 -0
  195. package/android/build/intermediates/javac/debug/classes/com/clevertap/react/CleverTapModuleImpl.class +0 -0
  196. package/android/build/intermediates/javac/debug/classes/com/clevertap/react/CleverTapUtils$1.class +0 -0
  197. package/android/build/intermediates/javac/debug/classes/com/clevertap/react/CleverTapUtils$MapUtil$ArrayUtil.class +0 -0
  198. package/android/build/intermediates/javac/debug/classes/com/clevertap/react/CleverTapUtils$MapUtil.class +0 -0
  199. package/android/build/intermediates/javac/debug/classes/com/clevertap/react/CleverTapUtils.class +0 -0
  200. package/android/build/intermediates/javac/debug/classes/com/clevertap/react/NativeCleverTapModuleSpec.class +0 -0
  201. package/android/build/intermediates/local_only_symbol_list/debug/R-def.txt +0 -2
  202. package/android/build/intermediates/manifest_merge_blame_file/debug/manifest-merger-blame-debug-report.txt +0 -14
  203. package/android/build/intermediates/merged_java_res/debug/feature-clevertap-react-native.jar +0 -0
  204. package/android/build/intermediates/navigation_json/debug/navigation.json +0 -1
  205. package/android/build/intermediates/runtime_library_classes_jar/debug/classes.jar +0 -0
  206. package/android/build/intermediates/symbol_list_with_package_name/debug/package-aware-r.txt +0 -5786
  207. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab +0 -0
  208. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream +0 -0
  209. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream.len +0 -0
  210. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.len +0 -0
  211. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at +0 -0
  212. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i +0 -0
  213. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i.len +0 -0
  214. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab +0 -0
  215. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream +0 -0
  216. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream.len +0 -0
  217. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.len +0 -0
  218. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.values.at +0 -0
  219. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i +0 -0
  220. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i.len +0 -0
  221. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab +0 -0
  222. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream +0 -0
  223. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len +0 -0
  224. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len +0 -0
  225. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at +0 -0
  226. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i +0 -0
  227. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i.len +0 -0
  228. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab +0 -0
  229. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.keystream +0 -0
  230. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.keystream.len +0 -0
  231. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.len +0 -0
  232. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.values.at +0 -0
  233. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab_i +0 -0
  234. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab_i.len +0 -0
  235. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab +0 -0
  236. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream +0 -0
  237. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len +0 -0
  238. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len +0 -0
  239. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at +0 -0
  240. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i +0 -0
  241. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i.len +0 -0
  242. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/java-sources-proto-map.tab +0 -0
  243. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/java-sources-proto-map.tab.keystream +0 -0
  244. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/java-sources-proto-map.tab.keystream.len +0 -0
  245. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/java-sources-proto-map.tab.len +0 -0
  246. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/java-sources-proto-map.tab.values.at +0 -0
  247. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/java-sources-proto-map.tab_i +0 -0
  248. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/java-sources-proto-map.tab_i.len +0 -0
  249. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab +0 -0
  250. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream +0 -0
  251. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream.len +0 -0
  252. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.len +0 -0
  253. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at +0 -0
  254. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i.len +0 -0
  255. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab +0 -0
  256. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream +0 -0
  257. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len +0 -0
  258. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.len +0 -0
  259. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at +0 -0
  260. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i +0 -0
  261. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i.len +0 -0
  262. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab +0 -0
  263. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream +0 -0
  264. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len +0 -0
  265. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.len +0 -0
  266. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.values.at +0 -0
  267. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i +0 -0
  268. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i.len +0 -0
  269. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab +0 -0
  270. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream +0 -0
  271. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream.len +0 -0
  272. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.len +0 -0
  273. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.values.at +0 -0
  274. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i +0 -0
  275. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i.len +0 -0
  276. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/counters.tab +0 -2
  277. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab +0 -0
  278. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream +0 -0
  279. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream.len +0 -0
  280. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.len +0 -0
  281. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.values.at +0 -0
  282. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i +0 -0
  283. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i.len +0 -0
  284. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab +0 -0
  285. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream +0 -0
  286. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream.len +0 -0
  287. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.len +0 -0
  288. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.values.at +0 -0
  289. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i +0 -0
  290. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i.len +0 -0
  291. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab +0 -0
  292. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream +0 -0
  293. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len +0 -0
  294. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.len +0 -0
  295. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at +0 -0
  296. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i +0 -0
  297. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i.len +0 -0
  298. package/android/build/kotlin/compileDebugKotlin/cacheable/last-build.bin +0 -0
  299. package/android/build/kotlin/compileDebugKotlin/classpath-snapshot/shrunk-classpath-snapshot.bin +0 -0
  300. package/android/build/kotlin/compileDebugKotlin/local-state/build-history.bin +0 -0
  301. package/android/build/outputs/aar/clevertap-react-native-debug.aar +0 -0
  302. package/android/build/outputs/logs/manifest-merger-debug-report.txt +0 -17
  303. package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
  304. package/android/build/tmp/kotlin-classes/debug/META-INF/clevertap-react-native_debug.kotlin_module +0 -0
  305. package/android/build/tmp/kotlin-classes/debug/com/clevertap/react/CleverTapApplication.class +0 -0
  306. package/android/build/tmp/kotlin-classes/debug/com/clevertap/react/CleverTapCustomTemplates$templatePresenter$1.class +0 -0
  307. package/android/build/tmp/kotlin-classes/debug/com/clevertap/react/CleverTapCustomTemplates.class +0 -0
  308. package/android/build/tmp/kotlin-classes/debug/com/clevertap/react/CleverTapEvent$Companion.class +0 -0
  309. package/android/build/tmp/kotlin-classes/debug/com/clevertap/react/CleverTapEvent.class +0 -0
  310. package/android/build/tmp/kotlin-classes/debug/com/clevertap/react/CleverTapEventEmitter$Buffer$items$2.class +0 -0
  311. package/android/build/tmp/kotlin-classes/debug/com/clevertap/react/CleverTapEventEmitter$Buffer.class +0 -0
  312. package/android/build/tmp/kotlin-classes/debug/com/clevertap/react/CleverTapEventEmitter.class +0 -0
  313. package/android/build/tmp/kotlin-classes/debug/com/clevertap/react/CleverTapListenerProxy.class +0 -0
  314. package/android/build/tmp/kotlin-classes/debug/com/clevertap/react/CleverTapModule$Companion.class +0 -0
  315. package/android/build/tmp/kotlin-classes/debug/com/clevertap/react/CleverTapModule.class +0 -0
  316. package/android/build/tmp/kotlin-classes/debug/com/clevertap/react/CleverTapPackage.class +0 -0
  317. package/android/build/tmp/kotlin-classes/debug/com/clevertap/react/CleverTapRnAPI.class +0 -0
  318. package/android/build/tmp/kotlin-classes/debug/com/clevertap/react/Constants.class +0 -0
  319. package/android/build/tmp/kotlin-classes/debug/com/clevertap/react/ErrorMessages.class +0 -0
  320. package/android/local.properties +0 -8
  321. /package/{android/build/intermediates/annotations_typedef_file/debug/typedefs.txt → .claude/worktrees/ecstatic-goldberg/android/.gradle/8.5/dependencies-accessors/gc.properties} +0 -0
@@ -0,0 +1,1270 @@
1
+ import { DeviceEventEmitter, NativeEventEmitter, NativeModules, Platform } from 'react-native';
2
+
3
+ const CleverTapReact = require('./NativeCleverTapModule').default;
4
+ const EventEmitter = Platform.select({
5
+ ios: new NativeEventEmitter(CleverTapReact),
6
+ android: DeviceEventEmitter
7
+ });
8
+ // NativeModules.CleverTapReactEventEmitter ? new NativeEventEmitter(CleverTapReact) : DeviceEventEmitter;
9
+ /**
10
+ * Set the CleverTap React-Native library name with current version
11
+ * @param {string} libName - Library name will be "React-Native"
12
+ * @param {int} libVersion - The updated library version. If current version is 1.1.0 then pass as 10100
13
+ */
14
+ const libName = 'React-Native';
15
+ const libVersion = 30900;
16
+ CleverTapReact.setLibrary(libName,libVersion);
17
+
18
+ function defaultCallback(method, err, res) {
19
+ if (err) {
20
+ console.log('CleverTap ' + method + ' default callback error', err);
21
+ } else {
22
+ console.log('CleverTap ' + method + ' default callback result', res);
23
+ }
24
+ }
25
+
26
+ /**
27
+ * Calls a CleverTap method with a default callback if necessary
28
+ * @param {string} method - the CleverTap method name as a string
29
+ * @param {array} args - The method args
30
+ * @param {function(err, res)} callback - callback
31
+ */
32
+ function callWithCallback(method, args, callback) {
33
+ if (typeof callback === 'undefined' || callback == null || typeof callback !== 'function') {
34
+ callback = (err, res) => {
35
+ defaultCallback(method, err, res);
36
+ };
37
+ }
38
+
39
+ if (args == null) {
40
+ args = [];
41
+ }
42
+
43
+ args.push(callback);
44
+
45
+ CleverTapReact[method].apply(this, args);
46
+ }
47
+
48
+ var CleverTap = {
49
+ CleverTapProfileDidInitialize: CleverTapReact.getConstants().CleverTapProfileDidInitialize,
50
+ CleverTapProfileSync: CleverTapReact.getConstants().CleverTapProfileSync,
51
+ CleverTapInAppNotificationDismissed: CleverTapReact.getConstants().CleverTapInAppNotificationDismissed,
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,
57
+ FCM: CleverTapReact.getConstants().FCM,
58
+ CleverTapInboxDidInitialize: CleverTapReact.getConstants().CleverTapInboxDidInitialize,
59
+ CleverTapInboxMessagesDidUpdate: CleverTapReact.getConstants().CleverTapInboxMessagesDidUpdate,
60
+ CleverTapInboxMessageButtonTapped: CleverTapReact.getConstants().CleverTapInboxMessageButtonTapped,
61
+ CleverTapInboxMessageTapped: CleverTapReact.getConstants().CleverTapInboxMessageTapped,
62
+ CleverTapDisplayUnitsLoaded: CleverTapReact.getConstants().CleverTapDisplayUnitsLoaded,
63
+ CleverTapFeatureFlagsDidUpdate: CleverTapReact.getConstants().CleverTapFeatureFlagsDidUpdate, // @deprecated - Since version 1.1.0 and will be removed in the future versions of this SDK.
64
+ CleverTapProductConfigDidInitialize: CleverTapReact.getConstants().CleverTapProductConfigDidInitialize, // @deprecated - Since version 1.1.0 and will be removed in the future versions of this SDK.
65
+ CleverTapProductConfigDidFetch: CleverTapReact.getConstants().CleverTapProductConfigDidFetch, // @deprecated - Since version 1.1.0 and will be removed in the future versions of this SDK.
66
+ CleverTapProductConfigDidActivate: CleverTapReact.getConstants().CleverTapProductConfigDidActivate, // @deprecated - Since version 1.1.0 and will be removed in the future versions of this SDK.
67
+ CleverTapPushNotificationClicked: CleverTapReact.getConstants().CleverTapPushNotificationClicked,
68
+ CleverTapPushPermissionResponseReceived: CleverTapReact.getConstants().CleverTapPushPermissionResponseReceived,
69
+ CleverTapOnVariablesChanged: CleverTapReact.getConstants().CleverTapOnVariablesChanged,
70
+ CleverTapOnOneTimeVariablesChanged: CleverTapReact.getConstants().CleverTapOnOneTimeVariablesChanged,
71
+ CleverTapOnValueChanged: CleverTapReact.getConstants().CleverTapOnValueChanged,
72
+ CleverTapOnVariablesChangedAndNoDownloadsPending: CleverTapReact.getConstants().CleverTapOnVariablesChangedAndNoDownloadsPending,
73
+ CleverTapOnceVariablesChangedAndNoDownloadsPending: CleverTapReact.getConstants().CleverTapOnceVariablesChangedAndNoDownloadsPending,
74
+ CleverTapOnFileValueChanged: CleverTapReact.getConstants().CleverTapOnFileValueChanged,
75
+
76
+ /**
77
+ * Add a CleverTap event listener
78
+ * supported events are CleverTap.CleverTapProfileDidInitialize, CleverTap.CleverTapProfileSync,CleverTap.CleverTapOnInboxButtonClick
79
+ * ,CleverTap.CleverTapOnInAppButtonClick,CleverTap.CleverTapOnDisplayUnitsLoaded and CleverTap.CleverTapInAppNotificationDismissed
80
+ * @param {string} eventName - the CleverTap event name
81
+ * @param {function(event)} your event handler
82
+ */
83
+ addListener: function (eventName, handler) {
84
+ if (EventEmitter) {
85
+ EventEmitter.addListener(eventName, handler);
86
+ CleverTapReact.onEventListenerAdded(eventName);
87
+ }
88
+ },
89
+ addOneTimeListener: function (eventName, handler) {
90
+ if (EventEmitter) {
91
+ const subscription = EventEmitter.addListener(eventName, (args) =>
92
+ {
93
+ handler(args);
94
+ subscription.remove();
95
+ });
96
+ CleverTapReact.onEventListenerAdded(eventName);
97
+ }
98
+ },
99
+
100
+ /**
101
+ * Removes all of the registered listeners for given eventName.
102
+ *
103
+ * @param {string} eventName - name of the event whose registered listeners to remove
104
+ */
105
+ removeListener: function (eventName) {
106
+ if (EventEmitter) {
107
+ EventEmitter.removeAllListeners(eventName);
108
+ }
109
+ },
110
+
111
+ /**
112
+ * @deprecated - Since version 0.5.0. Use removeListener(eventName) instead
113
+ * Remove all event listeners
114
+ */
115
+ removeListeners: function () {
116
+ if (DeviceEventEmitter) {
117
+ DeviceEventEmitter.removeAllListeners();
118
+ }
119
+ },
120
+
121
+ /**
122
+ * If an application is launched from a push notification click, returns the CleverTap deep link included in the push notification
123
+ * @param {function(err, res)} callback that return the url as string in res or a string error in err
124
+ */
125
+ getInitialUrl: function (callback) {
126
+ callWithCallback('getInitialUrl', null, callback);
127
+ },
128
+
129
+ /**
130
+ * Call this method to set Locale. If Language is english and country is US the locale format which you can set is en_US
131
+ * @param {string} locale - the locale string
132
+ */
133
+ setLocale: function (locale) {
134
+ CleverTapReact.setLocale(locale);
135
+ },
136
+
137
+ /**
138
+ * Registers the application to receive push notifications
139
+ * only necessary for iOS.
140
+ */
141
+ registerForPush: function () {
142
+ CleverTapReact.registerForPush();
143
+ },
144
+
145
+ /**
146
+ * Manually set the push token on the CleverTap user profile
147
+ * @param {string} token - the device token
148
+ * @param {object} pushType - object with the following keys "type", "prefKey", "className", "messagingSDKClassName";
149
+ */
150
+ pushRegistrationToken: function (token, pushType) {
151
+ console.log(`CleverTap RN | pushRegistrationToken| received : token: '${token}'`)
152
+ CleverTapReact.pushRegistrationToken(token, pushType);
153
+ },
154
+
155
+ /**
156
+ * Manually set the push token on the CleverTap user profile
157
+ * @param {string} token - the fcm device token
158
+ */
159
+ setFCMPushToken: function (token) {
160
+ console.log(`CleverTap RN | setFCMPushToken | received : token: '${token}'`)
161
+ CleverTapReact.setFCMPushTokenAsString(token);
162
+ },
163
+
164
+ /**
165
+ * Method to create Notification Channels in Android O
166
+ * @param {string} channelId - A String for setting the id of the notification channel
167
+ * @param {string} channelName - A String for setting the name of the notification channel
168
+ * @param {string} channelDescription - A String for setting the description of the notification channel
169
+ * @param {int} importance - An Integer value setting the importance of the notifications sent in this channel
170
+ * @param {boolean} showBadge - A boolean value as to whether this channel shows a badge
171
+ */
172
+ createNotificationChannel: function (channelId, channelName, channelDescription, importance, showBadge) {
173
+ CleverTapReact.createNotificationChannel(channelId, channelName, channelDescription, importance, showBadge);
174
+ },
175
+
176
+ /**
177
+ * Method to create Notification Channels in Android O
178
+ * @param {string} channelId - A String for setting the id of the notification channel
179
+ * @param {string} channelName - A String for setting the name of the notification channel
180
+ * @param {string} channelDescription - A String for setting the description of the notification channel
181
+ * @param {int} importance - An Integer value setting the importance of the notifications sent in this channel
182
+ * @param {boolean} showBadge - A boolean value as to whether this channel shows a badge
183
+ * @param {string} sound - A String for setting the custom sound of the notification channel
184
+ */
185
+ createNotificationChannelWithSound: function (channelId, channelName, channelDescription, importance, showBadge, sound) {
186
+ CleverTapReact.createNotificationChannelWithSound(channelId, channelName, channelDescription, importance, showBadge, sound);
187
+ },
188
+
189
+ /**
190
+ * Method to create Notification Channels in Android O
191
+ * @param {string} channelId - A String for setting the id of the notification channel
192
+ * @param {string} channelName - A String for setting the name of the notification channel
193
+ * @param {string} channelDescription - A String for setting the description of the notification channel
194
+ * @param {int} importance - An Integer value setting the importance of the notifications sent in this channel
195
+ * @param {string} groupId - A String for setting the notification channel as a part of a notification group
196
+ * @param {boolean} showBadge - A boolean value as to whether this channel shows a badge
197
+ */
198
+ createNotificationChannelWithGroupId: function (channelId, channelName, channelDescription, importance, groupId, showBadge) {
199
+ CleverTapReact.createNotificationChannelWithGroupId(channelId, channelName, channelDescription, importance, groupId, showBadge);
200
+ },
201
+
202
+ /**
203
+ * Method to create Notification Channels in Android O
204
+ * @param {string} channelId - A String for setting the id of the notification channel
205
+ * @param {string} channelName - A String for setting the name of the notification channel
206
+ * @param {string} channelDescription - A String for setting the description of the notification channel
207
+ * @param {int} importance - An Integer value setting the importance of the notifications sent in this channel
208
+ * @param {string} groupId - A String for setting the notification channel as a part of a notification group
209
+ * @param {boolean} showBadge - A boolean value as to whether this channel shows a badge
210
+ * @param {string} sound - A String for setting the custom sound of the notification channel
211
+ */
212
+ createNotificationChannelWithGroupIdAndSound: function (channelId, channelName, channelDescription, importance, groupId, showBadge, sound) {
213
+ CleverTapReact.createNotificationChannelWithGroupIdAndSound(channelId, channelName, channelDescription, importance, groupId, showBadge, sound);
214
+ },
215
+
216
+ /**
217
+ * Method to create Notification Channel Groups in Android O
218
+ * @param {string} groupId - A String for setting the id of the notification channel group
219
+ * @param {string} groupName - A String for setting the name of the notification channel group
220
+ */
221
+ createNotificationChannelGroup: function (groupId, groupName) {
222
+ CleverTapReact.createNotificationChannelGroup(groupId, groupName);
223
+ },
224
+
225
+ /**
226
+ * Method to delete Notification Channels in Android O
227
+ * @param {string} channelId - A String for setting the id of the notification channel
228
+ */
229
+ deleteNotificationChannel: function (channelId) {
230
+ CleverTapReact.deleteNotificationChannel(channelId);
231
+ },
232
+
233
+ /**
234
+ * Method to delete Notification Channel Groups in Android O
235
+ * @param {string} groupId - A String for setting the id of the notification channel group
236
+ */
237
+ deleteNotificationChannelGroup: function (groupId) {
238
+ CleverTapReact.deleteNotificationChannelGroup(groupId);
239
+ },
240
+
241
+ /**
242
+ * Method to show the App Inbox
243
+ * @param {object} extras - key-value data from RemoteMessage.getData(). keys and values are strings
244
+ */
245
+ createNotification: function (extras) {
246
+ CleverTapReact.createNotification(extras);
247
+ },
248
+
249
+ /**
250
+ * Method to prompt the hard permission dialog directly, if the push primer is not required.
251
+ * @param {string} showFallbackSettings - If the value is true then SDK shows an alert dialog which routes to app's notification settings page.
252
+ */
253
+ promptForPushPermission: function (showFallbackSettings) {
254
+ CleverTapReact.promptForPushPermission(showFallbackSettings);
255
+ },
256
+
257
+ /**
258
+ * Method to prompt the push primer for android 13 onwards.
259
+ * @param {object} value - key-value belongs to the localInApp properties. Refer documentation for details.
260
+ */
261
+ promptPushPrimer: function (value) {
262
+ CleverTapReact.promptPushPrimer(value);
263
+ },
264
+
265
+ /**
266
+ * Returns true/false based on whether push permission is granted or denied.
267
+ *
268
+ * @param {function(err, res)} non-null callback to retrieve the result
269
+ */
270
+ isPushPermissionGranted: function (callback) {
271
+ callWithCallback('isPushPermissionGranted', null, callback);
272
+ },
273
+
274
+ /**
275
+ * Sets the user's consent for event and profile tracking.
276
+ *
277
+ * You must call this method separately for each active user profile,
278
+ * for example, when switching user profiles using `onUserLogin`.
279
+ *
280
+ * Consent Scenarios:
281
+ *
282
+ * 1. **Complete Opt-Out**
283
+ * `userOptOut = true`, `allowSystemEvents = false`
284
+ * → No events (custom or system) are saved locally or remotely. Maximum privacy.
285
+ *
286
+ * 2. **Full Opt-In**
287
+ * `userOptOut = false`, `allowSystemEvents = true`
288
+ * → All events (custom and system) are tracked. Default behavior.
289
+ *
290
+ * 3. **Partial Opt-In**
291
+ * `userOptOut = true`, `allowSystemEvents = true`
292
+ * → Only system events (e.g., app launch, notification viewed) are tracked. Custom events are ignored.
293
+ *
294
+ * ⚠️ The combination `userOptOut = false` and `allowSystemEvents = false` is invalid.
295
+ * In such cases, the SDK defaults to **Full Opt-In**.
296
+ *
297
+ * To re-enable full tracking after opting out, call with:
298
+ * `userOptOut = false`, `allowSystemEvents = true`.
299
+ *
300
+ * @param {boolean} userOptOut - Set to `true` to disable custom event tracking.
301
+ * @param {boolean} allowSystemEvents - Set to `true` to allow system-level event tracking.
302
+ * @returns {void}
303
+ */
304
+ setOptOut: function(userOptOut, allowSystemEvents = false) {
305
+ CleverTapReact.setOptOut(userOptOut, allowSystemEvents);
306
+ },
307
+
308
+ /**
309
+ * Sets the CleverTap SDK to offline mode
310
+ * @param {boolean} value - A boolean for enabling or disabling sending events for current user
311
+ */
312
+ setOffline: function (value) {
313
+ CleverTapReact.setOffline(value);
314
+ },
315
+
316
+ /**
317
+ * Enables the reporting of device network related information, including IP address. This reporting is disabled by default.
318
+ * @param {boolean} - A boolean for enabling or disabling device network related information to be sent to CleverTap
319
+ */
320
+ enableDeviceNetworkInfoReporting: function (value) {
321
+ CleverTapReact.enableDeviceNetworkInfoReporting(value);
322
+ },
323
+
324
+ /**
325
+ * Enables the personalization API. Call this prior to using the profile/event API getters
326
+ */
327
+ enablePersonalization: function () {
328
+ CleverTapReact.enablePersonalization();
329
+ },
330
+
331
+ /**
332
+ * Disables the personalization API.
333
+ */
334
+ disablePersonalization: function () {
335
+ CleverTapReact.disablePersonalization();
336
+ },
337
+
338
+ /**
339
+ * Record a Screen View
340
+ * @param {string} screenName - the name of the screen
341
+ */
342
+ recordScreenView: function (screenName) {
343
+ CleverTapReact.recordScreenView(screenName);
344
+ },
345
+
346
+ /**
347
+ * Record an event with optional event properties
348
+ * @param {string} eventName - the name of the event
349
+ * @param {object} props - the key-value properties of the event.
350
+ * keys are strings and values can be string, number or boolean.
351
+ */
352
+ recordEvent: function (eventName, props) {
353
+ convertDateToEpochInProperties(props);
354
+ CleverTapReact.recordEvent(eventName, props);
355
+ },
356
+
357
+ /**
358
+ * Record the special Charged event
359
+ * @param {object} details - the key-value properties for the transaction.
360
+ * @param {array<object>} items - an array of objects containing the key-value data for the items that make up the transaction.
361
+ */
362
+ recordChargedEvent: function (details, items) {
363
+ convertDateToEpochInProperties(details);
364
+ if (Array.isArray(items) && items.length) {
365
+ items.forEach(value => {
366
+ convertDateToEpochInProperties(value);
367
+ });
368
+ }
369
+ CleverTapReact.recordChargedEvent(details, items);
370
+ },
371
+
372
+ /**
373
+ * Get the time of the first occurrence of an event
374
+ * @deprecated - Since version 3.2.0. Use getUserEventLog() instead
375
+ * @param {string} eventName - the name of the event
376
+ * @param {function(err, res)} callback that returns a res of epoch seconds or -1
377
+ */
378
+ eventGetFirstTime: function (eventName, callback) {
379
+ callWithCallback('eventGetFirstTime', [eventName], callback);
380
+ },
381
+
382
+ /**
383
+ * Get the time of the most recent occurrence of an event
384
+ * @deprecated - Since version 3.2.0. Use getUserEventLog() instead
385
+ * @param {string} eventName - the name of the event
386
+ * @param {function(err, res)} callback that returns a res of epoch seconds or -1
387
+ */
388
+ eventGetLastTime: function (eventName, callback) {
389
+ callWithCallback('eventGetLastTime', [eventName], callback);
390
+ },
391
+
392
+ /**
393
+ * Get the number of occurrences of an event
394
+ * @deprecated - Since version 3.2.0. Use getUserEventLogCount() instead
395
+ * @param {string} eventName - the name of the event
396
+ * @param {function(err, res)} callback that returns a res of int
397
+ */
398
+ eventGetOccurrences: function (eventName, callback) {
399
+ callWithCallback('eventGetOccurrences', [eventName], callback);
400
+ },
401
+
402
+ /**
403
+ * Get the summary details of an event
404
+ * @deprecated - Since version 3.2.0. Use getUserEventLog() instead
405
+ * @param {string} eventName - the name of the event
406
+ * @param {function(err, res)} callback that returns a res of object {"eventName": <string>, "firstTime":<epoch seconds>, "lastTime": <epoch seconds>, "count": <int>} or empty object
407
+ */
408
+ eventGetDetail: function (eventName, callback) {
409
+ callWithCallback('eventGetDetail', [eventName], callback);
410
+ },
411
+
412
+ /**
413
+ * Get the user's event history
414
+ * @deprecated - Since version 3.2.0. Use getUserEventLogHistory() instead
415
+ * @param {function(err, res)} callback that returns a res of object {"eventName1":<event1 details object>, "eventName2":<event2 details object>}
416
+ */
417
+ getEventHistory: function (callback) {
418
+ callWithCallback('getEventHistory', null, callback);
419
+ },
420
+ /**
421
+ * Get the details of a specific event
422
+ * @param {string} eventName - the name of the event
423
+ * @param {function(err, res)} callback that returns a res of object {"eventName": <string>, "firstTime":<epoch seconds>, "lastTime": <epoch seconds>, "count": <int>, "deviceID": <string>, "normalizedEventName": <string>} or empty object
424
+ */
425
+ getUserEventLog: function (eventName, callback) {
426
+ callWithCallback('getUserEventLog', [eventName], callback);
427
+ },
428
+
429
+ /**
430
+ * Get the count of times an event occured
431
+ * @param {string} eventName - the name of the event
432
+ * @param {function(err, res)} callback that returns a res of int
433
+ */
434
+ getUserEventLogCount: function (eventName, callback) {
435
+ callWithCallback('getUserEventLogCount', [eventName], callback);
436
+ },
437
+
438
+ /**
439
+ * Get full event hostory for current user
440
+ * @param {function(err, res)} callback that returns a res of object {"eventName1":<event1 details object>, "eventName2":<event2 details object>}
441
+ */
442
+ getUserEventLogHistory: function (callback) {
443
+ callWithCallback('getUserEventLogHistory', null, callback);
444
+ },
445
+
446
+ /**
447
+ * Set the user's location as a latitude,longitude coordinate
448
+ * @param {float} latitude
449
+ * @param {float} longitude
450
+ */
451
+ setLocation: function (latitude, longitude) {
452
+ CleverTapReact.setLocation(latitude, longitude);
453
+ },
454
+
455
+ /**
456
+ * @deprecated - Since version 0.6.0. Use getCleverTapID(callback) instead
457
+ * Get a unique CleverTap identifier suitable for use with install attribution providers
458
+ * @param {function(err, res)} callback that returns a string res
459
+ */
460
+ profileGetCleverTapAttributionIdentifier: function (callback) {
461
+ callWithCallback('profileGetCleverTapAttributionIdentifier', null, callback);
462
+ },
463
+
464
+ /**
465
+ * @deprecated - Since version 0.6.0. Use getCleverTapID(callback) instead
466
+ * Get the user profile's CleverTap identifier value
467
+ * @param {function(err, res)} callback that returns a string res
468
+ */
469
+ profileGetCleverTapID: function (callback) {
470
+ callWithCallback('profileGetCleverTapID', null, callback);
471
+ },
472
+
473
+ /**
474
+ * Creates a separate and distinct user profile identified by one or more of Identity, Email, FBID or GPID values, and populated with the key-values included in the profile dictionary.
475
+ * If your app is used by multiple users, you can use this method to assign them each a unique profile to track them separately.
476
+ * If instead you wish to assign multiple Identity, Email, FBID and/or GPID values to the same user profile, use profileSet rather than this method.
477
+ * If none of Identity, Email, FBID or GPID is included in the profile object, all properties values will be associated with the current user profile.
478
+ * When initially installed on this device, your app is assigned an "anonymous" profile.
479
+ * The first time you identify a user on this device (whether via onUserLogin or profileSet), the "anonymous" history on the device will be associated with the newly identified user.
480
+ * Then, use this method to switch between subsequent separate identified users.
481
+ * Please note that switching from one identified user to another is a costly operation
482
+ * in that the current session for the previous user is automatically closed
483
+ * and data relating to the old user removed, and a new session is started
484
+ * for the new user and data for that user refreshed via a network call to CleverTap.
485
+ * In addition, any global frequency caps are reset as part of the switch.
486
+ * @param {object} profile - key-value profile properties. keys are strings and values can be string, number or boolean.
487
+ */
488
+ onUserLogin: function (profile) {
489
+ convertDateToEpochInProperties(profile);
490
+ CleverTapReact.onUserLogin(profile);
491
+ },
492
+
493
+ /**
494
+ * Set key-value properties on a user profile
495
+ * @param {object} profile - key-value profile properties. keys are strings and values can be string, number or boolean.
496
+ */
497
+ profileSet: function (profile) {
498
+ convertDateToEpochInProperties(profile);
499
+ CleverTapReact.profileSet(profile);
500
+ },
501
+
502
+ /**
503
+ * Get the value of a profile property
504
+ * @param {string} the property key
505
+ * @param {function(err, res)} callback that returns a res of the property value or null
506
+ */
507
+ profileGetProperty: function (key, callback) {
508
+ callWithCallback('profileGetProperty', [key], callback);
509
+ },
510
+
511
+ /**
512
+ * Remove a key-value from the user profile. Alternatively this method can also be used to remove PII data
513
+ * (for eg. Email,Name,Phone), locally from database and shared prefs
514
+ * @param {string} the key to remove
515
+ */
516
+ profileRemoveValueForKey: function (key) {
517
+ CleverTapReact.profileRemoveValueForKey(key);
518
+ },
519
+
520
+ /**
521
+ * Set an array of strings as a multi-value user profile property
522
+ * @param {array} an array of string values
523
+ * @param {string} the property key
524
+ */
525
+ profileSetMultiValuesForKey: function (values, key) {
526
+ CleverTapReact.profileSetMultiValues(values, key);
527
+ },
528
+
529
+ /**
530
+ * Add a string value to a multi-value user profile property
531
+ * @param {string} value
532
+ * @param {string} the property key
533
+ */
534
+ profileAddMultiValueForKey: function (value, key) {
535
+ CleverTapReact.profileAddMultiValue(value, key);
536
+ },
537
+
538
+ /**
539
+ * Add an array of strings to a multi-value user profile property
540
+ * @param {array} an array of string values
541
+ * @param {string} the property key
542
+ */
543
+ profileAddMultiValuesForKey: function (values, key) {
544
+ CleverTapReact.profileAddMultiValues(values, key);
545
+ },
546
+
547
+ /**
548
+ * Remove a string value from a multi-value user profile property
549
+ * @param {string} value
550
+ * @param {string} the property key
551
+ */
552
+ profileRemoveMultiValueForKey: function (value, key) {
553
+ CleverTapReact.profileRemoveMultiValue(value, key);
554
+ },
555
+
556
+ /**
557
+ * Remove an array of strings from a multi-value user profile property
558
+ * @param {array} an array of string values
559
+ * @param {string} the property key
560
+ */
561
+ profileRemoveMultiValuesForKey: function (values, key) {
562
+ CleverTapReact.profileRemoveMultiValues(values, key);
563
+ },
564
+
565
+ /**
566
+ * This method is used to increment the given value
567
+ *
568
+ * @param value {Number} can be int,double or float only (NaN,Infinity etc not supported)
569
+ * @param key {string} profile property
570
+ */
571
+ profileIncrementValueForKey: function (value, key) {
572
+ CleverTapReact.profileIncrementValueForKey(value, key);
573
+ },
574
+
575
+ /**
576
+ * This method is used to decrement the given value
577
+ *
578
+ * @param value {Number} can be int,double or float only (NaN,Infinity etc not supported)
579
+ * @param key {string} profile property
580
+ */
581
+ profileDecrementValueForKey: function (value, key) {
582
+ CleverTapReact.profileDecrementValueForKey(value, key);
583
+ },
584
+
585
+ /**
586
+ * Manually track the utm app install referrer
587
+ * @param {string} the utm referrer source
588
+ * @param {string} the utm referrer medium
589
+ * @param {string} the utm referrer campaign
590
+ */
591
+ pushInstallReferrer: function (source, medium, campaign) {
592
+ CleverTapReact.pushInstallReferrer(source, medium, campaign);
593
+ },
594
+
595
+ /**
596
+ * Get the elapsed time of the current user session
597
+ * @param {function(err, res)} callback that returns a res of int seconds
598
+ */
599
+ sessionGetTimeElapsed: function (callback) {
600
+ callWithCallback('sessionGetTimeElapsed', null, callback);
601
+ },
602
+
603
+ /**
604
+ * Get the total number of vists by the user
605
+ * @deprecated - Since version 3.2.0. Use getUserAppLaunchCount() instead
606
+ * @param {function(err, res)} callback that returns a res of int
607
+ */
608
+ sessionGetTotalVisits: function (callback) {
609
+ callWithCallback('sessionGetTotalVisits', null, callback);
610
+ },
611
+
612
+ /**
613
+ * Get timestamp of user's last app visit
614
+ * @param {function(err, res)} callback that returns a res of epoch seconds or -1
615
+ */
616
+ getUserLastVisitTs: function (callback) {
617
+ callWithCallback('getUserLastVisitTs', null, callback);
618
+ },
619
+
620
+ /**
621
+ * Get the total number of times user has launched the app
622
+ * @param {function(err, res)} callback that returns a res of int
623
+ */
624
+ getUserAppLaunchCount: function (callback) {
625
+ callWithCallback('getUserAppLaunchCount', null, callback);
626
+ },
627
+
628
+ /**
629
+ * Get the number of screens viewed by the user during the session
630
+ * @param {function(err, res)} callback that returns a res of int
631
+ */
632
+ sessionGetScreenCount: function (callback) {
633
+ callWithCallback('sessionGetScreenCount', null, callback);
634
+ },
635
+
636
+ /**
637
+ * Get the most recent previous visit time of the user
638
+ * @deprecated - Since version 3.2.0. Use getUserLastVisits() instead
639
+ * @param {function(err, res)} callback that returns a res of epoch seconds or -1
640
+ */
641
+ sessionGetPreviousVisitTime: function (callback) {
642
+ callWithCallback('sessionGetPreviousVisitTime', null, callback);
643
+ },
644
+
645
+ /**
646
+ * Get the utm referrer info for the current session
647
+ * @param {function(err, res)} callback that returns a res of object {"source": <string>, "medium": <string>, "campaign": <string>} or empty object
648
+ */
649
+ sessionGetUTMDetails: function (callback) {
650
+ callWithCallback('sessionGetUTMDetails', null, callback);
651
+ },
652
+
653
+ /**
654
+ * Method to initalize the App Inbox
655
+ */
656
+ initializeInbox: function () {
657
+ CleverTapReact.initializeInbox();
658
+ },
659
+
660
+ /**
661
+ * Method to show the App Inbox
662
+ * @param {object} styleConfig - key-value profile properties. keys and values are strings
663
+ */
664
+ showInbox: function (styleConfig) {
665
+ CleverTapReact.showInbox(styleConfig);
666
+ },
667
+
668
+ /**
669
+ * Method to dismiss the App Inbox
670
+ */
671
+ dismissInbox: function () {
672
+ CleverTapReact.dismissInbox();
673
+ },
674
+
675
+ /**
676
+ * Get the total number of Inbox Messages
677
+ * @param {function(err, res)} callback that returns a res of count of inbox messages or -1
678
+ */
679
+ getInboxMessageCount: function (callback) {
680
+ callWithCallback('getInboxMessageCount', null, callback);
681
+ },
682
+
683
+ /**
684
+ * Get the total number of Unread Inbox Messages
685
+ * @param {function(err, res)} callback that returns a res of count of unread inbox messages or -1
686
+ */
687
+ getInboxMessageUnreadCount: function (callback) {
688
+ callWithCallback('getInboxMessageUnreadCount', null, callback);
689
+ },
690
+
691
+ /**
692
+ * Get All inbox messages
693
+ * @param {function(err, res)} callback that returns a list of json string representation of CTInboxMessage
694
+ */
695
+ getAllInboxMessages: function (callback) {
696
+ callWithCallback('getAllInboxMessages', null, callback);
697
+ },
698
+
699
+ /**
700
+ * Get All unread inbox messages
701
+ * @param {function(err, res)} callback that returns a list of json string representation of CTInboxMessage
702
+ */
703
+ getUnreadInboxMessages: function (callback) {
704
+ callWithCallback('getUnreadInboxMessages', null, callback);
705
+ },
706
+
707
+ /**
708
+ * Get Inbox Message that belongs to the given message id
709
+ * @param {function(err, res)} callback that returns json string representation of CTInboxMessage
710
+ */
711
+ getInboxMessageForId: function (messageId, callback) {
712
+ callWithCallback('getInboxMessageForId', [messageId], callback);
713
+ },
714
+
715
+ /**
716
+ * Deletes Inbox Message that belongs to the given message id
717
+ * @param {string} message id of inbox message of type CTInboxMessage
718
+ */
719
+ deleteInboxMessageForId: function (messageId) {
720
+ CleverTapReact.deleteInboxMessageForId(messageId);
721
+ },
722
+
723
+ /**
724
+ * Deletes multiple Inbox Messages that belongs to the given message ids
725
+ * @param {array} messageIds a collection of ids of inbox messages
726
+ */
727
+ deleteInboxMessagesForIDs: function (messageIds) {
728
+ CleverTapReact.deleteInboxMessagesForIDs(messageIds);
729
+ },
730
+
731
+ /**
732
+ * Marks Inbox Message that belongs to the given message id as read
733
+ * @param {string} message id of inbox message of type CTInboxMessage
734
+ */
735
+ markReadInboxMessageForId: function (messageId) {
736
+ CleverTapReact.markReadInboxMessageForId(messageId);
737
+ },
738
+
739
+ /**
740
+ * Marks multiple Inbox Messages that belongs to the given message ids as read
741
+ * @param {array} messageIds a collection of ids of inbox messages
742
+ */
743
+ markReadInboxMessagesForIDs: function (messageIds) {
744
+ CleverTapReact.markReadInboxMessagesForIDs(messageIds);
745
+ },
746
+
747
+ /**
748
+ * Pushes the Notification Clicked event for App Inbox to CleverTap.
749
+ * @param {string} message id of inbox message of type CTInboxMessage
750
+ */
751
+ pushInboxNotificationClickedEventForId: function (messageId) {
752
+ CleverTapReact.pushInboxNotificationClickedEventForId(messageId);
753
+ },
754
+
755
+ /**
756
+ * Pushes the Notification Viewed event for App Inbox to CleverTap.
757
+ * @param {string} message id of inbox message of type CTInboxMessage
758
+ */
759
+ pushInboxNotificationViewedEventForId: function (messageId) {
760
+ CleverTapReact.pushInboxNotificationViewedEventForId(messageId);
761
+ },
762
+
763
+ /**
764
+ * Get all display units
765
+ * @param {function(err, res)} callback that returns a list of json string representation of CleverTapDisplayUnit
766
+ */
767
+ getAllDisplayUnits: function (callback) {
768
+ callWithCallback('getAllDisplayUnits', null, callback);
769
+ },
770
+
771
+ /**
772
+ * Get display unit for given unitID.
773
+ * @param {string} unit id of display unit of type CleverTapDisplayUnit
774
+ * @param {function(err, res)} callback that returns a json string representation of CleverTapDisplayUnit
775
+ */
776
+ getDisplayUnitForId: function (unitID, callback) {
777
+ callWithCallback('getDisplayUnitForId', [unitID], callback);
778
+ },
779
+
780
+ /**
781
+ * Raises the Display Unit Viewed event
782
+ * @param {string} unit id of display unit of type CleverTapDisplayUnit
783
+ */
784
+ pushDisplayUnitViewedEventForID: function (unitID) {
785
+ CleverTapReact.pushDisplayUnitViewedEventForID(unitID);
786
+ },
787
+
788
+ /**
789
+ * Raises the Display Unit Clicked event
790
+ * @param {string} unit id of display unit of type CleverTapDisplayUnit
791
+ */
792
+ pushDisplayUnitClickedEventForID: function (unitID) {
793
+ CleverTapReact.pushDisplayUnitClickedEventForID(unitID);
794
+ },
795
+
796
+
797
+ /**
798
+ * @deprecated - Since version 1.1.0 and will be removed in the future versions of this SDK.
799
+ *
800
+ * Sets default product config params using the given object.
801
+ * @param {object} productConfigMap - key-value product config properties. keys are strings and values can be string, double, integer, boolean or json in string format.
802
+ */
803
+ setDefaultsMap: function (productConfigMap) {
804
+ CleverTapReact.setDefaultsMap(productConfigMap);
805
+ },
806
+
807
+ /**
808
+ * @deprecated - Since version 1.1.0 and will be removed in the future versions of this SDK.
809
+ *
810
+ * Starts fetching product configs, adhering to the default minimum fetch interval.
811
+ */
812
+ fetch: function () {
813
+ CleverTapReact.fetch();
814
+ },
815
+
816
+ /**
817
+ * @deprecated - Since version 1.1.0 and will be removed in the future versions of this SDK.
818
+ *
819
+ * Starts fetching product configs, adhering to the specified minimum fetch interval in seconds.
820
+ * @param {int} intervalInSecs - minimum fetch interval in seconds.
821
+ */
822
+ fetchWithMinimumIntervalInSeconds: function (intervalInSecs) {
823
+ CleverTapReact.fetchWithMinimumFetchIntervalInSeconds(intervalInSecs);
824
+ },
825
+
826
+ /**
827
+ * @deprecated - Since version 1.1.0 and will be removed in the future versions of this SDK.
828
+ *
829
+ * Activates the most recently fetched product configs, so that the fetched key value pairs take effect.
830
+ */
831
+ activate: function () {
832
+ CleverTapReact.activate();
833
+ },
834
+
835
+ /**
836
+ * @deprecated - Since version 1.1.0 and will be removed in the future versions of this SDK.
837
+ *
838
+ * Asynchronously fetches and then activates the fetched product configs.
839
+ */
840
+ fetchAndActivate: function () {
841
+ CleverTapReact.fetchAndActivate();
842
+ },
843
+
844
+ /**
845
+ * @deprecated - Since version 1.1.0 and will be removed in the future versions of this SDK.
846
+ *
847
+ * Sets the minimum interval in seconds between successive fetch calls.
848
+ * @param {int} intervalInSecs - interval in seconds between successive fetch calls.
849
+ */
850
+ setMinimumFetchIntervalInSeconds: function (intervalInSecs) {
851
+ CleverTapReact.setMinimumFetchIntervalInSeconds(intervalInSecs);
852
+ },
853
+
854
+ /**
855
+ * @deprecated - Since version 1.1.0 and will be removed in the future versions of this SDK.
856
+ *
857
+ * Deletes all activated, fetched and defaults configs as well as all Product Config settings.
858
+ */
859
+ resetProductConfig: function () {
860
+ CleverTapReact.reset();
861
+ },
862
+
863
+ /**
864
+ * @deprecated - Since version 1.1.0 and will be removed in the future versions of this SDK.
865
+ *
866
+ * Returns the product config parameter value for the given key as a String.
867
+ * @param {string} the property key
868
+ * @param {function(err, res)} callback that returns a value of type string if present else blank
869
+ */
870
+ getProductConfigString: function (key, callback) {
871
+ callWithCallback('getString', [key], callback);
872
+ },
873
+
874
+ /**
875
+ * @deprecated - Since version 1.1.0 and will be removed in the future versions of this SDK.
876
+ *
877
+ * Returns the product config parameter value for the given key as a boolean.
878
+ * @param {string} the property key
879
+ * @param {function(err, res)} callback that returns a value of type boolean if present else false
880
+ */
881
+ getProductConfigBoolean: function (key, callback) {
882
+ callWithCallback('getBoolean', [key], callback);
883
+ },
884
+
885
+ /**
886
+ * @deprecated - Since version 1.1.0 and will be removed in the future versions of this SDK.
887
+ *
888
+ * Returns the product config parameter value for the given key as a number.
889
+ * @param {string} the property key
890
+ * @param {function(err, res)} callback that returns a value of type number if present else 0
891
+ */
892
+ getNumber: function (key, callback) {
893
+ callWithCallback('getDouble', [key], callback);
894
+ },
895
+
896
+ /**
897
+ * @deprecated - Since version 1.1.0 and will be removed in the future versions of this SDK.
898
+ *
899
+ * Returns the last fetched timestamp in millis.
900
+ * @param {function(err, res)} callback that returns value of timestamp in millis as a string.
901
+ */
902
+ getLastFetchTimeStampInMillis: function (callback) {
903
+ callWithCallback('getLastFetchTimeStampInMillis', null, callback);
904
+ },
905
+
906
+ /**
907
+ * @deprecated - Since version 1.1.0 and will be removed in the future versions of this SDK.
908
+ *
909
+ * Getter to return the feature flag configured at the dashboard
910
+ * @param {string} key of the feature flag
911
+ * @param {string} default value of the key, in case we don't find any feature flag with the key.
912
+ * @param {function(err, res)} callback that returns a feature flag value of type boolean if present else provided default value
913
+ */
914
+ getFeatureFlag: function (name, defaultValue, callback) {
915
+ callWithCallback('getFeatureFlag', [name, defaultValue], callback);
916
+ },
917
+
918
+ /**
919
+ * Returns a unique identifier through callback by which CleverTap identifies this user
920
+ *
921
+ * @param {function(err, res)} non-null callback to retrieve identifier
922
+ */
923
+ getCleverTapID: function (callback) {
924
+ callWithCallback('getCleverTapID', null, callback);
925
+ },
926
+
927
+ /**
928
+ * Suspends display of InApp Notifications.
929
+ * The InApp Notifications are queued once this method is called
930
+ * and will be displayed once resumeInAppNotifications() is called.
931
+ */
932
+ suspendInAppNotifications: function () {
933
+ CleverTapReact.suspendInAppNotifications();
934
+ },
935
+
936
+ /**
937
+ * Suspends the display of InApp Notifications and discards any new InApp Notifications to be shown
938
+ * after this method is called.
939
+ * The InApp Notifications will be displayed only once resumeInAppNotifications() is called.
940
+ * @param {boolean} dismissInAppIfVisible - Optional. If true, dismisses the currently visible InApp notification.
941
+ */
942
+ discardInAppNotifications: function (dismissInAppIfVisible = false) {
943
+ CleverTapReact.discardInAppNotifications(dismissInAppIfVisible);
944
+ },
945
+
946
+ /**
947
+ * Resumes display of InApp Notifications.
948
+ *
949
+ * If suspendInAppNotifications() was called previously, calling this method will instantly show
950
+ * all queued InApp Notifications and also resume InApp Notifications on events raised after this
951
+ * method is called.
952
+ *
953
+ * If discardInAppNotifications() was called previously, calling this method will only resume
954
+ * InApp Notifications on events raised after this method is called.
955
+ */
956
+ resumeInAppNotifications: function () {
957
+ CleverTapReact.resumeInAppNotifications();
958
+ },
959
+
960
+ /**
961
+ * Set the SDK debug level
962
+ * @param {int} 0 = off, 1 = on
963
+ */
964
+ setDebugLevel: function (level) {
965
+ CleverTapReact.setDebugLevel(level);
966
+ },
967
+
968
+ /**
969
+ * Change the native instance of CleverTapAPI by using the instance for
970
+ * specific account. Used by Leanplum RN SDK.
971
+ *
972
+ * @param accountId The ID of the account to use when switching instance.
973
+ */
974
+ setInstanceWithAccountId: function (accountId) {
975
+ CleverTapReact.setInstanceWithAccountId(accountId);
976
+ },
977
+
978
+ /**
979
+ * Uploads variables to the server. Requires Development/Debug build/configuration.
980
+ */
981
+ syncVariables: function () {
982
+ CleverTapReact.syncVariables();
983
+ },
984
+
985
+ /**
986
+ * Uploads variables to the server.
987
+ *
988
+ * @param {boolean} isProduction Provide `true` if variables must be sync in Productuon build/configuration.
989
+ */
990
+ syncVariablesinProd: function (isProduction) {
991
+ CleverTapReact.syncVariablesinProd(isProduction)
992
+ },
993
+
994
+ /**
995
+ * Forces variables to update from the server.
996
+ *
997
+ */
998
+ fetchVariables: function (callback) {
999
+ callWithCallback('fetchVariables', null, callback);
1000
+ },
1001
+
1002
+ /**
1003
+ * Create variables.
1004
+ *
1005
+ * @param {object} variables The JSON Object specifying the varibles to be created.
1006
+ */
1007
+ defineVariables: function (variables) {
1008
+ CleverTapReact.defineVariables(variables);
1009
+ },
1010
+
1011
+ /**
1012
+ * Create File Variable
1013
+ * @param {string} fileVariable - the file variable string
1014
+ */
1015
+ defineFileVariable: function (fileVariable) {
1016
+ CleverTapReact.defineFileVariable(fileVariable)
1017
+ },
1018
+
1019
+ /**
1020
+ * Get a variable or a group for the specified name.
1021
+ *
1022
+ * @param {string} name - name.
1023
+ */
1024
+ getVariable: function (name, callback) {
1025
+ callWithCallback('getVariable', [name], callback);
1026
+ },
1027
+
1028
+ /**
1029
+ * Get all variables via a JSON object.
1030
+ *
1031
+ */
1032
+ getVariables: function (callback) {
1033
+ callWithCallback('getVariables', null, callback);
1034
+ },
1035
+
1036
+ /**
1037
+ * Adds a callback to be invoked when variables are initialised with server values. Will be called each time new values are fetched.
1038
+ *
1039
+ * @param {function} handler The callback to add
1040
+ */
1041
+ onVariablesChanged: function (handler) {
1042
+ CleverTapReact.onVariablesChanged();
1043
+ this.addListener(CleverTapReact.getConstants().CleverTapOnVariablesChanged, handler);
1044
+ },
1045
+
1046
+ /**
1047
+ * Adds a callback to be invoked only once on app start, or when added if server values are already received
1048
+ *
1049
+ * @param {function} handler The callback to add
1050
+ */
1051
+ onOneTimeVariablesChanged: function (handler) {
1052
+ this.addOneTimeListener(CleverTapReact.getConstants().CleverTapOnOneTimeVariablesChanged, handler);
1053
+ CleverTapReact.onOneTimeVariablesChanged();
1054
+ },
1055
+
1056
+ /**
1057
+ * Called when the value of the variable changes.
1058
+ *
1059
+ * @param {name} string the name of the variable
1060
+ * @param {function} handler The callback to add
1061
+ */
1062
+ onValueChanged: function (name, handler) {
1063
+ CleverTapReact.onValueChanged(name);
1064
+ this.addListener(CleverTapReact.getConstants().CleverTapOnValueChanged, handler);
1065
+ },
1066
+
1067
+ /**
1068
+ * Adds a callback to be invoked when variables are initialised with server values. Will be called each time new values are fetched.
1069
+ *
1070
+ * @param {function} handler The callback to add
1071
+ */
1072
+ onVariablesChangedAndNoDownloadsPending: function (handler) {
1073
+ this.addListener(CleverTapReact.getConstants().CleverTapOnVariablesChangedAndNoDownloadsPending, handler);
1074
+ CleverTapReact.onVariablesChangedAndNoDownloadsPending();
1075
+ },
1076
+
1077
+ /**
1078
+ * Adds a callback to be invoked only once for when new values are fetched and downloaded
1079
+ *
1080
+ * @param {function} handler The callback to add
1081
+ */
1082
+ onceVariablesChangedAndNoDownloadsPending: function (handler) {
1083
+ this.addOneTimeListener(CleverTapReact.getConstants().CleverTapOnceVariablesChangedAndNoDownloadsPending, handler);
1084
+ CleverTapReact.onceVariablesChangedAndNoDownloadsPending();
1085
+ },
1086
+
1087
+ /**
1088
+ * Called when the value of the file variable is downloaded and ready.
1089
+ *
1090
+ * @param {name} string the name of the file variable
1091
+ * @param {function} handler The callback to add
1092
+ */
1093
+ onFileValueChanged: function (name, handler) {
1094
+ this.addListener(CleverTapReact.getConstants().CleverTapOnFileValueChanged, handler);
1095
+ CleverTapReact.onFileValueChanged(name);
1096
+ },
1097
+
1098
+ /**
1099
+ * Fetches In Apps from server.
1100
+ *
1101
+ * @param callback {function(err, res)} a callback with a boolean flag whether the update was successful
1102
+ */
1103
+ fetchInApps: function (callback) {
1104
+ callWithCallback('fetchInApps', null, callback);
1105
+ },
1106
+
1107
+ /**
1108
+ * Deletes all images and gifs which are preloaded for inapps in cs mode
1109
+ *
1110
+ * @param {boolean} expiredOnly to clear only assets which will not be needed further for inapps
1111
+ */
1112
+ clearInAppResources: function (expiredOnly) {
1113
+ CleverTapReact.clearInAppResources(expiredOnly);
1114
+ },
1115
+
1116
+ /**
1117
+ * Uploads Custom in-app templates and app functions to the server.
1118
+ * Requires Development/Debug build/configuration.
1119
+ */
1120
+ syncCustomTemplates: function () {
1121
+ CleverTapReact.syncCustomTemplates();
1122
+ },
1123
+
1124
+ /**
1125
+ * Uploads Custom in-app templates and app functions to the server.
1126
+ *
1127
+ * @param {boolean} isProduction Provide `true` if templates must be sync in Productuon build/configuration.
1128
+ */
1129
+ syncCustomTemplatesInProd: function (isProduction) {
1130
+ CleverTapReact.syncCustomTemplatesInProd(isProduction)
1131
+ },
1132
+
1133
+ /**
1134
+ * Returns information about the active variants for the current user. Each variant will contain
1135
+ * an "id" key mapping to the numeric ID of the variant.
1136
+ *
1137
+ * @param {function(err, res)} callback that returns a list of variant objects
1138
+ */
1139
+ variants: function (callback) {
1140
+ callWithCallback('variants', null, callback);
1141
+ },
1142
+
1143
+ /**
1144
+ * Notify the SDK that an active custom template is dismissed. The active custom template is considered to be
1145
+ * visible to the user until this method is called. Since the SDK can show only one InApp message at a time, all
1146
+ * other messages will be queued until the current one is dismissed.
1147
+ *
1148
+ * @param {string} templateName The name of the active template
1149
+ */
1150
+ customTemplateSetDismissed: function (templateName) {
1151
+ return CleverTapReact.customTemplateSetDismissed(templateName);
1152
+ },
1153
+
1154
+ /**
1155
+ * Notify the SDK that an active custom template is presented to the user
1156
+ *
1157
+ * @param {string} templateName The name of the active template
1158
+ */
1159
+ customTemplateSetPresented: function (templateName) {
1160
+ return CleverTapReact.customTemplateSetPresented(templateName);
1161
+ },
1162
+
1163
+ /**
1164
+ * Trigger a custom template action argument by name.
1165
+ *
1166
+ * @param {string} templateName The name of an active template for which the action is defined
1167
+ * @param {string} argName The action argument name
1168
+ */
1169
+ customTemplateRunAction: function (templateName, argName) {
1170
+ return CleverTapReact.customTemplateRunAction(templateName, argName);
1171
+ },
1172
+
1173
+ /**
1174
+ * Retrieve a string argument by name.
1175
+ *
1176
+ * @param {string} templateName The name of an active template for which the argument is defined
1177
+ * @param {string} argName The action argument name
1178
+ *
1179
+ * @returns {string} The argument value or null if no such argument is defined for the template.
1180
+ */
1181
+ customTemplateGetStringArg: function (templateName, argName) {
1182
+ return CleverTapReact.customTemplateGetStringArg(templateName, argName);
1183
+ },
1184
+
1185
+ /**
1186
+ * Retrieve a number argument by name.
1187
+ *
1188
+ * @param {string} templateName The name of an active template for which the argument is defined
1189
+ * @param {string} argName The action argument name
1190
+ *
1191
+ * @returns {number} The argument value or null if no such argument is defined for the template.
1192
+ */
1193
+ customTemplateGetNumberArg: function (templateName, argName) {
1194
+ return CleverTapReact.customTemplateGetNumberArg(templateName, argName);
1195
+ },
1196
+
1197
+ /**
1198
+ * Retrieve a boolean argument by name.
1199
+ *
1200
+ * @param {string} templateName The name of an active template for which the argument is defined
1201
+ * @param {stirng} argName The action argument name
1202
+ *
1203
+ * @returns {boolean} The argument value or null if no such argument is defined for the template.
1204
+ */
1205
+ customTemplateGetBooleanArg: function (templateName, argName) {
1206
+ return CleverTapReact.customTemplateGetBooleanArg(templateName, argName);
1207
+ },
1208
+
1209
+ /**
1210
+ * Retrieve a file argument by name.
1211
+ *
1212
+ * @param {string} templateName The name of an active template for which the argument is defined
1213
+ * @param {string} argName The action argument name
1214
+ *
1215
+ * @returns {string} The file path to the file or null if no such argument is defined for the template.
1216
+ */
1217
+ customTemplateGetFileArg: function (templateName, argName) {
1218
+ return CleverTapReact.customTemplateGetFileArg(templateName, argName);
1219
+ },
1220
+
1221
+ /**
1222
+ * Retrieve an object argument by name.
1223
+ *
1224
+ * @param {string} templateName The name of an active template for which the argument is defined
1225
+ * @param {string} argName The action argument name
1226
+ *
1227
+ * @returns {any} The argument value or null if no such argument is defined for the template.
1228
+ */
1229
+ customTemplateGetObjectArg: function (templateName, argName) {
1230
+ return CleverTapReact.customTemplateGetObjectArg(templateName, argName);
1231
+ },
1232
+
1233
+ /**
1234
+ * Get a string representation of an active's template context with information about all arguments.
1235
+ *
1236
+ * @param {string} templateName The name of an active template
1237
+ * @returns {string}
1238
+ */
1239
+ customTemplateContextToString: function (templateName) {
1240
+ return CleverTapReact.customTemplateContextToString(templateName);
1241
+ }
1242
+ };
1243
+
1244
+ function convertDateToEpochInProperties(map) {
1245
+ /**
1246
+ * Conversion of date object in suitable CleverTap format(Epoch)
1247
+ * Recursively handles nested objects and arrays
1248
+ */
1249
+ if (map) {
1250
+ for (let [key, value] of Object.entries(map)) {
1251
+ if (Object.prototype.toString.call(value) === '[object Date]') {
1252
+ map[key] = "$D_" + Math.floor(value.getTime() / 1000);
1253
+ } else if (value !== null && typeof value === 'object' && !Array.isArray(value)) {
1254
+ // Recursively convert dates in nested objects
1255
+ convertDateToEpochInProperties(value);
1256
+ } else if (Array.isArray(value)) {
1257
+ value.forEach((item, index) => {
1258
+ if (Object.prototype.toString.call(item) === '[object Date]') {
1259
+ value[index] = "$D_" + Math.floor(item.getTime() / 1000);
1260
+ } else if (item !== null && typeof item === 'object') {
1261
+ convertDateToEpochInProperties(item);
1262
+ }
1263
+ });
1264
+ }
1265
+ }
1266
+ }
1267
+
1268
+ };
1269
+
1270
+ module.exports = CleverTap;