zixflow-reactnative 1.1.3 → 1.1.4

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 (239) hide show
  1. package/README.md +631 -261
  2. package/android/build.gradle +18 -1
  3. package/android/consumer-rules.pro +3 -2
  4. package/android/gradle.properties +1 -1
  5. package/android/src/main/java/com/zixflow/reactnative/sdk/NativeZixflowModule.kt +40 -5
  6. package/android/src/main/java/com/zixflow/reactnative/sdk/ZixflowReactNativePackage.kt +25 -1
  7. package/android/src/main/java/com/zixflow/reactnative/sdk/constant/Keys.kt +19 -0
  8. package/android/src/main/java/com/zixflow/reactnative/sdk/geofence/NativeGeofenceModule.kt +65 -0
  9. package/android/src/main/java/com/zixflow/reactnative/sdk/liveactivities/NativeLiveActivitiesModule.kt +310 -0
  10. package/android/src/main/java/com/zixflow/reactnative/sdk/messaginginapp/NativeMessagingInAppModule.kt +150 -0
  11. package/android/src/main/java/com/zixflow/reactnative/sdk/messaginginapp/ReactInboxEventListener.kt +99 -0
  12. package/android/src/main/java/com/zixflow/reactnative/sdk/messaginginbox/NotificationInboxBellViewManager.kt +38 -0
  13. package/android/src/main/java/com/zixflow/reactnative/sdk/messaginginbox/NotificationInboxViewManager.kt +30 -0
  14. package/android/src/main/java/com/zixflow/reactnative/sdk/messaginginbox/ReactComposeHostView.kt +96 -0
  15. package/android/src/main/java/com/zixflow/reactnative/sdk/messaginginbox/ReactNotificationInboxBellView.kt +48 -0
  16. package/android/src/main/java/com/zixflow/reactnative/sdk/messaginginbox/ReactNotificationInboxView.kt +17 -0
  17. package/android/src/main/java/com/zixflow/reactnative/sdk/messagingpush/NativeMessagingPushModule.kt +11 -1
  18. package/android/src/main/res/values/zixflow_config.xml +1 -1
  19. package/android/zixflow-core.gradle +17 -7
  20. package/docs/cocoapods-deployment-target-normalization.md +139 -0
  21. package/ios/cocoapods_deployment_target.rb +432 -0
  22. package/ios/wrappers/NativeZixflow.mm +37 -0
  23. package/ios/wrappers/NativeZixflow.swift +135 -1
  24. package/ios/wrappers/ZixflowReactNativeDeepLinkRequestStore.swift +123 -0
  25. package/ios/wrappers/ZixflowReactNativeDeepLinkRouter.swift +312 -0
  26. package/ios/wrappers/geofence/NativeGeofence.mm +46 -0
  27. package/ios/wrappers/geofence/NativeGeofence.swift +27 -0
  28. package/ios/wrappers/inapp/NativeMessagingInApp.mm +22 -0
  29. package/ios/wrappers/inapp/NativeMessagingInApp.swift +90 -0
  30. package/ios/wrappers/inbox/InboxHostContainment.swift +40 -0
  31. package/ios/wrappers/inbox/RCTNotificationInboxBellNative.h +12 -0
  32. package/ios/wrappers/inbox/RCTNotificationInboxBellNative.mm +98 -0
  33. package/ios/wrappers/inbox/RCTNotificationInboxViewNative.h +12 -0
  34. package/ios/wrappers/inbox/RCTNotificationInboxViewNative.mm +78 -0
  35. package/ios/wrappers/inbox/ReactInboxEventListener.swift +76 -0
  36. package/ios/wrappers/inbox/ReactNotificationInboxBellView.h +22 -0
  37. package/ios/wrappers/inbox/ReactNotificationInboxBellView.swift +109 -0
  38. package/ios/wrappers/inbox/ReactNotificationInboxView.h +22 -0
  39. package/ios/wrappers/inbox/ReactNotificationInboxView.swift +69 -0
  40. package/ios/wrappers/liveactivities/NativeLiveActivities.mm +83 -0
  41. package/ios/wrappers/liveactivities/NativeLiveActivities.swift +390 -0
  42. package/ios/wrappers/location/NativeLocation.swift +7 -5
  43. package/ios/wrappers/utils/ZixflowConstants.swift +4 -0
  44. package/ios/wrappers/zixflow_reactnative.h +6 -0
  45. package/lib/commonjs/components/NotificationInboxBellView.js +49 -0
  46. package/lib/commonjs/components/NotificationInboxBellView.js.map +1 -0
  47. package/lib/commonjs/components/NotificationInboxView.js +36 -0
  48. package/lib/commonjs/components/NotificationInboxView.js.map +1 -0
  49. package/lib/commonjs/components/index.js +14 -0
  50. package/lib/commonjs/components/index.js.map +1 -1
  51. package/lib/commonjs/index.js +81 -4
  52. package/lib/commonjs/index.js.map +1 -1
  53. package/lib/commonjs/notification-inbox.js +1 -0
  54. package/lib/commonjs/notification-inbox.js.map +1 -1
  55. package/lib/commonjs/specs/components/NotificationInboxBellNativeComponent.ts +24 -0
  56. package/lib/commonjs/specs/components/NotificationInboxViewNativeComponent.ts +22 -0
  57. package/lib/commonjs/specs/modules/NativeZixflow.js.map +1 -1
  58. package/lib/commonjs/specs/modules/NativeZixflowGeofence.js +15 -0
  59. package/lib/commonjs/specs/modules/NativeZixflowGeofence.js.map +1 -0
  60. package/lib/commonjs/specs/modules/NativeZixflowLiveActivities.js +23 -0
  61. package/lib/commonjs/specs/modules/NativeZixflowLiveActivities.js.map +1 -0
  62. package/lib/commonjs/specs/modules/NativeZixflowMessagingInApp.js +3 -1
  63. package/lib/commonjs/specs/modules/NativeZixflowMessagingInApp.js.map +1 -1
  64. package/lib/commonjs/specs/modules/NativeZixflowMessagingPush.js +3 -1
  65. package/lib/commonjs/specs/modules/NativeZixflowMessagingPush.js.map +1 -1
  66. package/lib/commonjs/types/data-pipelines.js +13 -1
  67. package/lib/commonjs/types/data-pipelines.js.map +1 -1
  68. package/lib/commonjs/types/in-app.js +24 -1
  69. package/lib/commonjs/types/in-app.js.map +1 -1
  70. package/lib/commonjs/types/inbox.js +79 -0
  71. package/lib/commonjs/types/inbox.js.map +1 -0
  72. package/lib/commonjs/types/index.js +22 -0
  73. package/lib/commonjs/types/index.js.map +1 -1
  74. package/lib/commonjs/types/live-activities.js +85 -0
  75. package/lib/commonjs/types/live-activities.js.map +1 -0
  76. package/lib/commonjs/utils/param-validation.js +76 -1
  77. package/lib/commonjs/utils/param-validation.js.map +1 -1
  78. package/lib/commonjs/zixflow-cdp.js +99 -1
  79. package/lib/commonjs/zixflow-cdp.js.map +1 -1
  80. package/lib/commonjs/zixflow-geofence.js +55 -0
  81. package/lib/commonjs/zixflow-geofence.js.map +1 -0
  82. package/lib/commonjs/zixflow-inapp.js +120 -0
  83. package/lib/commonjs/zixflow-inapp.js.map +1 -1
  84. package/lib/commonjs/zixflow-liveactivities.js +85 -0
  85. package/lib/commonjs/zixflow-liveactivities.js.map +1 -0
  86. package/lib/module/components/NotificationInboxBellView.js +44 -0
  87. package/lib/module/components/NotificationInboxBellView.js.map +1 -0
  88. package/lib/module/components/NotificationInboxView.js +31 -0
  89. package/lib/module/components/NotificationInboxView.js.map +1 -0
  90. package/lib/module/components/index.js +5 -0
  91. package/lib/module/components/index.js.map +1 -1
  92. package/lib/module/index.js +8 -3
  93. package/lib/module/index.js.map +1 -1
  94. package/lib/module/notification-inbox.js +1 -1
  95. package/lib/module/notification-inbox.js.map +1 -1
  96. package/lib/module/specs/components/NotificationInboxBellNativeComponent.ts +24 -0
  97. package/lib/module/specs/components/NotificationInboxViewNativeComponent.ts +22 -0
  98. package/lib/module/specs/modules/NativeZixflow.js.map +1 -1
  99. package/lib/module/specs/modules/NativeZixflowGeofence.js +13 -0
  100. package/lib/module/specs/modules/NativeZixflowGeofence.js.map +1 -0
  101. package/lib/module/specs/modules/NativeZixflowLiveActivities.js +21 -0
  102. package/lib/module/specs/modules/NativeZixflowLiveActivities.js.map +1 -0
  103. package/lib/module/specs/modules/NativeZixflowMessagingInApp.js +3 -1
  104. package/lib/module/specs/modules/NativeZixflowMessagingInApp.js.map +1 -1
  105. package/lib/module/specs/modules/NativeZixflowMessagingPush.js +3 -1
  106. package/lib/module/specs/modules/NativeZixflowMessagingPush.js.map +1 -1
  107. package/lib/module/types/data-pipelines.js +13 -0
  108. package/lib/module/types/data-pipelines.js.map +1 -1
  109. package/lib/module/types/in-app.js +24 -0
  110. package/lib/module/types/in-app.js.map +1 -1
  111. package/lib/module/types/inbox.js +75 -0
  112. package/lib/module/types/inbox.js.map +1 -0
  113. package/lib/module/types/index.js +2 -0
  114. package/lib/module/types/index.js.map +1 -1
  115. package/lib/module/types/live-activities.js +88 -0
  116. package/lib/module/types/live-activities.js.map +1 -0
  117. package/lib/module/utils/param-validation.js +76 -1
  118. package/lib/module/utils/param-validation.js.map +1 -1
  119. package/lib/module/zixflow-cdp.js +99 -1
  120. package/lib/module/zixflow-cdp.js.map +1 -1
  121. package/lib/module/zixflow-geofence.js +50 -0
  122. package/lib/module/zixflow-geofence.js.map +1 -0
  123. package/lib/module/zixflow-inapp.js +99 -1
  124. package/lib/module/zixflow-inapp.js.map +1 -1
  125. package/lib/module/zixflow-liveactivities.js +80 -0
  126. package/lib/module/zixflow-liveactivities.js.map +1 -0
  127. package/lib/typescript/commonjs/components/NotificationInboxBellView.d.ts +39 -0
  128. package/lib/typescript/commonjs/components/NotificationInboxBellView.d.ts.map +1 -0
  129. package/lib/typescript/commonjs/components/NotificationInboxView.d.ts +25 -0
  130. package/lib/typescript/commonjs/components/NotificationInboxView.d.ts.map +1 -0
  131. package/lib/typescript/commonjs/components/index.d.ts +4 -0
  132. package/lib/typescript/commonjs/components/index.d.ts.map +1 -1
  133. package/lib/typescript/commonjs/index.d.ts +8 -1
  134. package/lib/typescript/commonjs/index.d.ts.map +1 -1
  135. package/lib/typescript/commonjs/notification-inbox.d.ts +5 -0
  136. package/lib/typescript/commonjs/notification-inbox.d.ts.map +1 -1
  137. package/lib/typescript/commonjs/specs/components/NotificationInboxBellNativeComponent.d.ts +13 -0
  138. package/lib/typescript/commonjs/specs/components/NotificationInboxBellNativeComponent.d.ts.map +1 -0
  139. package/lib/typescript/commonjs/specs/components/NotificationInboxViewNativeComponent.d.ts +12 -0
  140. package/lib/typescript/commonjs/specs/components/NotificationInboxViewNativeComponent.d.ts.map +1 -0
  141. package/lib/typescript/commonjs/specs/modules/NativeZixflow.d.ts +6 -1
  142. package/lib/typescript/commonjs/specs/modules/NativeZixflow.d.ts.map +1 -1
  143. package/lib/typescript/commonjs/specs/modules/NativeZixflowGeofence.d.ts +13 -0
  144. package/lib/typescript/commonjs/specs/modules/NativeZixflowGeofence.d.ts.map +1 -0
  145. package/lib/typescript/commonjs/specs/modules/NativeZixflowLiveActivities.d.ts +31 -0
  146. package/lib/typescript/commonjs/specs/modules/NativeZixflowLiveActivities.d.ts.map +1 -0
  147. package/lib/typescript/commonjs/specs/modules/NativeZixflowMessagingInApp.d.ts +5 -1
  148. package/lib/typescript/commonjs/specs/modules/NativeZixflowMessagingInApp.d.ts.map +1 -1
  149. package/lib/typescript/commonjs/specs/modules/NativeZixflowMessagingPush.d.ts +1 -1
  150. package/lib/typescript/commonjs/specs/modules/NativeZixflowMessagingPush.d.ts.map +1 -1
  151. package/lib/typescript/commonjs/types/data-pipelines.d.ts +53 -1
  152. package/lib/typescript/commonjs/types/data-pipelines.d.ts.map +1 -1
  153. package/lib/typescript/commonjs/types/in-app.d.ts +22 -0
  154. package/lib/typescript/commonjs/types/in-app.d.ts.map +1 -1
  155. package/lib/typescript/commonjs/types/inbox.d.ts +97 -0
  156. package/lib/typescript/commonjs/types/inbox.d.ts.map +1 -0
  157. package/lib/typescript/commonjs/types/index.d.ts +2 -0
  158. package/lib/typescript/commonjs/types/index.d.ts.map +1 -1
  159. package/lib/typescript/commonjs/types/live-activities.d.ts +161 -0
  160. package/lib/typescript/commonjs/types/live-activities.d.ts.map +1 -0
  161. package/lib/typescript/commonjs/utils/param-validation.d.ts +7 -0
  162. package/lib/typescript/commonjs/utils/param-validation.d.ts.map +1 -1
  163. package/lib/typescript/commonjs/zixflow-cdp.d.ts +38 -0
  164. package/lib/typescript/commonjs/zixflow-cdp.d.ts.map +1 -1
  165. package/lib/typescript/commonjs/zixflow-geofence.d.ts +36 -0
  166. package/lib/typescript/commonjs/zixflow-geofence.d.ts.map +1 -0
  167. package/lib/typescript/commonjs/zixflow-inapp.d.ts +36 -2
  168. package/lib/typescript/commonjs/zixflow-inapp.d.ts.map +1 -1
  169. package/lib/typescript/commonjs/zixflow-liveactivities.d.ts +66 -0
  170. package/lib/typescript/commonjs/zixflow-liveactivities.d.ts.map +1 -0
  171. package/lib/typescript/module/components/NotificationInboxBellView.d.ts +39 -0
  172. package/lib/typescript/module/components/NotificationInboxBellView.d.ts.map +1 -0
  173. package/lib/typescript/module/components/NotificationInboxView.d.ts +25 -0
  174. package/lib/typescript/module/components/NotificationInboxView.d.ts.map +1 -0
  175. package/lib/typescript/module/components/index.d.ts +4 -0
  176. package/lib/typescript/module/components/index.d.ts.map +1 -1
  177. package/lib/typescript/module/index.d.ts +8 -1
  178. package/lib/typescript/module/index.d.ts.map +1 -1
  179. package/lib/typescript/module/notification-inbox.d.ts +5 -0
  180. package/lib/typescript/module/notification-inbox.d.ts.map +1 -1
  181. package/lib/typescript/module/specs/components/NotificationInboxBellNativeComponent.d.ts +13 -0
  182. package/lib/typescript/module/specs/components/NotificationInboxBellNativeComponent.d.ts.map +1 -0
  183. package/lib/typescript/module/specs/components/NotificationInboxViewNativeComponent.d.ts +12 -0
  184. package/lib/typescript/module/specs/components/NotificationInboxViewNativeComponent.d.ts.map +1 -0
  185. package/lib/typescript/module/specs/modules/NativeZixflow.d.ts +6 -1
  186. package/lib/typescript/module/specs/modules/NativeZixflow.d.ts.map +1 -1
  187. package/lib/typescript/module/specs/modules/NativeZixflowGeofence.d.ts +13 -0
  188. package/lib/typescript/module/specs/modules/NativeZixflowGeofence.d.ts.map +1 -0
  189. package/lib/typescript/module/specs/modules/NativeZixflowLiveActivities.d.ts +31 -0
  190. package/lib/typescript/module/specs/modules/NativeZixflowLiveActivities.d.ts.map +1 -0
  191. package/lib/typescript/module/specs/modules/NativeZixflowMessagingInApp.d.ts +5 -1
  192. package/lib/typescript/module/specs/modules/NativeZixflowMessagingInApp.d.ts.map +1 -1
  193. package/lib/typescript/module/specs/modules/NativeZixflowMessagingPush.d.ts +1 -1
  194. package/lib/typescript/module/specs/modules/NativeZixflowMessagingPush.d.ts.map +1 -1
  195. package/lib/typescript/module/types/data-pipelines.d.ts +53 -1
  196. package/lib/typescript/module/types/data-pipelines.d.ts.map +1 -1
  197. package/lib/typescript/module/types/in-app.d.ts +22 -0
  198. package/lib/typescript/module/types/in-app.d.ts.map +1 -1
  199. package/lib/typescript/module/types/inbox.d.ts +97 -0
  200. package/lib/typescript/module/types/inbox.d.ts.map +1 -0
  201. package/lib/typescript/module/types/index.d.ts +2 -0
  202. package/lib/typescript/module/types/index.d.ts.map +1 -1
  203. package/lib/typescript/module/types/live-activities.d.ts +161 -0
  204. package/lib/typescript/module/types/live-activities.d.ts.map +1 -0
  205. package/lib/typescript/module/utils/param-validation.d.ts +7 -0
  206. package/lib/typescript/module/utils/param-validation.d.ts.map +1 -1
  207. package/lib/typescript/module/zixflow-cdp.d.ts +38 -0
  208. package/lib/typescript/module/zixflow-cdp.d.ts.map +1 -1
  209. package/lib/typescript/module/zixflow-geofence.d.ts +36 -0
  210. package/lib/typescript/module/zixflow-geofence.d.ts.map +1 -0
  211. package/lib/typescript/module/zixflow-inapp.d.ts +36 -2
  212. package/lib/typescript/module/zixflow-inapp.d.ts.map +1 -1
  213. package/lib/typescript/module/zixflow-liveactivities.d.ts +66 -0
  214. package/lib/typescript/module/zixflow-liveactivities.d.ts.map +1 -0
  215. package/package.json +11 -2
  216. package/src/components/NotificationInboxBellView.tsx +55 -0
  217. package/src/components/NotificationInboxView.tsx +30 -0
  218. package/src/components/index.ts +6 -0
  219. package/src/index.ts +8 -3
  220. package/src/notification-inbox.ts +1 -1
  221. package/src/specs/components/NotificationInboxBellNativeComponent.ts +24 -0
  222. package/src/specs/components/NotificationInboxViewNativeComponent.ts +22 -0
  223. package/src/specs/modules/NativeZixflow.ts +9 -1
  224. package/src/specs/modules/NativeZixflowGeofence.ts +14 -0
  225. package/src/specs/modules/NativeZixflowLiveActivities.ts +39 -0
  226. package/src/specs/modules/NativeZixflowMessagingInApp.ts +12 -1
  227. package/src/specs/modules/NativeZixflowMessagingPush.ts +3 -1
  228. package/src/types/data-pipelines.ts +54 -1
  229. package/src/types/in-app.ts +23 -0
  230. package/src/types/inbox.ts +110 -0
  231. package/src/types/index.ts +2 -0
  232. package/src/types/live-activities.ts +170 -0
  233. package/src/utils/param-validation.ts +103 -0
  234. package/src/zixflow-cdp.ts +117 -1
  235. package/src/zixflow-geofence.ts +56 -0
  236. package/src/zixflow-inapp.ts +125 -2
  237. package/src/zixflow-liveactivities.ts +86 -0
  238. package/zixflow-reactnative-richpush.podspec +4 -1
  239. package/zixflow-reactnative.podspec +26 -0
