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,115 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.CustomerIOPushMessaging = void 0;
7
+ var _reactNative = require("react-native");
8
+ var _NativeCustomerIOMessagingPush = _interopRequireDefault(require("./specs/modules/NativeCustomerIOMessagingPush.js"));
9
+ var _nativeBridge = require("./utils/native-bridge.js");
10
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
+ /**
12
+ * Ensures all methods defined in codegen spec are implemented by the public module
13
+ *
14
+ * @internal
15
+ */
16
+
17
+ // Reference to the native CustomerIO Data Pipelines module for SDK operations
18
+ const nativeModule = (0, _nativeBridge.ensureNativeModule)(_NativeCustomerIOMessagingPush.default);
19
+
20
+ // Wrapper function that ensures SDK is initialized before calling native methods
21
+ const withNativeModule = fn => {
22
+ return (0, _nativeBridge.callNativeModule)(nativeModule, fn);
23
+ };
24
+
25
+ /** @public */
26
+ class CustomerIOPushMessaging {
27
+ /**
28
+ * Processes push notification received outside the CIO SDK. The method displays notification on
29
+ * device and tracks CIO metrics for push notification.
30
+ *
31
+ * @param message - push payload received from FCM. The payload must contain data payload received in push
32
+ * notification.
33
+ * @param handleNotificationTrigger - indicates whether it should display the notification or not.
34
+ * true (default): The SDK will display the notification and track associated metrics.
35
+ * false: The SDK will only process the notification to track metrics but will not display any notification.
36
+ * @returns promise that resolves to boolean indicating if the notification was handled by the SDK or not.
37
+ */
38
+ onMessageReceived(message, handleNotificationTrigger = true) {
39
+ if (_reactNative.Platform.OS === 'ios') {
40
+ // Since push notifications on iOS work fine with multiple notification services,
41
+ // We don't need to process them on iOS for now.
42
+ // Resolving promise to true makes it easier for callers to avoid adding
43
+ // unnecessary platform specific checks.
44
+ return Promise.resolve(true);
45
+ } else {
46
+ return withNativeModule(native => native.onMessageReceived(message, handleNotificationTrigger));
47
+ }
48
+ }
49
+
50
+ /**
51
+ * Handles push notification received when app is background. Since FCM itself displays the notification
52
+ * when app is background, this method makes it easier to determine whether the notification should be
53
+ * displayed or not.
54
+ *
55
+ * @see [onMessageReceived] for more details
56
+ */
57
+ onBackgroundMessageReceived(message) {
58
+ return this.onMessageReceived(message, !message.notification);
59
+ }
60
+
61
+ /**
62
+ * Track push notifications metrics using this method.
63
+ * Call this method when a user interacts and taps open the push notification.
64
+ * @param payload - Customer.io payload as received from the push notification
65
+ */
66
+ trackNotificationResponseReceived(payload) {
67
+ // Tracking push notification metrics on Android is handled automatically
68
+ // through the Google Services API, so there is no need to make a specific call for it.
69
+ // This method is specific to iOS and works as expected on Android without any additional intervention.
70
+ if (payload == null || this.isAndroid()) {
71
+ return;
72
+ }
73
+ withNativeModule(native => native.trackNotificationResponseReceived(payload));
74
+ }
75
+
76
+ /**
77
+ * Track push notifications metrics using this method.
78
+ * Call this method when a push notification is received.
79
+ * @param payload - Customer.io payload as received from the push notification
80
+ */
81
+ trackNotificationReceived(payload) {
82
+ // Tracking push notification metrics on Android is handled automatically
83
+ // through the Google Services API, so there is no need to make a specific call for it.
84
+ // This method is specific to iOS and works as expected on Android without any additional intervention.
85
+ if (payload == null || this.isAndroid()) {
86
+ return;
87
+ }
88
+ withNativeModule(native => native.trackNotificationReceived(payload));
89
+ }
90
+
91
+ /**
92
+ * Get the registered device token for the app.
93
+ * @returns Promise with device token as a string, or error if no token is
94
+ * registered or the method fails to fetch token.
95
+ */
96
+ getRegisteredDeviceToken() {
97
+ return withNativeModule(native => native.getRegisteredDeviceToken());
98
+ }
99
+ showPromptForPushNotifications(options = {
100
+ ios: {
101
+ badge: true,
102
+ sound: true
103
+ }
104
+ }) {
105
+ return withNativeModule(native => native.showPromptForPushNotifications(options)).then(status => status);
106
+ }
107
+ getPushPermissionStatus() {
108
+ return withNativeModule(native => native.getPushPermissionStatus()).then(status => status);
109
+ }
110
+ isAndroid() {
111
+ return _reactNative.Platform.OS === 'android';
112
+ }
113
+ }
114
+ exports.CustomerIOPushMessaging = CustomerIOPushMessaging;
115
+ //# sourceMappingURL=customerio-push.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","_NativeCustomerIOMessagingPush","_interopRequireDefault","_nativeBridge","e","__esModule","default","nativeModule","ensureNativeModule","NativeCustomerIOMessagingPush","withNativeModule","fn","callNativeModule","CustomerIOPushMessaging","onMessageReceived","message","handleNotificationTrigger","Platform","OS","Promise","resolve","native","onBackgroundMessageReceived","notification","trackNotificationResponseReceived","payload","isAndroid","trackNotificationReceived","getRegisteredDeviceToken","showPromptForPushNotifications","options","ios","badge","sound","then","status","getPushPermissionStatus","exports"],"sourceRoot":"../../src","sources":["customerio-push.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,8BAAA,GAAAC,sBAAA,CAAAF,OAAA;AAOA,IAAAG,aAAA,GAAAH,OAAA;AAA6E,SAAAE,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE7E;AACA;AACA;AACA;AACA;;AAGA;AACA,MAAMG,YAAY,GAAG,IAAAC,gCAAkB,EAACC,sCAA6B,CAAC;;AAEtE;AACA,MAAMC,gBAAgB,GAAOC,EAA8B,IAAQ;EACjE,OAAO,IAAAC,8BAAgB,EAACL,YAAY,EAAEI,EAAE,CAAC;AAC3C,CAAC;;AAED;AACA,MAAME,uBAAuB,CAA2B;EACtD;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEC,iBAAiBA,CACfC,OAAY,EACZC,yBAAkC,GAAG,IAAI,EACvB;IAClB,IAA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AACC,OAAO,CAC/C,CAAC,CAACI,IAAI,CAAEC,MAAM,IAAKA,MAAiC,CAAC;EACvD;EAEAC,uBAAuBA,CAAA,EAAqC;IAC1D,OAAO1B,gBAAgB,CAAEW,MAAM,IAAKA,MAAM,CAACe,uBAAuB,CAAC,CAAC,CAAC,CAACF,IAAI,CACvEC,MAAM,IAAKA,MACd,CAAC;EACH;EAEAT,SAASA,CAAA,EAAY;IACnB,OAAOT,qBAAQ,CAACC,EAAE,KAAK,SAAS;EAClC;AACF;AAACmB,OAAA,CAAAxB,uBAAA,GAAAA,uBAAA","ignoreList":[]}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _zixflow = require("./zixflow.js");
7
+ Object.keys(_zixflow).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _zixflow[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _zixflow[key];
14
+ }
15
+ });
16
+ });
17
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_zixflow","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;AAQA,IAAAA,QAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,QAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,QAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,QAAA,CAAAK,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.NativeLoggerListener = void 0;
7
+ var _NativeCustomerIOLogging = _interopRequireDefault(require("./specs/modules/NativeCustomerIOLogging.js"));
8
+ var _index = require("./types/index.js");
9
+ var _nativeBridge = require("./utils/native-bridge.js");
10
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
+ // Reference to the native CustomerIO logging module for SDK operations
12
+ const nativeModule = (0, _nativeBridge.ensureNativeModule)(_NativeCustomerIOLogging.default);
13
+
14
+ // Wrapper function that ensures SDK is initialized before calling native methods
15
+ const withNativeModule = fn => {
16
+ return (0, _nativeBridge.callNativeModule)(nativeModule, fn);
17
+ };
18
+
19
+ /* @internal */
20
+ class NativeLoggerListener {
21
+ static isInitialized = false;
22
+ // Prefix for all CustomerIO log messages
23
+ static loggerPrefix = '[CIO] ';
24
+ static async initialize() {
25
+ // Prevent multiple registrations of the same log listener
26
+ if (this.isInitialized) {
27
+ return Promise.resolve();
28
+ }
29
+
30
+ // Using console.log will log to the JavaScript side but prevent
31
+ // React Native's default behavior of redirecting logs to the native side.
32
+ // By doing it asynchronously, we ensure the logs are captured on both
33
+ // the JavaScript and native ends.
34
+ const logEvent = async event => {
35
+ switch (event.logLevel) {
36
+ case _index.CioLogLevel.Debug:
37
+ console.debug(this.loggerPrefix + event.message);
38
+ break;
39
+ case _index.CioLogLevel.Info:
40
+ console.info(this.loggerPrefix + event.message);
41
+ break;
42
+ case _index.CioLogLevel.Error:
43
+ console.error(this.loggerPrefix + event.message);
44
+ break;
45
+ default:
46
+ console.log(this.loggerPrefix + event);
47
+ break;
48
+ }
49
+ };
50
+ const logHandler = data => {
51
+ const event = data;
52
+ logEvent(event);
53
+ };
54
+ withNativeModule(native => {
55
+ try {
56
+ // Register TurboModule event listener and return subscription.
57
+ // This method is generated by codegen in the native modules.
58
+ // Wrapped in try-catch due to previous reports of crashes on certain Android architectures.
59
+ native.onCioLogEvent(logHandler);
60
+ } catch (error) {
61
+ NativeLoggerListener.warn('Failed to attach log listener:', error);
62
+ }
63
+ });
64
+ this.isInitialized = true;
65
+ }
66
+
67
+ // Logs warning messages in development mode only, with CIO prefix
68
+ static warn(message, error) {
69
+ if (__DEV__) {
70
+ console.warn(this.loggerPrefix + message, error);
71
+ }
72
+ }
73
+
74
+ // Initializes native logger listener with error handling
75
+ static initNativeLogger() {
76
+ try {
77
+ NativeLoggerListener.initialize();
78
+ } catch (error) {
79
+ NativeLoggerListener.warn('Failed to initialize native logger:', error);
80
+ }
81
+ }
82
+ }
83
+ exports.NativeLoggerListener = NativeLoggerListener;
84
+ //# sourceMappingURL=native-logger-listener.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_NativeCustomerIOLogging","_interopRequireDefault","require","_index","_nativeBridge","e","__esModule","default","nativeModule","ensureNativeModule","NativeCustomerIOLogging","withNativeModule","fn","callNativeModule","NativeLoggerListener","isInitialized","loggerPrefix","initialize","Promise","resolve","logEvent","event","logLevel","CioLogLevel","Debug","console","debug","message","Info","info","Error","error","log","logHandler","data","native","onCioLogEvent","warn","__DEV__","initNativeLogger","exports"],"sourceRoot":"../../src","sources":["native-logger-listener.ts"],"mappings":";;;;;;AAAA,IAAAA,wBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAF,OAAA;AAA6E,SAAAD,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE7E;AACA,MAAMG,YAAY,GAAG,IAAAC,gCAAkB,EAACC,gCAAuB,CAAC;;AAEhE;AACA,MAAMC,gBAAgB,GACpBC,EAAiD,IAC3C;EACN,OAAO,IAAAC,8BAAgB,EAACL,YAAY,EAAEI,EAAE,CAAC;AAC3C,CAAC;;AAED;AACO,MAAME,oBAAoB,CAAC;EAChC,OAAeC,aAAa,GAAG,KAAK;EACpC;EACA,OAAeC,YAAY,GAAG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KAAK,CAAC;IAClD;EACF;;EAEA;EACA,OAAOQ,gBAAgBA,CAAA,EAAG;IACxB,IAAI;MACFzB,oBAAoB,CAACG,UAAU,CAAC,CAAC;IACnC,CAAC,CAAC,OAAOc,KAAK,EAAE;MACdjB,oBAAoB,CAACuB,IAAI,CAAC,qCAAqC,EAAEN,KAAK,CAAC;IACzE;EACF;AACF;AAACS,OAAA,CAAA1B,oBAAA,GAAAA,oBAAA","ignoreList":[]}
@@ -0,0 +1,132 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.NotificationInbox = void 0;
7
+ var _nativeLoggerListener = require("./native-logger-listener.js");
8
+ var _NativeCustomerIOMessagingInApp = _interopRequireDefault(require("./specs/modules/NativeCustomerIOMessagingInApp.js"));
9
+ var _nativeBridge = require("./utils/native-bridge.js");
10
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
+ // Reference to the native CustomerIO In-App Messaging module
12
+ const nativeModule = (0, _nativeBridge.ensureNativeModule)(_NativeCustomerIOMessagingInApp.default);
13
+
14
+ // Wrapper function that ensures SDK is initialized before calling native methods
15
+ const withNativeModule = fn => {
16
+ return (0, _nativeBridge.callNativeModule)(nativeModule, fn);
17
+ };
18
+
19
+ /**
20
+ * Public API methods for NotificationInbox.
21
+ * Define the TypeScript API here with proper types (InboxMessage instead of UnsafeObject).
22
+ *
23
+ * @internal
24
+ */
25
+
26
+ /**
27
+ * Native inbox methods from CodegenSpec that should be excluded from CustomerIOInAppMessaging.
28
+ * Includes both public methods (in NotificationInboxPublicSpec) and internal methods.
29
+ *
30
+ * @internal
31
+ */
32
+
33
+ /**
34
+ * Helper function to parse raw inbox message from native layer
35
+ * @internal
36
+ */
37
+ function parseInboxMessage(raw) {
38
+ return {
39
+ queueId: raw.queueId,
40
+ deliveryId: raw.deliveryId ?? undefined,
41
+ expiry: raw.expiry ?? undefined,
42
+ sentAt: raw.sentAt,
43
+ topics: raw.topics || [],
44
+ type: raw.type,
45
+ opened: raw.opened,
46
+ priority: raw.priority ?? undefined,
47
+ properties: raw.properties || {}
48
+ };
49
+ }
50
+
51
+ /**
52
+ * Manages inbox messages for the current user.
53
+ *
54
+ * @public
55
+ */
56
+ class NotificationInbox {
57
+ /**
58
+ * Gets inbox messages.
59
+ */
60
+ async getMessages(topic) {
61
+ return withNativeModule(async native => {
62
+ const rawMessages = await native.getMessages(topic);
63
+ return rawMessages.map(parseInboxMessage);
64
+ });
65
+ }
66
+
67
+ /**
68
+ * Subscribes to inbox message changes.
69
+ * Optionally filter messages by topic.
70
+ */
71
+ subscribeToMessages(listener, topic) {
72
+ const emitter = data => {
73
+ let messages = (data.messages || []).map(parseInboxMessage);
74
+
75
+ // Filter by topic if specified (case-insensitive)
76
+ if (topic) {
77
+ const topicLower = topic.toLowerCase();
78
+ messages = messages.filter(msg => msg.topics.some(t => t.toLowerCase() === topicLower));
79
+ }
80
+ listener.onMessagesChanged(messages);
81
+ };
82
+ return withNativeModule(native => {
83
+ try {
84
+ // Set up the native inbox listener before subscribing to events
85
+ // This will automatically trigger onMessagesChanged with current messages
86
+ native.setupInboxListener();
87
+
88
+ // Register TurboModule event listener and return subscription
89
+ return native.subscribeToMessagesChanged(emitter);
90
+ } catch (error) {
91
+ _nativeLoggerListener.NativeLoggerListener.warn('Failed to attach inbox change listener:', error);
92
+ // Return a no-op subscription to maintain backwards compatibility
93
+ return {
94
+ remove: () => {},
95
+ eventType: '',
96
+ key: 0,
97
+ subscriber: null
98
+ };
99
+ }
100
+ });
101
+ }
102
+
103
+ /**
104
+ * Marks an inbox message as opened/read.
105
+ */
106
+ markMessageOpened(message) {
107
+ withNativeModule(native => native.markMessageOpened(message));
108
+ }
109
+
110
+ /**
111
+ * Marks an inbox message as unopened/unread.
112
+ */
113
+ markMessageUnopened(message) {
114
+ withNativeModule(native => native.markMessageUnopened(message));
115
+ }
116
+
117
+ /**
118
+ * Marks an inbox message as deleted.
119
+ */
120
+ markMessageDeleted(message) {
121
+ withNativeModule(native => native.markMessageDeleted(message));
122
+ }
123
+
124
+ /**
125
+ * Tracks a click event for an inbox message.
126
+ */
127
+ trackMessageClicked(message, actionName) {
128
+ withNativeModule(native => native.trackMessageClicked(message, actionName));
129
+ }
130
+ }
131
+ exports.NotificationInbox = NotificationInbox;
132
+ //# sourceMappingURL=notification-inbox.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_nativeLoggerListener","require","_NativeCustomerIOMessagingInApp","_interopRequireDefault","_nativeBridge","e","__esModule","default","nativeModule","ensureNativeModule","NativeCustomerIOMessagingInApp","withNativeModule","fn","callNativeModule","parseInboxMessage","raw","queueId","deliveryId","undefined","expiry","sentAt","topics","type","opened","priority","properties","NotificationInbox","getMessages","topic","native","rawMessages","map","subscribeToMessages","listener","emitter","data","messages","topicLower","toLowerCase","filter","msg","some","t","onMessagesChanged","setupInboxListener","subscribeToMessagesChanged","error","NativeLoggerListener","warn","remove","eventType","key","subscriber","markMessageOpened","message","markMessageUnopened","markMessageDeleted","trackMessageClicked","actionName","exports"],"sourceRoot":"../../src","sources":["notification-inbox.ts"],"mappings":";;;;;;AACA,IAAAA,qBAAA,GAAAC,OAAA;AAEA,IAAAC,+BAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,aAAA,GAAAH,OAAA;AAA6E,SAAAE,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE7E;AACA,MAAMG,YAAY,GAAG,IAAAC,gCAAkB,EAACC,uCAA8B,CAAC;;AAEvE;AACA,MAAMC,gBAAgB,GAAOC,EAA8B,IAAQ;EACjE,OAAO,IAAAC,8BAAgB,EAACL,YAAY,EAAEI,EAAE,CAAC;AAC3C,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;;AAaA;AACA;AACA;AACA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA,SAASE,iBAAiBA,CAACC,GAAQ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,QAAQ,CAACU,iBAAiB,CAACP,QAAQ,CAAC;IACtC,CAAC;IAED,OAAOzB,gBAAgB,CAAEkB,MAAM,IAAK;MAClC,IAAI;QACF;QACA;QACAA,MAAM,CAACe,kBAAkB,CAAC,CAAC;;QAE3B;QACA,OAAOf,MAAM,CAACgB,0BAA0B,CAACX,OAAO,CAAC;MACnD,CAAC,CAAC,OAAOY,KAAK,EAAE;QACdC,0CAAoB,CAACC,IAAI,CACvB,yCAAyC,EACzCF,KACF,CAAC;QACD;QACA,OAAO;UACLG,MAAM,EAAEA,CAAA,KAAM,CAAC,CAAC;UAChBC,SAAS,EAAE,EAAE;UACbC,GAAG,EAAE,CAAC;UACNC,UAAU,EAAE;QACd,CAAC;MACH;IACF,CAAC,CAAC;EACJ;;EAEA;AACF;AACA;EACEC,iBAAiBA,CAACC,OAAqB,EAAE;IACvC3C,gBAAgB,CAAEkB,MAAM,IAAKA,MAAM,CAACwB,iBAAiB,CAACC,OAAO,CAAC,CAAC;EACjE;;EAEA;AACF;AACA;EACEC,mBAAmBA,CAACD,OAAqB,EAAE;IACzC3C,gBAAgB,CAAEkB,MAAM,IAAKA,MAAM,CAAC0B,mBAAmB,CAACD,OAAO,CAAC,CAAC;EACnE;;EAEA;AACF;AACA;EACEE,kBAAkBA,CAACF,OAAqB,EAAE;IACxC3C,gBAAgB,CAAEkB,MAAM,IAAKA,MAAM,CAAC2B,kBAAkB,CAACF,OAAO,CAAC,CAAC;EAClE;;EAEA;AACF;AACA;EACEG,mBAAmBA,CAACH,OAAqB,EAAEI,UAAmB,EAAE;IAC9D/C,gBAAgB,CAAEkB,MAAM,IACtBA,MAAM,CAAC4B,mBAAmB,CAACH,OAAO,EAAEI,UAAU,CAChD,CAAC;EACH;AACF;AAACC,OAAA,CAAAjC,iBAAA,GAAAA,iBAAA","ignoreList":[]}
@@ -0,0 +1 @@
1
+ {"type":"commonjs"}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ /*
4
+ This code block attempts to set expoVersion in package.json.
5
+ If it fails, the assumption is that Expo plugin is not installed,
6
+ therefore we are running on bare React Native project.
7
+ If it succeeds, we use Expo as the user agent instead of React Native.
8
+ */
9
+ try {
10
+ const ph = require('customerio-expo-plugin/postinstall');
11
+ ph.runPostInstall();
12
+ } catch {}
13
+ //# sourceMappingURL=postInstall.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["ph","require","runPostInstall"],"sourceRoot":"../../src","sources":["postInstall.js"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;EACF,MAAMA,EAAE,GAAGC,OAAO,CAAC,oCAAoC,CAAC;EACxDD,EAAE,CAACE,cAAc,CAAC,CAAC;AACrB,CAAC,CAAC,MAAM,CAAC","ignoreList":[]}
@@ -0,0 +1,59 @@
1
+ // React Native docs now recommend Codegen types should be imported from the react-native package
2
+ // But it breaks on Expo and older React Native versions, so we import from react-native/Libraries/Types/CodegenTypes
3
+ // for compatibility with all versions until we can fully migrate to the new import style without breaking older versions
4
+ // https://reactnative.dev/docs/strict-typescript-api#codegen-types-should-now-be-imported-from-the-react-native-package
5
+
6
+ import type { HostComponent, ViewProps } from 'react-native';
7
+ /* eslint-disable @react-native/no-deep-imports */
8
+ import type {
9
+ DirectEventHandler,
10
+ Double,
11
+ } from 'react-native/Libraries/Types/CodegenTypes';
12
+ import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
13
+
14
+ /** Event data for inline message size changes. */
15
+ export interface SizeChangeEvent {
16
+ width: Double;
17
+ height: Double;
18
+ duration?: Double;
19
+ }
20
+
21
+ /** States representing the loading and display status of inline messages. */
22
+ export enum InlineMessageState {
23
+ LoadingStarted = 'LoadingStarted',
24
+ LoadingFinished = 'LoadingFinished',
25
+ NoMessageToDisplay = 'NoMessageToDisplay',
26
+ }
27
+
28
+ /** Event data for inline message state changes. */
29
+ export interface StateChangeEvent {
30
+ state: string;
31
+ }
32
+
33
+ /** Event data for inline message action clicks. */
34
+ export interface ActionClickEvent {
35
+ /** Message data structure - defined inline for codegen compatibility (cannot import types) */
36
+ message: {
37
+ messageId: string;
38
+ deliveryId?: string;
39
+ elementId?: string;
40
+ };
41
+ actionValue: string;
42
+ actionName: string;
43
+ }
44
+
45
+ /** Props for the native inline message component. */
46
+ export interface NativeProps extends ViewProps {
47
+ /** Required element ID for retrieving inline message content. */
48
+ elementId: string;
49
+ onSizeChange: DirectEventHandler<SizeChangeEvent>;
50
+ onStateChange?: DirectEventHandler<StateChangeEvent>;
51
+ onActionClick?: DirectEventHandler<ActionClickEvent>;
52
+ }
53
+
54
+ // React Native Codegen automatically generates the native component bridge based on the NativeProps interface
55
+ // This creates the low-level native component that handles communication between JS and native code
56
+ // Used by native iOS/Android components - the public view is InlineInAppMessageView in components directory
57
+ export default codegenNativeComponent<NativeProps>(
58
+ 'InlineMessageNative'
59
+ ) as HostComponent<NativeProps>;
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _reactNative = require("react-native");
8
+ /**
9
+ * Native module specification for CustomerIO React Native SDK
10
+ *
11
+ * This module defines the TurboModule interface for CustomerIO SDK native bridge.
12
+ * Types use basic primitives for React Native Codegen compatibility, while the public
13
+ * API layer provides more specific TypeScript types for better developer experience.
14
+ *
15
+ * The separation allows:
16
+ * - Native bridge compatibility with Codegen constraints
17
+ * - Type-safe public API with proper TypeScript definitions
18
+ * - Alignment between codegen spec and public contract
19
+ *
20
+ * @see https://github.com/facebook/react-native/issues/38769 for Codegen limitations
21
+ */
22
+ /**
23
+ * Generic object type for native bridge parameter passing.
24
+ *
25
+ * Used for all complex data structures passed to native methods to ensure
26
+ * React Native Codegen compatibility. The public API layer converts these
27
+ * to proper TypeScript types (CustomAttributes, CioConfig, etc.) for
28
+ * better type safety and developer experience.
29
+ *
30
+ * @internal - Not exported to avoid conflicts with public API types
31
+ */
32
+ // =============================================================================
33
+ // TURBO MODULE SPEC – Defines native bridge interface
34
+ // =============================================================================
35
+ /**
36
+ * TurboModule specification for CustomerIO SDK native bridge methods.
37
+ * Uses generic Object types for React Native Codegen compatibility.
38
+ */
39
+ var _default = exports.default = _reactNative.TurboModuleRegistry.getEnforcing('NativeCustomerIO');
40
+ //# sourceMappingURL=NativeCustomerIO.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","_default","exports","default","TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../../../src","sources":["specs/modules/NativeCustomerIO.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AAEA;AACA;AACA;AACA;AAHA,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAoBeC,gCAAmB,CAACC,YAAY,CAAO,kBAAkB,CAAC","ignoreList":[]}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _reactNative = require("react-native");
8
+ /**
9
+ * Native module specification for CustomerIO Location React Native SDK
10
+ *
11
+ * @see NativeCustomerIO.ts for detailed documentation on TurboModule patterns,
12
+ * Codegen compatibility, and type safety approach.
13
+ */
14
+ var _default = exports.default = _reactNative.TurboModuleRegistry.get('NativeCustomerIOLocation');
15
+ //# sourceMappingURL=NativeCustomerIOLocation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","_default","exports","default","TurboModuleRegistry","get"],"sourceRoot":"../../../../src","sources":["specs/modules/NativeCustomerIOLocation.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AALA,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAYeC,gCAAmB,CAACC,GAAG,CAAO,0BAA0B,CAAC","ignoreList":[]}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _reactNative = require("react-native");
8
+ /**
9
+ * Native module specification for CustomerIO Logging React Native SDK
10
+ *
11
+ * This module defines the TurboModule interface for CustomerIO logging bridge.
12
+ * Used internally for printing logs to React Native environment instead of native.
13
+ *
14
+ * @see NativeCustomerIO.ts for detailed documentation on TurboModule patterns,
15
+ * Codegen compatibility, and type safety approach.
16
+ */
17
+ /** TurboModule interface for CustomerIO logging native operations */
18
+ var _default = exports.default = _reactNative.TurboModuleRegistry.getEnforcing('NativeCustomerIOLogging');
19
+ //# sourceMappingURL=NativeCustomerIOLogging.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","_default","exports","default","TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../../../src","sources":["specs/modules/NativeCustomerIOLogging.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAAA,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAKeC,gCAAmB,CAACC,YAAY,CAC7C,yBACF,CAAC","ignoreList":[]}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _reactNative = require("react-native");
8
+ /**
9
+ * Native module specification for CustomerIO In-App Messaging React Native SDK
10
+ *
11
+ * @see NativeCustomerIO.ts for detailed documentation on TurboModule patterns,
12
+ * Codegen compatibility, and type safety approach.
13
+ */
14
+ /** TurboModule interface for CustomerIO In-App Messaging native operations */
15
+ var _default = exports.default = _reactNative.TurboModuleRegistry.getEnforcing('NativeCustomerIOMessagingInApp');
16
+ //# sourceMappingURL=NativeCustomerIOMessagingInApp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","_default","exports","default","TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../../../src","sources":["specs/modules/NativeCustomerIOMessagingInApp.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAMA;AACA;AACA;AACA;AACA;AACA;AAEA;AAAA,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAceC,gCAAmB,CAACC,YAAY,CAC7C,gCACF,CAAC","ignoreList":[]}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _reactNative = require("react-native");
8
+ /**
9
+ * Native module specification for CustomerIO Push Messaging React Native SDK
10
+ *
11
+ * @see NativeCustomerIO.ts for detailed documentation on TurboModule patterns,
12
+ * Codegen compatibility, and type safety approach.
13
+ */
14
+ var _default = exports.default = _reactNative.TurboModuleRegistry.getEnforcing('NativeCustomerIOMessagingPush');
15
+ //# sourceMappingURL=NativeCustomerIOMessagingPush.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","_default","exports","default","TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../../../src","sources":["specs/modules/NativeCustomerIOMessagingPush.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAGA;AACA;AACA;AACA;AACA;AACA;AALA,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAqBeC,gCAAmB,CAACC,YAAY,CAC7C,+BACF,CAAC","ignoreList":[]}