zixflow-reactnative 1.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 (284) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +451 -0
  3. package/android/build.gradle +155 -0
  4. package/android/cio-core.gradle +12 -0
  5. package/android/consumer-rules.pro +3 -0
  6. package/android/gradle.properties +5 -0
  7. package/android/src/main/AndroidManifest.xml +19 -0
  8. package/android/src/main/java/io/customer/reactnative/sdk/CustomerIOReactNativePackage.kt +85 -0
  9. package/android/src/main/java/io/customer/reactnative/sdk/NativeCustomerIOModule.kt +201 -0
  10. package/android/src/main/java/io/customer/reactnative/sdk/constant/Keys.kt +20 -0
  11. package/android/src/main/java/io/customer/reactnative/sdk/extension/MapExtensions.kt +92 -0
  12. package/android/src/main/java/io/customer/reactnative/sdk/extension/ReactExtensions.kt +11 -0
  13. package/android/src/main/java/io/customer/reactnative/sdk/extension/StringExtensions.kt +3 -0
  14. package/android/src/main/java/io/customer/reactnative/sdk/extension/ViewExtensions.kt +34 -0
  15. package/android/src/main/java/io/customer/reactnative/sdk/location/NativeLocationModule.kt +66 -0
  16. package/android/src/main/java/io/customer/reactnative/sdk/logging/NativeCustomerIOLoggingModule.kt +90 -0
  17. package/android/src/main/java/io/customer/reactnative/sdk/messaginginapp/InlineInAppMessageViewManager.kt +56 -0
  18. package/android/src/main/java/io/customer/reactnative/sdk/messaginginapp/NativeMessagingInAppModule.kt +215 -0
  19. package/android/src/main/java/io/customer/reactnative/sdk/messaginginapp/NotificationInboxExtensions.kt +23 -0
  20. package/android/src/main/java/io/customer/reactnative/sdk/messaginginapp/ReactInAppEventListener.kt +77 -0
  21. package/android/src/main/java/io/customer/reactnative/sdk/messaginginapp/ReactInAppPlatformDelegate.kt +37 -0
  22. package/android/src/main/java/io/customer/reactnative/sdk/messaginginapp/ReactInlineInAppMessageView.kt +44 -0
  23. package/android/src/main/java/io/customer/reactnative/sdk/messaginginapp/ReactNotificationInboxChangeListener.kt +47 -0
  24. package/android/src/main/java/io/customer/reactnative/sdk/messagingpush/NativeMessagingPushModule.kt +283 -0
  25. package/android/src/main/java/io/customer/reactnative/sdk/messagingpush/PermissionStatus.kt +9 -0
  26. package/android/src/main/java/io/customer/reactnative/sdk/messagingpush/PushMessagingExtensions.kt +58 -0
  27. package/android/src/main/java/io/customer/reactnative/sdk/util/Preconditions.kt +35 -0
  28. package/android/src/main/res/values/customer_io_config.xml +13 -0
  29. package/customerio-reactnative.podspec +60 -0
  30. package/ios/CustomerioReactnative.xcodeproj/project.pbxproj +285 -0
  31. package/ios/CustomerioReactnative.xcodeproj/project.xcworkspace/contents.xcworkspacedata +4 -0
  32. package/ios/CustomerioReactnative.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  33. package/ios/wrappers/CustomerioReactnative-Bridging-Header.h +2 -0
  34. package/ios/wrappers/NativeCustomerIO.mm +100 -0
  35. package/ios/wrappers/NativeCustomerIO.swift +162 -0
  36. package/ios/wrappers/inapp/InboxMessage+Conversion.swift +22 -0
  37. package/ios/wrappers/inapp/NativeMessagingInApp.mm +122 -0
  38. package/ios/wrappers/inapp/NativeMessagingInApp.swift +214 -0
  39. package/ios/wrappers/inapp/ReactInAppEventListener.swift +74 -0
  40. package/ios/wrappers/inapp/inline/InlineInAppMessageStateEvent.swift +23 -0
  41. package/ios/wrappers/inapp/inline/RCTInlineMessageNative.h +18 -0
  42. package/ios/wrappers/inapp/inline/RCTInlineMessageNative.mm +168 -0
  43. package/ios/wrappers/inapp/inline/ReactInlineMessageView.h +42 -0
  44. package/ios/wrappers/inapp/inline/ReactInlineMessageView.swift +124 -0
  45. package/ios/wrappers/location/NativeLocation.mm +52 -0
  46. package/ios/wrappers/location/NativeLocation.swift +37 -0
  47. package/ios/wrappers/logging/NativeCustomerIOLogging.mm +81 -0
  48. package/ios/wrappers/logging/NativeCustomerIOLogging.swift +62 -0
  49. package/ios/wrappers/push/NativeMessagingPush.mm +87 -0
  50. package/ios/wrappers/push/NativeMessagingPush.swift +119 -0
  51. package/ios/wrappers/utils/CioConfigUtils.swift +63 -0
  52. package/ios/wrappers/utils/CioConstants.swift +25 -0
  53. package/ios/wrappers/utils/Preconditions.swift +20 -0
  54. package/ios/wrappers/utils/RCTCustomerIOUtils.h +19 -0
  55. package/lib/commonjs/cio-params.js +2 -0
  56. package/lib/commonjs/cio-params.js.map +1 -0
  57. package/lib/commonjs/components/InlineInAppMessageView.js +146 -0
  58. package/lib/commonjs/components/InlineInAppMessageView.js.map +1 -0
  59. package/lib/commonjs/components/index.js +14 -0
  60. package/lib/commonjs/components/index.js.map +1 -0
  61. package/lib/commonjs/customerio-cdp.js +163 -0
  62. package/lib/commonjs/customerio-cdp.js.map +1 -0
  63. package/lib/commonjs/customerio-inapp.js +107 -0
  64. package/lib/commonjs/customerio-inapp.js.map +1 -0
  65. package/lib/commonjs/customerio-location.js +53 -0
  66. package/lib/commonjs/customerio-location.js.map +1 -0
  67. package/lib/commonjs/customerio-push.js +115 -0
  68. package/lib/commonjs/customerio-push.js.map +1 -0
  69. package/lib/commonjs/index.js +17 -0
  70. package/lib/commonjs/index.js.map +1 -0
  71. package/lib/commonjs/native-logger-listener.js +84 -0
  72. package/lib/commonjs/native-logger-listener.js.map +1 -0
  73. package/lib/commonjs/notification-inbox.js +132 -0
  74. package/lib/commonjs/notification-inbox.js.map +1 -0
  75. package/lib/commonjs/package.json +1 -0
  76. package/lib/commonjs/postInstall.js +13 -0
  77. package/lib/commonjs/postInstall.js.map +1 -0
  78. package/lib/commonjs/specs/components/InlineMessageNativeComponent.ts +59 -0
  79. package/lib/commonjs/specs/modules/NativeCustomerIO.js +40 -0
  80. package/lib/commonjs/specs/modules/NativeCustomerIO.js.map +1 -0
  81. package/lib/commonjs/specs/modules/NativeCustomerIOLocation.js +15 -0
  82. package/lib/commonjs/specs/modules/NativeCustomerIOLocation.js.map +1 -0
  83. package/lib/commonjs/specs/modules/NativeCustomerIOLogging.js +19 -0
  84. package/lib/commonjs/specs/modules/NativeCustomerIOLogging.js.map +1 -0
  85. package/lib/commonjs/specs/modules/NativeCustomerIOMessagingInApp.js +16 -0
  86. package/lib/commonjs/specs/modules/NativeCustomerIOMessagingInApp.js.map +1 -0
  87. package/lib/commonjs/specs/modules/NativeCustomerIOMessagingPush.js +15 -0
  88. package/lib/commonjs/specs/modules/NativeCustomerIOMessagingPush.js.map +1 -0
  89. package/lib/commonjs/types/data-pipelines.js +123 -0
  90. package/lib/commonjs/types/data-pipelines.js.map +1 -0
  91. package/lib/commonjs/types/in-app.js +43 -0
  92. package/lib/commonjs/types/in-app.js.map +1 -0
  93. package/lib/commonjs/types/index.js +39 -0
  94. package/lib/commonjs/types/index.js.map +1 -0
  95. package/lib/commonjs/types/internal.js +2 -0
  96. package/lib/commonjs/types/internal.js.map +1 -0
  97. package/lib/commonjs/types/push.js +49 -0
  98. package/lib/commonjs/types/push.js.map +1 -0
  99. package/lib/commonjs/utils/native-bridge.js +31 -0
  100. package/lib/commonjs/utils/native-bridge.js.map +1 -0
  101. package/lib/commonjs/utils/param-validation.js +136 -0
  102. package/lib/commonjs/utils/param-validation.js.map +1 -0
  103. package/lib/commonjs/zixflow.js +71 -0
  104. package/lib/commonjs/zixflow.js.map +1 -0
  105. package/lib/module/cio-params.js +2 -0
  106. package/lib/module/cio-params.js.map +1 -0
  107. package/lib/module/components/InlineInAppMessageView.js +141 -0
  108. package/lib/module/components/InlineInAppMessageView.js.map +1 -0
  109. package/lib/module/components/index.js +6 -0
  110. package/lib/module/components/index.js.map +1 -0
  111. package/lib/module/customerio-cdp.js +157 -0
  112. package/lib/module/customerio-cdp.js.map +1 -0
  113. package/lib/module/customerio-inapp.js +92 -0
  114. package/lib/module/customerio-inapp.js.map +1 -0
  115. package/lib/module/customerio-location.js +48 -0
  116. package/lib/module/customerio-location.js.map +1 -0
  117. package/lib/module/customerio-push.js +111 -0
  118. package/lib/module/customerio-push.js.map +1 -0
  119. package/lib/module/index.js +12 -0
  120. package/lib/module/index.js.map +1 -0
  121. package/lib/module/native-logger-listener.js +79 -0
  122. package/lib/module/native-logger-listener.js.map +1 -0
  123. package/lib/module/notification-inbox.js +127 -0
  124. package/lib/module/notification-inbox.js.map +1 -0
  125. package/lib/module/package.json +1 -0
  126. package/lib/module/postInstall.js +13 -0
  127. package/lib/module/postInstall.js.map +1 -0
  128. package/lib/module/specs/components/InlineMessageNativeComponent.ts +59 -0
  129. package/lib/module/specs/modules/NativeCustomerIO.js +41 -0
  130. package/lib/module/specs/modules/NativeCustomerIO.js.map +1 -0
  131. package/lib/module/specs/modules/NativeCustomerIOLocation.js +13 -0
  132. package/lib/module/specs/modules/NativeCustomerIOLocation.js.map +1 -0
  133. package/lib/module/specs/modules/NativeCustomerIOLogging.js +18 -0
  134. package/lib/module/specs/modules/NativeCustomerIOLogging.js.map +1 -0
  135. package/lib/module/specs/modules/NativeCustomerIOMessagingInApp.js +15 -0
  136. package/lib/module/specs/modules/NativeCustomerIOMessagingInApp.js.map +1 -0
  137. package/lib/module/specs/modules/NativeCustomerIOMessagingPush.js +13 -0
  138. package/lib/module/specs/modules/NativeCustomerIOMessagingPush.js.map +1 -0
  139. package/lib/module/types/data-pipelines.js +126 -0
  140. package/lib/module/types/data-pipelines.js.map +1 -0
  141. package/lib/module/types/in-app.js +42 -0
  142. package/lib/module/types/in-app.js.map +1 -0
  143. package/lib/module/types/index.js +6 -0
  144. package/lib/module/types/index.js.map +1 -0
  145. package/lib/module/types/internal.js +2 -0
  146. package/lib/module/types/internal.js.map +1 -0
  147. package/lib/module/types/push.js +47 -0
  148. package/lib/module/types/push.js.map +1 -0
  149. package/lib/module/utils/native-bridge.js +25 -0
  150. package/lib/module/utils/native-bridge.js.map +1 -0
  151. package/lib/module/utils/param-validation.js +132 -0
  152. package/lib/module/utils/param-validation.js.map +1 -0
  153. package/lib/module/zixflow.js +23 -0
  154. package/lib/module/zixflow.js.map +1 -0
  155. package/lib/typescript/commonjs/cio-params.d.ts +5 -0
  156. package/lib/typescript/commonjs/cio-params.d.ts.map +1 -0
  157. package/lib/typescript/commonjs/components/InlineInAppMessageView.d.ts +41 -0
  158. package/lib/typescript/commonjs/components/InlineInAppMessageView.d.ts.map +1 -0
  159. package/lib/typescript/commonjs/components/index.d.ts +3 -0
  160. package/lib/typescript/commonjs/components/index.d.ts.map +1 -0
  161. package/lib/typescript/commonjs/customerio-cdp.d.ts +40 -0
  162. package/lib/typescript/commonjs/customerio-cdp.d.ts.map +1 -0
  163. package/lib/typescript/commonjs/customerio-inapp.d.ts +48 -0
  164. package/lib/typescript/commonjs/customerio-inapp.d.ts.map +1 -0
  165. package/lib/typescript/commonjs/customerio-location.d.ts +31 -0
  166. package/lib/typescript/commonjs/customerio-location.d.ts.map +1 -0
  167. package/lib/typescript/commonjs/customerio-push.d.ts +56 -0
  168. package/lib/typescript/commonjs/customerio-push.d.ts.map +1 -0
  169. package/lib/typescript/commonjs/index.d.ts +8 -0
  170. package/lib/typescript/commonjs/index.d.ts.map +1 -0
  171. package/lib/typescript/commonjs/native-logger-listener.d.ts +8 -0
  172. package/lib/typescript/commonjs/native-logger-listener.d.ts.map +1 -0
  173. package/lib/typescript/commonjs/notification-inbox.d.ts +57 -0
  174. package/lib/typescript/commonjs/notification-inbox.d.ts.map +1 -0
  175. package/lib/typescript/commonjs/package.json +1 -0
  176. package/lib/typescript/commonjs/postInstall.d.ts +2 -0
  177. package/lib/typescript/commonjs/postInstall.d.ts.map +1 -0
  178. package/lib/typescript/commonjs/specs/components/InlineMessageNativeComponent.d.ts +40 -0
  179. package/lib/typescript/commonjs/specs/components/InlineMessageNativeComponent.d.ts.map +1 -0
  180. package/lib/typescript/commonjs/specs/modules/NativeCustomerIO.d.ts +46 -0
  181. package/lib/typescript/commonjs/specs/modules/NativeCustomerIO.d.ts.map +1 -0
  182. package/lib/typescript/commonjs/specs/modules/NativeCustomerIOLocation.d.ts +14 -0
  183. package/lib/typescript/commonjs/specs/modules/NativeCustomerIOLocation.d.ts.map +1 -0
  184. package/lib/typescript/commonjs/specs/modules/NativeCustomerIOLogging.d.ts +18 -0
  185. package/lib/typescript/commonjs/specs/modules/NativeCustomerIOLogging.d.ts.map +1 -0
  186. package/lib/typescript/commonjs/specs/modules/NativeCustomerIOMessagingInApp.d.ts +23 -0
  187. package/lib/typescript/commonjs/specs/modules/NativeCustomerIOMessagingInApp.d.ts.map +1 -0
  188. package/lib/typescript/commonjs/specs/modules/NativeCustomerIOMessagingPush.d.ts +20 -0
  189. package/lib/typescript/commonjs/specs/modules/NativeCustomerIOMessagingPush.d.ts.map +1 -0
  190. package/lib/typescript/commonjs/types/data-pipelines.d.ts +143 -0
  191. package/lib/typescript/commonjs/types/data-pipelines.d.ts.map +1 -0
  192. package/lib/typescript/commonjs/types/in-app.d.ts +67 -0
  193. package/lib/typescript/commonjs/types/in-app.d.ts.map +1 -0
  194. package/lib/typescript/commonjs/types/index.d.ts +4 -0
  195. package/lib/typescript/commonjs/types/index.d.ts.map +1 -0
  196. package/lib/typescript/commonjs/types/internal.d.ts +20 -0
  197. package/lib/typescript/commonjs/types/internal.d.ts.map +1 -0
  198. package/lib/typescript/commonjs/types/push.d.ts +49 -0
  199. package/lib/typescript/commonjs/types/push.d.ts.map +1 -0
  200. package/lib/typescript/commonjs/utils/native-bridge.d.ts +9 -0
  201. package/lib/typescript/commonjs/utils/native-bridge.d.ts.map +1 -0
  202. package/lib/typescript/commonjs/utils/param-validation.d.ts +44 -0
  203. package/lib/typescript/commonjs/utils/param-validation.d.ts.map +1 -0
  204. package/lib/typescript/commonjs/zixflow.d.ts +14 -0
  205. package/lib/typescript/commonjs/zixflow.d.ts.map +1 -0
  206. package/lib/typescript/module/cio-params.d.ts +5 -0
  207. package/lib/typescript/module/cio-params.d.ts.map +1 -0
  208. package/lib/typescript/module/components/InlineInAppMessageView.d.ts +41 -0
  209. package/lib/typescript/module/components/InlineInAppMessageView.d.ts.map +1 -0
  210. package/lib/typescript/module/components/index.d.ts +3 -0
  211. package/lib/typescript/module/components/index.d.ts.map +1 -0
  212. package/lib/typescript/module/customerio-cdp.d.ts +40 -0
  213. package/lib/typescript/module/customerio-cdp.d.ts.map +1 -0
  214. package/lib/typescript/module/customerio-inapp.d.ts +48 -0
  215. package/lib/typescript/module/customerio-inapp.d.ts.map +1 -0
  216. package/lib/typescript/module/customerio-location.d.ts +31 -0
  217. package/lib/typescript/module/customerio-location.d.ts.map +1 -0
  218. package/lib/typescript/module/customerio-push.d.ts +56 -0
  219. package/lib/typescript/module/customerio-push.d.ts.map +1 -0
  220. package/lib/typescript/module/index.d.ts +8 -0
  221. package/lib/typescript/module/index.d.ts.map +1 -0
  222. package/lib/typescript/module/native-logger-listener.d.ts +8 -0
  223. package/lib/typescript/module/native-logger-listener.d.ts.map +1 -0
  224. package/lib/typescript/module/notification-inbox.d.ts +57 -0
  225. package/lib/typescript/module/notification-inbox.d.ts.map +1 -0
  226. package/lib/typescript/module/package.json +1 -0
  227. package/lib/typescript/module/postInstall.d.ts +2 -0
  228. package/lib/typescript/module/postInstall.d.ts.map +1 -0
  229. package/lib/typescript/module/specs/components/InlineMessageNativeComponent.d.ts +40 -0
  230. package/lib/typescript/module/specs/components/InlineMessageNativeComponent.d.ts.map +1 -0
  231. package/lib/typescript/module/specs/modules/NativeCustomerIO.d.ts +46 -0
  232. package/lib/typescript/module/specs/modules/NativeCustomerIO.d.ts.map +1 -0
  233. package/lib/typescript/module/specs/modules/NativeCustomerIOLocation.d.ts +14 -0
  234. package/lib/typescript/module/specs/modules/NativeCustomerIOLocation.d.ts.map +1 -0
  235. package/lib/typescript/module/specs/modules/NativeCustomerIOLogging.d.ts +18 -0
  236. package/lib/typescript/module/specs/modules/NativeCustomerIOLogging.d.ts.map +1 -0
  237. package/lib/typescript/module/specs/modules/NativeCustomerIOMessagingInApp.d.ts +23 -0
  238. package/lib/typescript/module/specs/modules/NativeCustomerIOMessagingInApp.d.ts.map +1 -0
  239. package/lib/typescript/module/specs/modules/NativeCustomerIOMessagingPush.d.ts +20 -0
  240. package/lib/typescript/module/specs/modules/NativeCustomerIOMessagingPush.d.ts.map +1 -0
  241. package/lib/typescript/module/types/data-pipelines.d.ts +143 -0
  242. package/lib/typescript/module/types/data-pipelines.d.ts.map +1 -0
  243. package/lib/typescript/module/types/in-app.d.ts +67 -0
  244. package/lib/typescript/module/types/in-app.d.ts.map +1 -0
  245. package/lib/typescript/module/types/index.d.ts +4 -0
  246. package/lib/typescript/module/types/index.d.ts.map +1 -0
  247. package/lib/typescript/module/types/internal.d.ts +20 -0
  248. package/lib/typescript/module/types/internal.d.ts.map +1 -0
  249. package/lib/typescript/module/types/push.d.ts +49 -0
  250. package/lib/typescript/module/types/push.d.ts.map +1 -0
  251. package/lib/typescript/module/utils/native-bridge.d.ts +9 -0
  252. package/lib/typescript/module/utils/native-bridge.d.ts.map +1 -0
  253. package/lib/typescript/module/utils/param-validation.d.ts +44 -0
  254. package/lib/typescript/module/utils/param-validation.d.ts.map +1 -0
  255. package/lib/typescript/module/zixflow.d.ts +14 -0
  256. package/lib/typescript/module/zixflow.d.ts.map +1 -0
  257. package/package.json +165 -0
  258. package/src/cio-params.ts +4 -0
  259. package/src/components/InlineInAppMessageView.tsx +187 -0
  260. package/src/components/index.ts +3 -0
  261. package/src/customerio-cdp.ts +190 -0
  262. package/src/customerio-inapp.ts +127 -0
  263. package/src/customerio-location.ts +56 -0
  264. package/src/customerio-push.ts +127 -0
  265. package/src/index.ts +9 -0
  266. package/src/native-logger-listener.ts +84 -0
  267. package/src/notification-inbox.ts +154 -0
  268. package/src/postInstall.js +10 -0
  269. package/src/specs/components/InlineMessageNativeComponent.ts +59 -0
  270. package/src/specs/modules/NativeCustomerIO.ts +55 -0
  271. package/src/specs/modules/NativeCustomerIOLocation.ts +15 -0
  272. package/src/specs/modules/NativeCustomerIOLogging.ts +24 -0
  273. package/src/specs/modules/NativeCustomerIOMessagingInApp.ts +30 -0
  274. package/src/specs/modules/NativeCustomerIOMessagingPush.ts +27 -0
  275. package/src/types/data-pipelines.ts +150 -0
  276. package/src/types/in-app.ts +69 -0
  277. package/src/types/index.ts +3 -0
  278. package/src/types/internal.ts +20 -0
  279. package/src/types/push.ts +50 -0
  280. package/src/utils/native-bridge.ts +30 -0
  281. package/src/utils/param-validation.ts +178 -0
  282. package/src/zixflow.ts +24 -0
  283. package/zixflow-reactnative-richpush.podspec +42 -0
  284. package/zixflow-reactnative.podspec +66 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-pipelines.d.ts","sourceRoot":"","sources":["../../../../src/types/data-pipelines.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,QAAQ,CAAC;AAEvD;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAEnD;;;;;;;GAOG;AACH,MAAM,WAAW,cAAc;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,gBAAgB,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,MAAM,SAAS,GAAG;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,QAAQ,CAAC,EAAE,WAAW,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,UAAU,CAAC;IAC3B,+BAA+B,CAAC,EAAE,OAAO,CAAC;IAC1C,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,KAAK,CAAC,EAAE;QACN,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,IAAI,CAAC,EAAE;QACL,OAAO,CAAC,EAAE;YACR,iBAAiB,CAAC,EAAE,wBAAwB,CAAC;SAC9C,CAAC;KACH,CAAC;IACF,QAAQ,CAAC,EAAE;QACT,mFAAmF;QACnF,YAAY,CAAC,EAAE,uBAAuB,CAAC;KACxC,CAAC;CACH,CAAC;AAEF;;;;;;GAMG;AACH,oBAAY,WAAW;IACrB,wBAAwB;IACxB,IAAI,SAAS;IACb,0BAA0B;IAC1B,KAAK,UAAU;IACf,uCAAuC;IACvC,IAAI,SAAS;IACb,+CAA+C;IAC/C,KAAK,UAAU;CAChB;AAED;;;;GAIG;AACH,oBAAY,SAAS;IACnB,EAAE,OAAO;IACT,EAAE,OAAO;CACV;AAED;;;;;;;GAOG;AACH,oBAAY,UAAU;IACpB,qEAAqE;IACrE,GAAG,QAAQ;IACX,+DAA+D;IAC/D,KAAK,UAAU;CAChB;AAED;;;;GAIG;AACH,oBAAY,uBAAuB;IACjC,oEAAoE;IACpE,GAAG,QAAQ;IACX,8FAA8F;IAC9F,MAAM,WAAW;IACjB,kFAAkF;IAClF,UAAU,iBAAiB;CAC5B;AAED;;;;GAIG;AACH,oBAAY,WAAW;IACrB,oDAAoD;IACpD,SAAS,cAAc;IACvB,+CAA+C;IAC/C,MAAM,WAAW;IACjB,iDAAiD;IACjD,SAAS,cAAc;CACxB"}