@@ -3,13 +3,16 @@ import { InlineInAppMessageView } from './components';
3
3
  import { NativeLoggerListener } from './native-logger-listener';
4
4
  import {
5
5
  NotificationInbox,
6
+ parseInboxMessage,
6
7
  type NotificationInboxSpec,
7
8
  } from './notification-inbox';
8
9
  import NativeZixflowMessagingInApp, {
9
10
  type Spec as CodegenSpec,
10
11
  } from './specs/modules/NativeZixflowMessagingInApp';
11
- import type { InAppMessageEventType } from './types';
12
+ import type { ZixflowColorScheme, InAppMessageEventType } from './types';
13
+ import { InboxEventType, InboxMessageEvent } from './types';
12
14
  import { callNativeModule, ensureNativeModule } from './utils/native-bridge';
15
+ import { assert } from './utils/param-validation';
13
16
 
14
17
  /**
15
18
  * Ensures all methods defined in codegen spec are implemented by the public module
@@ -18,7 +21,12 @@ import { callNativeModule, ensureNativeModule } from './utils/native-bridge';
18
21
  */
19
22
  interface NativeInAppSpec extends Omit<
20
23
  CodegenSpec,
21
- keyof TurboModule | NotificationInboxSpec | 'onInAppEventReceived'
24
+ | keyof TurboModule
25
+ | NotificationInboxSpec
26
+ | 'onInAppEventReceived'
27
+ | 'registerInboxEventListener'
28
+ | 'unregisterInboxEventListener'
29
+ | 'onInboxEventReceived'
22
30
  > {}
23
31
 
24
32
  // Reference to the native Zixflow Data Pipelines module for SDK operations
@@ -37,6 +45,13 @@ const withNativeModule = <R>(fn: (native: CodegenSpec) => R): R => {
37
45
  class ZixflowInAppMessaging implements NativeInAppSpec {
38
46
  private _notificationInbox?: NotificationInbox;
39
47
 
48
+ /**
49
+ * Live inbox subscriptions. The SDK's inbox forwarder is a SINGLE global listener, so it is
50
+ * registered when the first subscription is created and unregistered when the last one goes away —
51
+ * never per subscription, or one `remove()` would tear it out from under the others.
52
+ */
53
+ private _inboxListenerCount = 0;
54
+
40
55
  registerEventsListener(
41
56
  listener: (event: InAppMessageEvent) => void
42
57
  ): EventSubscription {
@@ -74,6 +89,91 @@ class ZixflowInAppMessaging implements NativeInAppSpec {
74
89
  });
75
90
  }
76
91
 
92
+ /**
93
+ * Registers a listener for Visual Notification Inbox events (action taken,
94
+ * shown, opened, dismissed).
95
+ *
96
+ * While a listener is registered the host owns action navigation: the native
97
+ * SDK suppresses its default action handling and forwards the event here.
98
+ * Call `.remove()` on the returned subscription to unregister and restore the
99
+ * SDK's default behavior.
100
+ *
101
+ * @param listener - callback invoked with an {@link InboxMessageEvent}
102
+ * @returns an EventSubscription; call `.remove()` to stop listening
103
+ */
104
+ registerInboxEventListener(
105
+ listener: (event: InboxMessageEvent) => void
106
+ ): EventSubscription {
107
+ const emitter = (data: any) => {
108
+ // Convert raw native payload to InboxMessageEvent with a parsed message
109
+ const event = new InboxMessageEvent(
110
+ data.eventType as InboxEventType,
111
+ parseInboxMessage(data.message),
112
+ data.actionName,
113
+ data.actionValue
114
+ );
115
+ listener(event);
116
+ };
117
+
118
+ return withNativeModule((native) => {
119
+ let registeredNativeForwarder = false;
120
+ try {
121
+ // Register the native forwarder with the SDK, then subscribe to the
122
+ // codegen-generated event emitter.
123
+ // Wrapped in try-catch due to previous reports of crashes on certain Android architectures.
124
+ if (this._inboxListenerCount === 0) {
125
+ native.registerInboxEventListener();
126
+ registeredNativeForwarder = true;
127
+ }
128
+ const subscription = native.onInboxEventReceived(emitter);
129
+ this._inboxListenerCount += 1;
130
+
131
+ // Wrap remove() so unregistering the LAST JS listener also unregisters the native forwarder
132
+ // (restoring the SDK's default action handling). Guarded so a double remove() cannot
133
+ // unbalance the count and drop the forwarder while other subscriptions are still live.
134
+ const originalRemove = subscription.remove.bind(subscription);
135
+ let removed = false;
136
+ subscription.remove = () => {
137
+ if (removed) {
138
+ return;
139
+ }
140
+ removed = true;
141
+ originalRemove();
142
+ this._inboxListenerCount -= 1;
143
+ if (this._inboxListenerCount === 0) {
144
+ withNativeModule((n) => n.unregisterInboxEventListener());
145
+ }
146
+ };
147
+ return subscription;
148
+ } catch (error) {
149
+ // If the forwarder was registered and subscribing then failed, roll it back. Otherwise the
150
+ // SDK keeps suppressing its own action handling while nothing in JS is listening, so inbox
151
+ // actions are reported as handled and silently go nowhere.
152
+ if (registeredNativeForwarder) {
153
+ try {
154
+ native.unregisterInboxEventListener();
155
+ } catch (rollbackError) {
156
+ NativeLoggerListener.warn(
157
+ 'Failed to roll back inbox listener registration:',
158
+ rollbackError
159
+ );
160
+ }
161
+ }
162
+ NativeLoggerListener.warn(
163
+ 'Failed to attach inbox event listener:',
164
+ error
165
+ );
166
+ // Return a no-op subscription to maintain backwards compatibility
167
+ return {
168
+ remove: () => {},
169
+ eventType: '',
170
+ key: 0,
171
+ subscriber: null as any,
172
+ } as EventSubscription;
173
+ }
174
+ });
175
+ }
176
+
77
177
  /**
78
178
  * Dismisses any currently displayed in-app message
79
179
  */
@@ -81,6 +181,23 @@ class ZixflowInAppMessaging implements NativeInAppSpec {
81
181
  withNativeModule((native) => native.dismissMessage());
82
182
  }
83
183
 
184
+ /**
185
+ * Overrides the color scheme used to render in-app messages.
186
+ *
187
+ * Takes effect immediately: messages already on screen — inline views included — are
188
+ * re-themed in place, so this can be called whenever the app's appearance setting
189
+ * changes rather than only before a message is shown.
190
+ *
191
+ * @param colorScheme - scheme to render with; `ZixflowColorScheme.Auto` returns to following
192
+ * the device appearance
193
+ */
194
+ setColorScheme(colorScheme: ZixflowColorScheme) {
195
+ // Validated here as well as in `initialize`: this is a public method reachable from
196
+ // untyped JavaScript, and without it a bad value reaches the native fallback silently.
197
+ assert.colorScheme(colorScheme);
198
+ withNativeModule((native) => native.setColorScheme(colorScheme));
199
+ }
200
+
84
201
  /**
85
202
  * Gets the message inbox instance for managing inbox messages
86
203
  *
@@ -122,6 +239,12 @@ class InAppMessageEvent {
122
239
 
123
240
  // Export in-app messaging types and components for simplified imports
124
241
  export type { InlineInAppMessageViewProps } from './components';
242
+ export type {
243
+ NotificationInboxBellViewProps,
244
+ NotificationInboxViewProps,
245
+ } from './components';
246
+ export { NotificationInboxBellView, NotificationInboxView } from './components';
125
247
  export { NotificationInbox } from './notification-inbox';
126
248
  export type { InboxMessage, NotificationInboxChangeListener } from './types';
249
+ export { InboxEventType, InboxMessageEvent } from './types';
127
250
  export { ZixflowInAppMessaging, InAppMessageEvent, InlineInAppMessageView };
@@ -0,0 +1,86 @@
1
+ import { type TurboModule } from 'react-native';
2
+ import {
3
+ default as NativeModule,
4
+ type Spec as CodegenSpec,
5
+ } from './specs/modules/NativeZixflowLiveActivities';
6
+ import type { LiveActivityPayload } from './types/live-activities';
7
+
8
+ /**
9
+ * Ensures all methods defined in codegen spec are implemented by the public module
10
+ *
11
+ * @internal
12
+ */
13
+ interface NativeLiveActivitiesSpec extends Omit<
14
+ CodegenSpec,
15
+ keyof TurboModule
16
+ > {}
17
+
18
+ /**
19
+ * Live Activities (iOS) / Live Notifications (Android).
20
+ *
21
+ * Start, update, and end live, updating notifications from built-in templates
22
+ * (Segments, Countdown Timer). Enable the activity types via the `liveNotifications`
23
+ * key of the SDK config passed to {@link Zixflow.initialize}.
24
+ *
25
+ * @public
26
+ */
27
+ export class ZixflowLiveActivities implements NativeLiveActivitiesSpec {
28
+ /**
29
+ * Report an opened Live Activity and return the URL the app should route.
30
+ *
31
+ * Zixflow tracking URLs are unwrapped to their destination after attribution is recorded.
32
+ * A tracking URL without a destination returns `null`; any other URL is returned unchanged.
33
+ * This method never rejects, so it can safely compose with Expo Router's
34
+ * `redirectSystemPath` hook. On Android it is a pass-through.
35
+ *
36
+ * Use this in exactly one URL-routing layer. Calling it more than once for the same Zixflow
37
+ * tracking URL reports more than one opened event.
38
+ *
39
+ * @param url - The incoming URL from the host's linking lifecycle.
40
+ * @returns The URL to route, or `null` when the Zixflow URL has no destination.
41
+ */
42
+ async handleWidgetUrl(url: string): Promise<string | null> {
43
+ try {
44
+ return await NativeModule.handleWidgetUrl(url);
45
+ } catch {
46
+ return url;
47
+ }
48
+ }
49
+
50
+ /**
51
+ * Start a built-in-template activity.
52
+ *
53
+ * @param payload - Template payload; `payload.type` selects the template.
54
+ * @returns The SDK-minted activity id, used for later `update`/`end`.
55
+ */
56
+ start(payload: LiveActivityPayload): Promise<string> {
57
+ return NativeModule.start(payload);
58
+ }
59
+
60
+ /**
61
+ * Replace the whole content-state of a running activity.
62
+ *
63
+ * ActivityKit (iOS) replaces content-state wholesale, so pass the **full** desired
64
+ * state — not just the changed fields. Static attributes (e.g. `header`) cannot
65
+ * change after start and are ignored on iOS.
66
+ *
67
+ * @param activityId - Id returned by {@link ZixflowLiveActivities.start}.
68
+ * @param payload - The complete desired state.
69
+ */
70
+ update(activityId: string, payload: LiveActivityPayload): Promise<void> {
71
+ return NativeModule.update(activityId, payload);
72
+ }
73
+
74
+ /**
75
+ * End a running activity, optionally rendering a final content-state.
76
+ *
77
+ * @param activityId - Id returned by {@link ZixflowLiveActivities.start}.
78
+ * @param payload - **iOS only.** The final content-state to render as the activity ends.
79
+ * ActivityKit keeps the last content-state on screen when none is given, so pass one to show
80
+ * a terminal state (e.g. all segments complete). Android renders its own terminal state and
81
+ * ignores this.
82
+ */
83
+ end(activityId: string, payload?: LiveActivityPayload): Promise<void> {
84
+ return NativeModule.end(activityId, payload);
85
+ }
86
+ }
@@ -15,7 +15,10 @@ Pod::Spec.new do |s|
15
15
 
16
16
  s.source = { :git => "https://github.com/zixflow/zixflow-reactnative.git", :tag => "#{s.version}" }
17
17
 
18
- s.source_files = "ios/**/*.{h,m,mm,swift}"
18
+ # Dependency-only pod: installed into the NSE target, whose job is purely to pull in the minimal
19
+ # CIO push dependency below. It must NOT compile any sources — everything under ios/ is the React
20
+ # Native bridge (React + DataPipelines + InApp + Inbox), none of which the NSE target has or should
21
+ # have. Globbing them here made the NSE compile the whole bridge and fail on React headers.
19
22
 
20
23
  # Note: Zixflow iOS SDK dependencies need to be added to NSE target via CocoaPods
21
24
  # Add these pods to your NotificationServiceExtension target in your Podfile:
@@ -14,6 +14,9 @@ Pod::Spec.new do |s|
14
14
  s.platforms = { :ios => min_ios_version_supported }
15
15
  s.source = { :git => "https://github.com/zixflow/zixflow-reactnative.git", :tag => "#{s.version}" }
16
16
 
17
+ # The generated Swift compatibility header imports
18
+ # <zixflow_reactnative/zixflow_reactnative.h> in static-library builds.
19
+ s.header_dir = "zixflow_reactnative"
17
20
  s.source_files = "ios/wrappers/**/*.{h,m,mm,swift}"
18
21
 
19
22
  # Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
@@ -28,6 +31,9 @@ Pod::Spec.new do |s|
28
31
  # Reference: https://guides.cocoapods.org/syntax/podfile.html#pod
29
32
  s.dependency "Zixflow/DataPipelines", package["zixflowNativeiOSSdkVersion"]
30
33
  s.dependency "Zixflow/MessagingInApp", package["zixflowNativeiOSSdkVersion"]
34
+ # Visual Notification Inbox UI (SwiftUI). Not optional: the bridge in ios/wrappers/inbox/* imports
35
+ # ZixflowMessagingInbox, and a pod target only sees the modules its podspec declares.
36
+ s.dependency "Zixflow/MessagingInbox", package["zixflowNativeiOSSdkVersion"]
31
37
 
32
38
  # If we do not specify a default_subspec, then *all* dependencies inside of *all* the subspecs will be downloaded by cocoapods.
33
39
  # Users should opt into push dependencies - FCM subspec downloads Firebase dependencies while APN does not.
@@ -57,4 +63,24 @@ Pod::Spec.new do |s|
57
63
  'OTHER_SWIFT_FLAGS' => '$(inherited) -DZIXFLOW_LOCATION_ENABLED'
58
64
  }