@@ -0,0 +1,67 @@
1
+ /**
2
+ * In-app message data structure for event callbacks.
3
+ *
4
+ * Contains metadata about displayed in-app messages that can be used
5
+ * for tracking user interactions and message performance analytics.
6
+ *
7
+ * @public
8
+ */
9
+ export interface InAppMessage {
10
+ /** Unique identifier for the message template */
11
+ messageId: string;
12
+ /** Unique identifier for this specific message delivery */
13
+ deliveryId?: string;
14
+ /** Element ID for inline message UI component that was interacted with */
15
+ elementId?: string;
16
+ }
17
+ /**
18
+ * Enum to represent the type of event triggered by in-app event callback.
19
+ *
20
+ * @public
21
+ */
22
+ export declare enum InAppMessageEventType {
23
+ errorWithMessage = "errorWithMessage",
24
+ messageActionTaken = "messageActionTaken",
25
+ messageDismissed = "messageDismissed",
26
+ messageShown = "messageShown"
27
+ }
28
+ /**
29
+ * Represents an inbox message for a user.
30
+ *
31
+ * Inbox messages are persistent messages that can be displayed in a message center or inbox UI.
32
+ * They support read/unread states, expiration, and custom properties.
33
+ *
34
+ * @public
35
+ */
36
+ export interface InboxMessage {
37
+ /** Internal queue identifier (for SDK use) */
38
+ queueId: string;
39
+ /** Unique identifier for this message delivery */
40
+ deliveryId?: string;
41
+ /** Expiration date for the message. Messages may be hidden after this date. */
42
+ expiry?: number;
43
+ /** Date when the message was sent (Unix timestamp in milliseconds) */
44
+ sentAt: number;
45
+ /** List of topic identifiers associated with this message */
46
+ topics: string[];
47
+ /** Message type identifier */
48
+ type: string;
49
+ /** Whether the user has opened/read this message */
50
+ opened: boolean;
51
+ /** Priority for message ordering. Lower values = higher priority (e.g., 1 is higher priority than 100) */
52
+ priority?: number;
53
+ /** Custom key-value properties associated with this message */
54
+ properties: Record<string, any>;
55
+ }
56
+ /**
57
+ * Listener for notification inbox message changes.
58
+ *
59
+ * Receives real-time notifications when inbox messages are added, updated, or removed.
60
+ * Callbacks are invoked on the main thread for safe UI updates.
61
+ *
62
+ * @public
63
+ */
64
+ export type NotificationInboxChangeListener = {
65
+ onMessagesChanged: (messages: InboxMessage[]) => void;
66
+ };
67
+ //# sourceMappingURL=in-app.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"in-app.d.ts","sourceRoot":"","sources":["../../../../src/types/in-app.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,WAAW,YAAY;IAC3B,iDAAiD;IACjD,SAAS,EAAE,MAAM,CAAC;IAClB,2DAA2D;IAC3D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,0EAA0E;IAC1E,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;GAIG;AACH,oBAAY,qBAAqB;IAC/B,gBAAgB,qBAAqB;IACrC,kBAAkB,uBAAuB;IACzC,gBAAgB,qBAAqB;IACrC,YAAY,iBAAiB;CAC9B;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,YAAY;IAC3B,8CAA8C;IAC9C,OAAO,EAAE,MAAM,CAAC;IAChB,kDAAkD;IAClD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,+EAA+E;IAC/E,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,sEAAsE;IACtE,MAAM,EAAE,MAAM,CAAC;IACf,6DAA6D;IAC7D,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,8BAA8B;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,oDAAoD;IACpD,MAAM,EAAE,OAAO,CAAC;IAChB,0GAA0G;IAC1G,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,+DAA+D;IAC/D,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACjC;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,+BAA+B,GAAG;IAC5C,iBAAiB,EAAE,CAAC,QAAQ,EAAE,YAAY,EAAE,KAAK,IAAI,CAAC;CACvD,CAAC"}
@@ -0,0 +1,4 @@
1
+ export * from './data-pipelines';
2
+ export * from './in-app';
3
+ export * from './push';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Internal-only types used within the Customer.io React Native SDK implementation.
3
+ *
4
+ * Not intended for public use.
5
+ */
6
+ /**
7
+ * Arguments passed to native SDK for package identification.
8
+ *
9
+ * Provides metadata about the host environment and SDK version to native
10
+ * CustomerIO SDK for debugging and analytics.
11
+ *
12
+ * @internal
13
+ */
14
+ export type NativeSDKArgs = {
15
+ /** The package manager or framework hosting the SDK (ReactNative, Expo) */
16
+ packageSource: string;
17
+ /** Version of the SDK package being used */
18
+ packageVersion: string;
19
+ };
20
+ //# sourceMappingURL=internal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../../src/types/internal.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;GAOG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,2EAA2E;IAC3E,aAAa,EAAE,MAAM,CAAC;IACtB,4CAA4C;IAC5C,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC"}
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Android-specific behavior when a push notification is clicked.
3
+ *
4
+ * Controls how the Android system handles activity lifecycle
5
+ * when users tap on push notifications.
6
+ *
7
+ * @public
8
+ */
9
+ export declare enum PushClickBehaviorAndroid {
10
+ /** Clear the activity task stack and start fresh */
11
+ ResetTaskStack = "RESET_TASK_STACK",
12
+ /** Prevent the current activity from restarting */
13
+ ActivityPreventRestart = "ACTIVITY_PREVENT_RESTART",
14
+ /** Use default behavior without special flags */
15
+ ActivityNoFlags = "ACTIVITY_NO_FLAGS"
16
+ }
17
+ /**
18
+ * Push notification permission request options.
19
+ *
20
+ * Configure which types of notifications to request permission for
21
+ * on different platforms.
22
+ *
23
+ * @public
24
+ */
25
+ export type CioPushPermissionOptions = {
26
+ ios?: {
27
+ /** Request permission to show badge numbers on app icon */
28
+ badge: boolean;
29
+ /** Request permission to play notification sounds */
30
+ sound: boolean;
31
+ };
32
+ };
33
+ /**
34
+ * Current push notification permission status.
35
+ *
36
+ * Indicates whether the user has granted, denied, or not yet
37
+ * responded to push notification permission requests.
38
+ *
39
+ * @public
40
+ */
41
+ export declare enum CioPushPermissionStatus {
42
+ /** User has granted push notification permissions */
43
+ Granted = "GRANTED",
44
+ /** User has denied push notification permissions */
45
+ Denied = "DENIED",
46
+ /** User may not yet have been asked for permissions and permission status is unknown */
47
+ NotDetermined = "NOTDETERMINED"
48
+ }
49
+ //# sourceMappingURL=push.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"push.d.ts","sourceRoot":"","sources":["../../../../src/types/push.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,oBAAY,wBAAwB;IAClC,oDAAoD;IACpD,cAAc,qBAAqB;IACnC,mDAAmD;IACnD,sBAAsB,6BAA6B;IACnD,iDAAiD;IACjD,eAAe,sBAAsB;CACtC;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,wBAAwB,GAAG;IACrC,GAAG,CAAC,EAAE;QACJ,2DAA2D;QAC3D,KAAK,EAAE,OAAO,CAAC;QACf,qDAAqD;QACrD,KAAK,EAAE,OAAO,CAAC;KAChB,CAAC;CACH,CAAC;AAEF;;;;;;;GAOG;AACH,oBAAY,uBAAuB;IACjC,qDAAqD;IACrD,OAAO,YAAY;IACnB,oDAAoD;IACpD,MAAM,WAAW;IACjB,wFAAwF;IACxF,aAAa,kBAAkB;CAChC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Ensures the native module is available, otherwise throws a helpful linking error.
3
+ */
4
+ export declare function ensureNativeModule<NativeModule>(nativeModule: NativeModule | null): NativeModule;
5
+ /**
6
+ * Calls a method on a native module with type-safe access.
7
+ */
8
+ export declare const callNativeModule: <Spec, Result>(nativeModule: Spec, fn: (native: Spec) => Result) => Result;
9
+ //# sourceMappingURL=native-bridge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"native-bridge.d.ts","sourceRoot":"","sources":["../../../../src/utils/native-bridge.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,YAAY,EAC7C,YAAY,EAAE,YAAY,GAAG,IAAI,GAChC,YAAY,CAMd;AAED;;GAEG;AACH,eAAO,MAAM,gBAAgB,GAAI,IAAI,EAAE,MAAM,EAC3C,cAAc,IAAI,EAClB,IAAI,CAAC,MAAM,EAAE,IAAI,KAAK,MAAM,KAC3B,MAEF,CAAC"}
@@ -0,0 +1,44 @@
1
+ import type { CioConfig, CustomAttributes } from '../types';
2
+ /**
3
+ * Returns true if the value is undefined or null.
4
+ */
5
+ declare function isUndefined(value: unknown): boolean;
6
+ /**
7
+ * Validates that a value is a string.
8
+ * Throws if the value is not a string, or if it's empty (unless allowEmpty is true).
9
+ */
10
+ declare function validateString(value: unknown, fieldName: string, options?: {
11
+ allowEmpty?: boolean;
12
+ usage?: string;
13
+ optional?: boolean;
14
+ }): void;
15
+ /**
16
+ * Validates that a value is a plain object (not null or an array).
17
+ */
18
+ declare function validateRecord(value: unknown, fieldName: string, options?: {
19
+ usage?: string;
20
+ expectedType?: string;
21
+ optional?: boolean;
22
+ }): void;
23
+ /**
24
+ * Validates that a value is a valid CustomAttributes object.
25
+ * Automatically converts Map objects to plain objects for compatibility.
26
+ * This is a specialized version of validateRecord optimized for attribute validation.
27
+ */
28
+ declare function validateAttributes(value: unknown, fieldName: string, options?: {
29
+ usage?: string;
30
+ expectedType?: string;
31
+ optional?: boolean;
32
+ }): CustomAttributes | undefined;
33
+ type ConfigValidator = (value: unknown) => asserts value is CioConfig;
34
+ export declare const assert: {
35
+ string: typeof validateString;
36
+ record: typeof validateRecord;
37
+ attributes: typeof validateAttributes;
38
+ config: ConfigValidator;
39
+ };
40
+ export declare const validate: {
41
+ isUndefined: typeof isUndefined;
42
+ };
43
+ export {};
44
+ //# sourceMappingURL=param-validation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"param-validation.d.ts","sourceRoot":"","sources":["../../../../src/utils/param-validation.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAc5D;;GAEG;AACH,iBAAS,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAE5C;AA0BD;;;GAGG;AACH,iBAAS,cAAc,CACrB,KAAK,EAAE,OAAO,EACd,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE;IACP,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;CACG,QAqBzB;AAED;;GAEG;AACH,iBAAS,cAAc,CACrB,KAAK,EAAE,OAAO,EACd,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE;IACP,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACf,QAeP;AAED;;;;GAIG;AACH,iBAAS,kBAAkB,CACzB,KAAK,EAAE,OAAO,EACd,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE;IACP,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACf,GACL,gBAAgB,GAAG,SAAS,CAe9B;AAwBD,KAAK,eAAe,GAAG,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC,KAAK,IAAI,SAAS,CAAC;AAEtE,eAAO,MAAM,MAAM,EAAE;IACnB,MAAM,EAAE,OAAO,cAAc,CAAC;IAC9B,MAAM,EAAE,OAAO,cAAc,CAAC;IAC9B,UAAU,EAAE,OAAO,kBAAkB,CAAC;IACtC,MAAM,EAAE,eAAe,CAAC;CAMzB,CAAC;AAEF,eAAO,MAAM,QAAQ;;CAEpB,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Zixflow SDK - Main entry point
3
+ *
4
+ * This provides the Zixflow-branded API that wraps the underlying Customer.io implementation.
5
+ */
6
+ import { CustomerIO } from './customerio-cdp';
7
+ import { CustomerIOInAppMessaging } from './customerio-inapp';
8
+ import { CustomerIOLocation } from './customerio-location';
9
+ import { CustomerIOPushMessaging } from './customerio-push';
10
+ export declare const Zixflow: typeof CustomerIO;
11
+ export * from './types';
12
+ export * from './notification-inbox';
13
+ export { CustomerIOInAppMessaging, CustomerIOLocation, CustomerIOPushMessaging, };
14
+ //# sourceMappingURL=zixflow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zixflow.d.ts","sourceRoot":"","sources":["../../../src/zixflow.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAG5D,eAAO,MAAM,OAAO,mBAAa,CAAC;AAGlC,cAAc,SAAS,CAAC;AACxB,cAAc,sBAAsB,CAAC;AAGrC,OAAO,EACL,wBAAwB,EACxB,kBAAkB,EAClB,uBAAuB,GACxB,CAAC"}
package/package.json ADDED
@@ -0,0 +1,165 @@
1
+ {
2
+ "name": "zixflow-reactnative",
3
+ "version": "1.0.0",
4
+ "description": "Official Zixflow SDK for React Native. Customer engagement platform built on proven Customer.io technology. Track customers and send messages to your iOS/Android apps.",
5
+ "source": "./src/index.ts",
6
+ "main": "./lib/commonjs/index.js",
7
+ "module": "./lib/module/index.js",
8
+ "types": "./lib/typescript/commonjs/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "import": {
12
+ "types": "./lib/typescript/module/index.d.ts",
13
+ "default": "./lib/module/index.js"
14
+ },
15
+ "require": {
16
+ "types": "./lib/typescript/commonjs/index.d.ts",
17
+ "default": "./lib/commonjs/index.js"
18
+ }
19
+ },
20
+ "./package.json": "./package.json"
21
+ },
22
+ "zixflowNativeiOSSdkVersion": "= 1.0.0",
23
+ "zixflowNativeAndroidSdkVersion": "1.0.0",
24
+ "cioNativeiOSSdkVersion": "~> 3.10",
25
+ "cioiOSFirebaseWrapperSdkVersion": "~> 1.0",
26
+ "files": [
27
+ "src",
28
+ "lib",
29
+ "android",
30
+ "ios",
31
+ "cpp",
32
+ "*.podspec",
33
+ "react-native.config.js",
34
+ "!ios/build",
35
+ "!android/build",
36
+ "!android/gradle",
37
+ "!android/gradlew",
38
+ "!android/gradlew.bat",
39
+ "!android/local.properties",
40
+ "!**/__tests__",
41
+ "!**/__fixtures__",
42
+ "!**/__mocks__",
43
+ "!**/.*"
44
+ ],
45
+ "scripts": {
46
+ "pre-deploy": "npm run typescript",
47
+ "typecheck": "tsc",
48
+ "typescript": "tsc --noEmit",
49
+ "lint": "eslint \"**/*.{js,ts,tsx}\"",
50
+ "lint:report": "npm run lint -- --output-file eslint_report.json --format json",
51
+ "prepare": "bob build",
52
+ "postinstall": "node src/postInstall.js",
53
+ "format": "npx prettier --write \"src/**/*.tsx\" && (npm run lint || true)"
54
+ },
55
+ "keywords": [
56
+ "react-native",
57
+ "ios",
58
+ "android"
59
+ ],
60
+ "repository": "https://github.com/zixflow/zixflow-reactnative",
61
+ "author": "Zixflow Team <apps@zixflow.com> (https://zixflow.com/)",
62
+ "license": "MIT",
63
+ "bugs": {
64
+ "url": "https://github.com/zixflow/zixflow-reactnative/issues"
65
+ },
66
+ "homepage": "https://github.com/zixflow/zixflow-reactnative#readme",
67
+ "publishConfig": {
68
+ "registry": "https://registry.npmjs.org/"
69
+ },
70
+ "devDependencies": {
71
+ "@commitlint/config-conventional": "^19.8.0",
72
+ "@eslint/compat": "^1.3.1",
73
+ "@eslint/eslintrc": "^3.3.1",
74
+ "@eslint/js": "^9.25.1",
75
+ "@evilmartians/lefthook": "^1.11.12",
76
+ "@microsoft/api-extractor": "^7.52.8",
77
+ "@react-native-community/cli": "^20.0.0",
78
+ "@react-native/babel-preset": "^0.83.0",
79
+ "@react-native/eslint-config": "^0.83.0",
80
+ "@react-native/typescript-config": "^0.83.0",
81
+ "@types/react": "^19.2.0",
82
+ "@typescript-eslint/eslint-plugin": "^8.31.1",
83
+ "@typescript-eslint/parser": "^8.31.1",
84
+ "eslint": "9.25.1",
85
+ "eslint-config-prettier": "10.1.2",
86
+ "eslint-plugin-ft-flow": "^3.0.11",
87
+ "eslint-plugin-jest": "^28.11.0",
88
+ "eslint-plugin-prettier": "^5.2.6",
89
+ "eslint-plugin-react-hooks": "^5.2.0",
90
+ "eslint-plugin-react-native": "^5.0.0",
91
+ "prettier": "^3.5.3",
92
+ "react": "19.2.0",
93
+ "react-native": "^0.83.0",
94
+ "react-native-builder-bob": "^0.40.10",
95
+ "typescript": "^5.8.3",
96
+ "typescript-eslint": "^8.31.1"
97
+ },
98
+ "peerDependencies": {
99
+ "react": "*",
100
+ "react-native": "*"
101
+ },
102
+ "commitlint": {
103
+ "extends": [
104
+ "@commitlint/config-conventional"
105
+ ]
106
+ },
107
+ "prettier": {
108
+ "quoteProps": "consistent",
109
+ "singleQuote": true,
110
+ "tabWidth": 2,
111
+ "trailingComma": "es5",
112
+ "useTabs": false
113
+ },
114
+ "react-native-builder-bob": {
115
+ "source": "src",
116
+ "output": "lib",
117
+ "targets": [
118
+ [
119
+ "commonjs",
120
+ {
121
+ "esm": true
122
+ }
123
+ ],
124
+ [
125
+ "module",
126
+ {
127
+ "esm": true
128
+ }
129
+ ],
130
+ [
131
+ "typescript",
132
+ {
133
+ "project": "tsconfig.build.json"
134
+ }
135
+ ]
136
+ ]
137
+ },
138
+ "engines": {
139
+ "node": ">=20.0.0"
140
+ },
141
+ "overrides": {
142
+ "lodash": "4.18.1",
143
+ "@eslint/plugin-kit": "0.3.4"
144
+ },
145
+ "codegenConfig": {
146
+ "name": "RNZixflowSpec",
147
+ "type": "all",
148
+ "jsSrcsDir": "./src/specs",
149
+ "android": {
150
+ "javaPackageName": "io.customer.reactnative.sdk"
151
+ },
152
+ "ios": {
153
+ "componentProvider": {
154
+ "InlineMessageNative": "RCTInlineMessageNative"
155
+ },
156
+ "modulesProvider": {
157
+ "NativeCustomerIOLogging": "RCTNativeCustomerIOLogging",
158
+ "NativeCustomerIO": "RCTNativeCustomerIO",
159
+ "NativeCustomerIOLocation": "RCTNativeCustomerIOLocation",
160
+ "NativeCustomerIOMessagingInApp": "RCTNativeMessagingInApp",
161
+ "NativeCustomerIOMessagingPush": "RCTNativeMessagingPush"
162
+ }
163
+ }
164
+ }
165
+ }
@@ -0,0 +1,4 @@
1
+ export interface IdentifyParams {
2
+ userId?: string;
3
+ traits?: Record<string, any>;
4
+ }
@@ -0,0 +1,187 @@
1
+ import React, { useMemo, useRef, useState } from 'react';
2
+ import {
3
+ ActivityIndicator,
4
+ type ActivityIndicatorProps,
5
+ Animated,
6
+ StyleSheet,
7
+ View,
8
+ type ViewStyle,
9
+ } from 'react-native';
10
+ import InlineMessageNativeComponent, {
11
+ InlineMessageState,
12
+ type ActionClickEvent,
13
+ type NativeProps,
14
+ type SizeChangeEvent,
15
+ type StateChangeEvent,
16
+ } from '../specs/components/InlineMessageNativeComponent';
17
+ import type { InAppMessage } from '../types';
18
+
19
+ /**
20
+ * Props for the InlineInAppMessageView component.
21
+ */
22
+ /** @public */
23
+ export interface InlineInAppMessageViewProps extends Omit<
24
+ NativeProps,
25
+ 'onSizeChange' | 'onStateChange' | 'onActionClick'
26
+ > {
27
+ /** Custom loading component to display while message is loading */
28
+ loadingComponent?: React.ReactNode;
29
+ /** Props for the default ActivityIndicator with optional minimum height */
30
+ loadingIndicatorProps?: ActivityIndicatorProps & {
31
+ /** Minimum height for the loading state (default: 36) */
32
+ minimumHeight?: number;
33
+ };
34
+ /** Custom styles for the loading container */
35
+ loadingContainerStyle?: ViewStyle;
36
+ /** Callback triggered when a user clicks an action button in the inline message */
37
+ onActionClick?: (
38
+ message: InAppMessage,
39
+ actionValue: string,
40
+ actionName: string
41
+ ) => void;
42
+ }
43
+
44
+ /**
45
+ * A React Native component for displaying inline in-app messages with animated sizing
46
+ * and customizable loading states.
47
+ *
48
+ * @example
49
+ * ```tsx
50
+ * <InlineInAppMessageView
51
+ * elementId="my-message"
52
+ * loadingIndicatorProps={{ minimumHeight: 50 }}
53
+ * style={{ width: '100%' }}
54
+ * onActionClick={(message, actionValue, actionName) => {
55
+ * console.log('Action clicked:', { message, actionValue, actionName });
56
+ * }}
57
+ * />
58
+ * ```
59
+ */
60
+ /** @public */
61
+ const InlineInAppMessageView: React.FC<InlineInAppMessageViewProps> = ({
62
+ style,
63
+ loadingComponent,
64
+ loadingIndicatorProps,
65
+ loadingContainerStyle,
66
+ onActionClick,
67
+ ...props
68
+ }) => {
69
+ // Animation values for dynamic sizing
70
+ const animatedWidth = useRef<Animated.Value | null>(null);
71
+ const animatedHeight = useRef(new Animated.Value(0)).current;
72
+ const [isLoading, setIsLoading] = useState(false);
73
+
74
+ // Extract width from style prop for priority handling
75
+ const styleProvidedWidth = useMemo(() => {
76
+ const flatStyle = StyleSheet.flatten(style);
77
+ return flatStyle?.width;
78
+ }, [style]);
79
+
80
+ // Type guard to check if a value is a valid number to ensure we only animate valid dimensions
81
+ const isValidNumber = (value: any): value is number =>
82
+ value !== null && value !== undefined;
83
+
84
+ // Helper function to create an animation for width or height changes
85
+ const createAnimation = (
86
+ animatedValue: Animated.Value,
87
+ value: number,
88
+ duration: number
89
+ ) =>
90
+ Animated.timing(animatedValue, {
91
+ toValue: value,
92
+ duration,
93
+ useNativeDriver: false, // Layout animations require JS driver
94
+ });
95
+
96
+ const handleSizeChange = (event: { nativeEvent: SizeChangeEvent }) => {
97
+ const { width, height, duration = 200 } = event.nativeEvent;
98
+
99
+ const animations: Animated.CompositeAnimation[] = [];
100
+
101
+ if (isValidNumber(width)) {
102
+ if (!animatedWidth.current) {
103
+ animatedWidth.current = new Animated.Value(width);
104
+ }
105
+ animations.push(createAnimation(animatedWidth.current, width, duration));
106
+ }
107
+ if (isValidNumber(height)) {
108
+ animations.push(createAnimation(animatedHeight, height, duration));
109
+ }
110
+
111
+ if (animations.length > 0) {
112
+ Animated.parallel(animations).start();
113
+ }
114
+ };
115
+
116
+ const handleStateChange = (event: { nativeEvent: StateChangeEvent }) => {
117
+ // Native component sends state as 'result' property
118
+ const state = (event.nativeEvent as any).result || event.nativeEvent.state;
119
+
120
+ switch (state) {
121
+ case InlineMessageState.LoadingStarted:
122
+ setIsLoading(true);
123
+ createAnimation(
124
+ animatedHeight,
125
+ loadingIndicatorProps?.minimumHeight ?? 48, // Default: ActivityIndicator + padding
126
+ 0 // Immediate height change for loading state
127
+ ).start();
128
+ break;
129
+ case InlineMessageState.LoadingFinished:
130
+ case InlineMessageState.NoMessageToDisplay:
131
+ setIsLoading(false);
132
+ break;
133
+ }
134
+ };
135
+
136
+ const handleActionClick = (event: { nativeEvent: ActionClickEvent }) => {
137
+ const { message, actionValue, actionName } = event.nativeEvent;
138
+ onActionClick?.(message, actionValue, actionName);
139
+ };
140
+
141
+ const renderLoadingComponent = () => {
142
+ if (loadingComponent) {
143
+ return loadingComponent;
144
+ }
145
+ return (
146
+ <View style={[styles.loadingContainer, loadingContainerStyle]}>
147
+ <ActivityIndicator size="small" {...loadingIndicatorProps} />
148
+ </View>
149
+ );
150
+ };
151
+
152
+ return (
153
+ <Animated.View
154
+ style={[
155
+ style,
156
+ {
157
+ // Priority: Style prop -> Native width -> Default (100%)
158
+ width: styleProvidedWidth ?? (animatedWidth.current || '100%'),
159
+ height: animatedHeight,
160
+ },
161
+ ]}
162
+ >
163
+ <InlineMessageNativeComponent
164
+ {...props}
165
+ style={styles.nativeComponent}
166
+ onSizeChange={handleSizeChange}
167
+ onStateChange={handleStateChange}
168
+ onActionClick={handleActionClick}
169
+ />
170
+ {isLoading && renderLoadingComponent()}
171
+ </Animated.View>
172
+ );
173
+ };
174
+
175
+ const styles = StyleSheet.create({
176
+ nativeComponent: {
177
+ width: '100%',
178
+ height: '100%',
179
+ },
180
+ loadingContainer: {
181
+ ...StyleSheet.absoluteFillObject,
182
+ justifyContent: 'center',
183
+ alignItems: 'center',
184
+ },
185
+ });
186
+
187
+ export default InlineInAppMessageView;
@@ -0,0 +1,3 @@
1
+ // Export all components and types from the components directory for simplified imports
2
+ export type { InlineInAppMessageViewProps } from './InlineInAppMessageView';
3
+ export { default as InlineInAppMessageView } from './InlineInAppMessageView';