59
65
  end
66
+
67
+ # Geofence module is optional - customers must opt in by adding this subspec.
68
+ # It pulls in Location transitively (Zixflow/LocationGeofence depends on it).
69
+ # Geofence implies Location, so this subspec also enables the Location wrapper code.
70
+ s.subspec "geofence" do |ss|
71
+ ss.dependency "Zixflow/LocationGeofence", package["zixflowNativeiOSSdkVersion"]
72
+ ss.pod_target_xcconfig = {
73
+ 'OTHER_SWIFT_FLAGS' => '$(inherited) -DZIXFLOW_GEOFENCE_ENABLED -DZIXFLOW_LOCATION_ENABLED'
74
+ }
75
+ end
76
+
77
+ # Live Activities module is optional - customers must opt in by adding this subspec, and must
78
+ # also add a Widget Extension target that renders the built-in templates. See the docs.
79
+ s.subspec "liveactivities" do |ss|
80
+ ss.dependency "Zixflow/LiveActivities", package["zixflowNativeiOSSdkVersion"]
81
+ ss.dependency "Zixflow/LiveActivitiesTemplates", package["zixflowNativeiOSSdkVersion"]
82
+ ss.pod_target_xcconfig = {
83
+ 'OTHER_SWIFT_FLAGS' => '$(inherited) -DZIXFLOW_LIVEACTIVITIES_ENABLED'
84
+ }
85
+ end
60
86
  end