zixflow-reactnative 1.1.2 → 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 (249) hide show
  1. package/README.md +2224 -322
  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 +69 -24
  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 -3
  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/logging/NativeZixflowLoggingModule.kt +2 -2
  11. package/android/src/main/java/com/zixflow/reactnative/sdk/messaginginapp/NativeMessagingInAppModule.kt +149 -10
  12. package/android/src/main/java/com/zixflow/reactnative/sdk/messaginginapp/ReactInboxEventListener.kt +99 -0
  13. package/android/src/main/java/com/zixflow/reactnative/sdk/messaginginbox/NotificationInboxBellViewManager.kt +38 -0
  14. package/android/src/main/java/com/zixflow/reactnative/sdk/messaginginbox/NotificationInboxViewManager.kt +30 -0
  15. package/android/src/main/java/com/zixflow/reactnative/sdk/messaginginbox/ReactComposeHostView.kt +96 -0
  16. package/android/src/main/java/com/zixflow/reactnative/sdk/messaginginbox/ReactNotificationInboxBellView.kt +48 -0
  17. package/android/src/main/java/com/zixflow/reactnative/sdk/messaginginbox/ReactNotificationInboxView.kt +17 -0
  18. package/android/src/main/java/com/zixflow/reactnative/sdk/messagingpush/NativeMessagingPushModule.kt +11 -1
  19. package/android/src/main/res/values/zixflow_config.xml +1 -1
  20. package/android/zixflow-core.gradle +17 -7
  21. package/docs/cocoapods-deployment-target-normalization.md +139 -0
  22. package/ios/cocoapods_deployment_target.rb +432 -0
  23. package/ios/wrappers/NativeZixflow.mm +37 -0
  24. package/ios/wrappers/NativeZixflow.swift +135 -1
  25. package/ios/wrappers/ZixflowReactNativeDeepLinkRequestStore.swift +123 -0
  26. package/ios/wrappers/ZixflowReactNativeDeepLinkRouter.swift +312 -0
  27. package/ios/wrappers/geofence/NativeGeofence.mm +46 -0
  28. package/ios/wrappers/geofence/NativeGeofence.swift +27 -0
  29. package/ios/wrappers/inapp/NativeMessagingInApp.mm +22 -0
  30. package/ios/wrappers/inapp/NativeMessagingInApp.swift +90 -0
  31. package/ios/wrappers/inbox/InboxHostContainment.swift +40 -0
  32. package/ios/wrappers/inbox/RCTNotificationInboxBellNative.h +12 -0
  33. package/ios/wrappers/inbox/RCTNotificationInboxBellNative.mm +98 -0
  34. package/ios/wrappers/inbox/RCTNotificationInboxViewNative.h +12 -0
  35. package/ios/wrappers/inbox/RCTNotificationInboxViewNative.mm +78 -0
  36. package/ios/wrappers/inbox/ReactInboxEventListener.swift +76 -0
  37. package/ios/wrappers/inbox/ReactNotificationInboxBellView.h +22 -0
  38. package/ios/wrappers/inbox/ReactNotificationInboxBellView.swift +109 -0
  39. package/ios/wrappers/inbox/ReactNotificationInboxView.h +22 -0
  40. package/ios/wrappers/inbox/ReactNotificationInboxView.swift +69 -0
  41. package/ios/wrappers/liveactivities/NativeLiveActivities.mm +83 -0
  42. package/ios/wrappers/liveactivities/NativeLiveActivities.swift +390 -0
  43. package/ios/wrappers/location/NativeLocation.swift +7 -5
  44. package/ios/wrappers/utils/ZixflowConfigUtils.swift +5 -9
  45. package/ios/wrappers/utils/ZixflowConstants.swift +4 -0
  46. package/ios/wrappers/zixflow_reactnative.h +6 -0
  47. package/lib/commonjs/components/NotificationInboxBellView.js +49 -0
  48. package/lib/commonjs/components/NotificationInboxBellView.js.map +1 -0
  49. package/lib/commonjs/components/NotificationInboxView.js +36 -0
  50. package/lib/commonjs/components/NotificationInboxView.js.map +1 -0
  51. package/lib/commonjs/components/index.js +14 -0
  52. package/lib/commonjs/components/index.js.map +1 -1
  53. package/lib/commonjs/index.js +81 -4
  54. package/lib/commonjs/index.js.map +1 -1
  55. package/lib/commonjs/notification-inbox.js +1 -0
  56. package/lib/commonjs/notification-inbox.js.map +1 -1
  57. package/lib/commonjs/specs/components/NotificationInboxBellNativeComponent.ts +24 -0
  58. package/lib/commonjs/specs/components/NotificationInboxViewNativeComponent.ts +22 -0
  59. package/lib/commonjs/specs/modules/NativeZixflow.js.map +1 -1
  60. package/lib/commonjs/specs/modules/NativeZixflowGeofence.js +15 -0
  61. package/lib/commonjs/specs/modules/NativeZixflowGeofence.js.map +1 -0
  62. package/lib/commonjs/specs/modules/NativeZixflowLiveActivities.js +23 -0
  63. package/lib/commonjs/specs/modules/NativeZixflowLiveActivities.js.map +1 -0
  64. package/lib/commonjs/specs/modules/NativeZixflowMessagingInApp.js +3 -1
  65. package/lib/commonjs/specs/modules/NativeZixflowMessagingInApp.js.map +1 -1
  66. package/lib/commonjs/specs/modules/NativeZixflowMessagingPush.js +3 -1
  67. package/lib/commonjs/specs/modules/NativeZixflowMessagingPush.js.map +1 -1
  68. package/lib/commonjs/types/data-pipelines.js +15 -15
  69. package/lib/commonjs/types/data-pipelines.js.map +1 -1
  70. package/lib/commonjs/types/in-app.js +24 -1
  71. package/lib/commonjs/types/in-app.js.map +1 -1
  72. package/lib/commonjs/types/inbox.js +79 -0
  73. package/lib/commonjs/types/inbox.js.map +1 -0
  74. package/lib/commonjs/types/index.js +22 -0
  75. package/lib/commonjs/types/index.js.map +1 -1
  76. package/lib/commonjs/types/live-activities.js +85 -0
  77. package/lib/commonjs/types/live-activities.js.map +1 -0
  78. package/lib/commonjs/utils/param-validation.js +77 -2
  79. package/lib/commonjs/utils/param-validation.js.map +1 -1
  80. package/lib/commonjs/zixflow-cdp.js +101 -11
  81. package/lib/commonjs/zixflow-cdp.js.map +1 -1
  82. package/lib/commonjs/zixflow-geofence.js +55 -0
  83. package/lib/commonjs/zixflow-geofence.js.map +1 -0
  84. package/lib/commonjs/zixflow-inapp.js +120 -0
  85. package/lib/commonjs/zixflow-inapp.js.map +1 -1
  86. package/lib/commonjs/zixflow-liveactivities.js +85 -0
  87. package/lib/commonjs/zixflow-liveactivities.js.map +1 -0
  88. package/lib/commonjs/zixflow.js.map +1 -1
  89. package/lib/module/components/NotificationInboxBellView.js +44 -0
  90. package/lib/module/components/NotificationInboxBellView.js.map +1 -0
  91. package/lib/module/components/NotificationInboxView.js +31 -0
  92. package/lib/module/components/NotificationInboxView.js.map +1 -0
  93. package/lib/module/components/index.js +5 -0
  94. package/lib/module/components/index.js.map +1 -1
  95. package/lib/module/index.js +8 -3
  96. package/lib/module/index.js.map +1 -1
  97. package/lib/module/notification-inbox.js +1 -1
  98. package/lib/module/notification-inbox.js.map +1 -1
  99. package/lib/module/specs/components/NotificationInboxBellNativeComponent.ts +24 -0
  100. package/lib/module/specs/components/NotificationInboxViewNativeComponent.ts +22 -0
  101. package/lib/module/specs/modules/NativeZixflow.js.map +1 -1
  102. package/lib/module/specs/modules/NativeZixflowGeofence.js +13 -0
  103. package/lib/module/specs/modules/NativeZixflowGeofence.js.map +1 -0
  104. package/lib/module/specs/modules/NativeZixflowLiveActivities.js +21 -0
  105. package/lib/module/specs/modules/NativeZixflowLiveActivities.js.map +1 -0
  106. package/lib/module/specs/modules/NativeZixflowMessagingInApp.js +3 -1
  107. package/lib/module/specs/modules/NativeZixflowMessagingInApp.js.map +1 -1
  108. package/lib/module/specs/modules/NativeZixflowMessagingPush.js +3 -1
  109. package/lib/module/specs/modules/NativeZixflowMessagingPush.js.map +1 -1
  110. package/lib/module/types/data-pipelines.js +15 -15
  111. package/lib/module/types/data-pipelines.js.map +1 -1
  112. package/lib/module/types/in-app.js +24 -0
  113. package/lib/module/types/in-app.js.map +1 -1
  114. package/lib/module/types/inbox.js +75 -0
  115. package/lib/module/types/inbox.js.map +1 -0
  116. package/lib/module/types/index.js +2 -0
  117. package/lib/module/types/index.js.map +1 -1
  118. package/lib/module/types/live-activities.js +88 -0
  119. package/lib/module/types/live-activities.js.map +1 -0
  120. package/lib/module/utils/param-validation.js +77 -2
  121. package/lib/module/utils/param-validation.js.map +1 -1
  122. package/lib/module/zixflow-cdp.js +101 -11
  123. package/lib/module/zixflow-cdp.js.map +1 -1
  124. package/lib/module/zixflow-geofence.js +50 -0
  125. package/lib/module/zixflow-geofence.js.map +1 -0
  126. package/lib/module/zixflow-inapp.js +99 -1
  127. package/lib/module/zixflow-inapp.js.map +1 -1
  128. package/lib/module/zixflow-liveactivities.js +80 -0
  129. package/lib/module/zixflow-liveactivities.js.map +1 -0
  130. package/lib/module/zixflow.js +0 -6
  131. package/lib/module/zixflow.js.map +1 -1
  132. package/lib/typescript/commonjs/components/NotificationInboxBellView.d.ts +39 -0
  133. package/lib/typescript/commonjs/components/NotificationInboxBellView.d.ts.map +1 -0
  134. package/lib/typescript/commonjs/components/NotificationInboxView.d.ts +25 -0
  135. package/lib/typescript/commonjs/components/NotificationInboxView.d.ts.map +1 -0
  136. package/lib/typescript/commonjs/components/index.d.ts +4 -0
  137. package/lib/typescript/commonjs/components/index.d.ts.map +1 -1
  138. package/lib/typescript/commonjs/index.d.ts +8 -1
  139. package/lib/typescript/commonjs/index.d.ts.map +1 -1
  140. package/lib/typescript/commonjs/notification-inbox.d.ts +5 -0
  141. package/lib/typescript/commonjs/notification-inbox.d.ts.map +1 -1
  142. package/lib/typescript/commonjs/specs/components/NotificationInboxBellNativeComponent.d.ts +13 -0
  143. package/lib/typescript/commonjs/specs/components/NotificationInboxBellNativeComponent.d.ts.map +1 -0
  144. package/lib/typescript/commonjs/specs/components/NotificationInboxViewNativeComponent.d.ts +12 -0
  145. package/lib/typescript/commonjs/specs/components/NotificationInboxViewNativeComponent.d.ts.map +1 -0
  146. package/lib/typescript/commonjs/specs/modules/NativeZixflow.d.ts +6 -1
  147. package/lib/typescript/commonjs/specs/modules/NativeZixflow.d.ts.map +1 -1
  148. package/lib/typescript/commonjs/specs/modules/NativeZixflowGeofence.d.ts +13 -0
  149. package/lib/typescript/commonjs/specs/modules/NativeZixflowGeofence.d.ts.map +1 -0
  150. package/lib/typescript/commonjs/specs/modules/NativeZixflowLiveActivities.d.ts +31 -0
  151. package/lib/typescript/commonjs/specs/modules/NativeZixflowLiveActivities.d.ts.map +1 -0
  152. package/lib/typescript/commonjs/specs/modules/NativeZixflowMessagingInApp.d.ts +5 -1
  153. package/lib/typescript/commonjs/specs/modules/NativeZixflowMessagingInApp.d.ts.map +1 -1
  154. package/lib/typescript/commonjs/specs/modules/NativeZixflowMessagingPush.d.ts +1 -1
  155. package/lib/typescript/commonjs/specs/modules/NativeZixflowMessagingPush.d.ts.map +1 -1
  156. package/lib/typescript/commonjs/types/data-pipelines.d.ts +54 -18
  157. package/lib/typescript/commonjs/types/data-pipelines.d.ts.map +1 -1
  158. package/lib/typescript/commonjs/types/in-app.d.ts +22 -0
  159. package/lib/typescript/commonjs/types/in-app.d.ts.map +1 -1
  160. package/lib/typescript/commonjs/types/inbox.d.ts +97 -0
  161. package/lib/typescript/commonjs/types/inbox.d.ts.map +1 -0
  162. package/lib/typescript/commonjs/types/index.d.ts +2 -0
  163. package/lib/typescript/commonjs/types/index.d.ts.map +1 -1
  164. package/lib/typescript/commonjs/types/live-activities.d.ts +161 -0
  165. package/lib/typescript/commonjs/types/live-activities.d.ts.map +1 -0
  166. package/lib/typescript/commonjs/utils/param-validation.d.ts +7 -0
  167. package/lib/typescript/commonjs/utils/param-validation.d.ts.map +1 -1
  168. package/lib/typescript/commonjs/zixflow-cdp.d.ts +38 -0
  169. package/lib/typescript/commonjs/zixflow-cdp.d.ts.map +1 -1
  170. package/lib/typescript/commonjs/zixflow-geofence.d.ts +36 -0
  171. package/lib/typescript/commonjs/zixflow-geofence.d.ts.map +1 -0
  172. package/lib/typescript/commonjs/zixflow-inapp.d.ts +36 -2
  173. package/lib/typescript/commonjs/zixflow-inapp.d.ts.map +1 -1
  174. package/lib/typescript/commonjs/zixflow-liveactivities.d.ts +66 -0
  175. package/lib/typescript/commonjs/zixflow-liveactivities.d.ts.map +1 -0
  176. package/lib/typescript/commonjs/zixflow.d.ts +0 -5
  177. package/lib/typescript/commonjs/zixflow.d.ts.map +1 -1
  178. package/lib/typescript/module/components/NotificationInboxBellView.d.ts +39 -0
  179. package/lib/typescript/module/components/NotificationInboxBellView.d.ts.map +1 -0
  180. package/lib/typescript/module/components/NotificationInboxView.d.ts +25 -0
  181. package/lib/typescript/module/components/NotificationInboxView.d.ts.map +1 -0
  182. package/lib/typescript/module/components/index.d.ts +4 -0
  183. package/lib/typescript/module/components/index.d.ts.map +1 -1
  184. package/lib/typescript/module/index.d.ts +8 -1
  185. package/lib/typescript/module/index.d.ts.map +1 -1
  186. package/lib/typescript/module/notification-inbox.d.ts +5 -0
  187. package/lib/typescript/module/notification-inbox.d.ts.map +1 -1
  188. package/lib/typescript/module/specs/components/NotificationInboxBellNativeComponent.d.ts +13 -0
  189. package/lib/typescript/module/specs/components/NotificationInboxBellNativeComponent.d.ts.map +1 -0
  190. package/lib/typescript/module/specs/components/NotificationInboxViewNativeComponent.d.ts +12 -0
  191. package/lib/typescript/module/specs/components/NotificationInboxViewNativeComponent.d.ts.map +1 -0
  192. package/lib/typescript/module/specs/modules/NativeZixflow.d.ts +6 -1
  193. package/lib/typescript/module/specs/modules/NativeZixflow.d.ts.map +1 -1
  194. package/lib/typescript/module/specs/modules/NativeZixflowGeofence.d.ts +13 -0
  195. package/lib/typescript/module/specs/modules/NativeZixflowGeofence.d.ts.map +1 -0
  196. package/lib/typescript/module/specs/modules/NativeZixflowLiveActivities.d.ts +31 -0
  197. package/lib/typescript/module/specs/modules/NativeZixflowLiveActivities.d.ts.map +1 -0
  198. package/lib/typescript/module/specs/modules/NativeZixflowMessagingInApp.d.ts +5 -1
  199. package/lib/typescript/module/specs/modules/NativeZixflowMessagingInApp.d.ts.map +1 -1
  200. package/lib/typescript/module/specs/modules/NativeZixflowMessagingPush.d.ts +1 -1
  201. package/lib/typescript/module/specs/modules/NativeZixflowMessagingPush.d.ts.map +1 -1
  202. package/lib/typescript/module/types/data-pipelines.d.ts +54 -18
  203. package/lib/typescript/module/types/data-pipelines.d.ts.map +1 -1
  204. package/lib/typescript/module/types/in-app.d.ts +22 -0
  205. package/lib/typescript/module/types/in-app.d.ts.map +1 -1
  206. package/lib/typescript/module/types/inbox.d.ts +97 -0
  207. package/lib/typescript/module/types/inbox.d.ts.map +1 -0
  208. package/lib/typescript/module/types/index.d.ts +2 -0
  209. package/lib/typescript/module/types/index.d.ts.map +1 -1
  210. package/lib/typescript/module/types/live-activities.d.ts +161 -0
  211. package/lib/typescript/module/types/live-activities.d.ts.map +1 -0
  212. package/lib/typescript/module/utils/param-validation.d.ts +7 -0
  213. package/lib/typescript/module/utils/param-validation.d.ts.map +1 -1
  214. package/lib/typescript/module/zixflow-cdp.d.ts +38 -0
  215. package/lib/typescript/module/zixflow-cdp.d.ts.map +1 -1
  216. package/lib/typescript/module/zixflow-geofence.d.ts +36 -0
  217. package/lib/typescript/module/zixflow-geofence.d.ts.map +1 -0
  218. package/lib/typescript/module/zixflow-inapp.d.ts +36 -2
  219. package/lib/typescript/module/zixflow-inapp.d.ts.map +1 -1
  220. package/lib/typescript/module/zixflow-liveactivities.d.ts +66 -0
  221. package/lib/typescript/module/zixflow-liveactivities.d.ts.map +1 -0
  222. package/lib/typescript/module/zixflow.d.ts +0 -5
  223. package/lib/typescript/module/zixflow.d.ts.map +1 -1
  224. package/package.json +14 -5
  225. package/src/components/NotificationInboxBellView.tsx +55 -0
  226. package/src/components/NotificationInboxView.tsx +30 -0
  227. package/src/components/index.ts +6 -0
  228. package/src/index.ts +8 -3
  229. package/src/notification-inbox.ts +1 -1
  230. package/src/specs/components/NotificationInboxBellNativeComponent.ts +24 -0
  231. package/src/specs/components/NotificationInboxViewNativeComponent.ts +22 -0
  232. package/src/specs/modules/NativeZixflow.ts +9 -1
  233. package/src/specs/modules/NativeZixflowGeofence.ts +14 -0
  234. package/src/specs/modules/NativeZixflowLiveActivities.ts +39 -0
  235. package/src/specs/modules/NativeZixflowMessagingInApp.ts +12 -1
  236. package/src/specs/modules/NativeZixflowMessagingPush.ts +3 -1
  237. package/src/types/data-pipelines.ts +55 -19
  238. package/src/types/in-app.ts +23 -0
  239. package/src/types/inbox.ts +110 -0
  240. package/src/types/index.ts +2 -0
  241. package/src/types/live-activities.ts +170 -0
  242. package/src/utils/param-validation.ts +104 -1
  243. package/src/zixflow-cdp.ts +119 -13
  244. package/src/zixflow-geofence.ts +56 -0
  245. package/src/zixflow-inapp.ts +125 -2
  246. package/src/zixflow-liveactivities.ts +86 -0
  247. package/src/zixflow.ts +0 -6
  248. package/zixflow-reactnative-richpush.podspec +6 -3
  249. package/zixflow-reactnative.podspec +28 -2
@@ -10,11 +10,14 @@ buildscript {
10
10
  dependencies {
11
11
  // noinspection DifferentKotlinGradleVersion
12
12
  classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
13
+ // Compose compiler plugin (Kotlin 2.x) for hosting the Visual Notification Inbox composables.
14
+ classpath "org.jetbrains.kotlin:compose-compiler-gradle-plugin:$kotlin_version"
13
15
  }
14
16
  }
15
17
 
16
18
  apply plugin: 'com.android.library'
17
19
  apply plugin: 'kotlin-android'
20
+ apply plugin: 'org.jetbrains.kotlin.plugin.compose'
18
21
  apply plugin: "com.facebook.react"
19
22
 
20
23
  def getExtOrDefault(name) {
@@ -26,6 +29,7 @@ def getExtOrIntegerDefault(name) {
26
29
  }
27
30
 
28
31
  ext.zixflowLocationEnabled = rootProject.findProperty("zixflow_location_enabled")?.toBoolean() ?: false
32
+ ext.zixflowGeofenceEnabled = rootProject.findProperty("zixflow_geofence_enabled")?.toBoolean() ?: false
29
33
 
30
34
  android {
31
35
  namespace = 'com.zixflow.reactnative.sdk'
@@ -33,12 +37,17 @@ android {
33
37
  defaultConfig {
34
38
  minSdkVersion getExtOrIntegerDefault('minSdkVersion')
35
39
  targetSdkVersion getExtOrIntegerDefault('targetSdkVersion')
36
- buildConfigField "boolean", "ZIXFLOW_LOCATION_ENABLED", "${project.zixflowLocationEnabled}"
40
+ // Geofence implies Location, so the Location flag is on whenever geofence is enabled
41
+ // (mirrors the iOS geofence subspec, which also defines ZIXFLOW_LOCATION_ENABLED).
42
+ buildConfigField "boolean", "ZIXFLOW_LOCATION_ENABLED", "${project.zixflowLocationEnabled || project.zixflowGeofenceEnabled}"
43
+ buildConfigField "boolean", "ZIXFLOW_GEOFENCE_ENABLED", "${project.zixflowGeofenceEnabled}"
37
44
  consumerProguardFiles 'consumer-rules.pro'
38
45
  }
39
46
 
40
47
  buildFeatures {
41
48
  buildConfig true
49
+ // Required to host the Visual Notification Inbox Compose UI components.
50
+ compose true
42
51
  }
43
52
 
44
53
  buildTypes {
@@ -144,4 +153,12 @@ dependencies {
144
153
  // noinspection GradleDynamicVersion
145
154
  api 'com.facebook.react:react-native:+'
146
155
  implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
156
+
157
+ // Jetpack Compose — needed because the Visual Notification Inbox view managers host
158
+ // the native `@Composable` inbox components inside a ComposeView.
159
+ def composeBom = platform('androidx.compose:compose-bom:2025.10.00')
160
+ implementation composeBom
161
+ implementation 'androidx.compose.ui:ui'
162
+ implementation 'androidx.compose.foundation:foundation'
163
+ implementation 'androidx.compose.runtime:runtime'
147
164
  }
@@ -1,3 +1,4 @@
1
- # Location module is an optional compileOnly dependency.
2
- # When not enabled, R8 must not fail on missing location classes.
1
+ # Location and geofence modules are optional compileOnly dependencies.
2
+ # When not enabled, R8 must not fail on their missing classes.
3
3
  -dontwarn io.customer.location.**
4
+ -dontwarn io.customer.geofence.**
@@ -2,4 +2,4 @@ zixflow.reactnative.kotlinVersion=2.1.20
2
2
  zixflow.reactnative.compileSdkVersion=36
3
3
  zixflow.reactnative.targetSdkVersion=36
4
4
  zixflow.reactnative.minSdkVersion=21
5
- zixflow.reactnative.sdkVersionAndroid=1.1.0
5
+ zixflow.reactnative.sdkVersionAndroid=4.23.2
@@ -1,6 +1,7 @@
1
1
  package com.zixflow.reactnative.sdk
2
2
 
3
3
  import android.app.Application
4
+ import android.util.Log
4
5
  import com.facebook.react.bridge.Promise
5
6
  import com.facebook.react.bridge.ReactApplicationContext
6
7
  import com.facebook.react.bridge.ReadableMap
@@ -15,9 +16,8 @@ import com.zixflow.reactnative.sdk.util.assertNotNull
15
16
  import com.zixflow.sdk.Zixflow
16
17
  import com.zixflow.sdk.ZixflowBuilder
17
18
  import com.zixflow.sdk.core.di.SDKComponent
18
- import com.zixflow.sdk.core.util.CioLogLevel
19
+ import com.zixflow.sdk.core.util.ZixflowLogLevel
19
20
  import com.zixflow.sdk.core.util.Logger
20
- import com.zixflow.sdk.data.model.Region
21
21
  import com.zixflow.sdk.events.Metric
22
22
  import com.zixflow.sdk.events.TrackMetric
23
23
  import com.zixflow.sdk.events.serializedName
@@ -47,8 +47,11 @@ class NativeZixflowModule(
47
47
 
48
48
 
49
49
  override fun initialize(config: ReadableMap?, args: ReadableMap?, promise: Promise?) {
50
+ Log.d("ZixflowRN", ">>> initialize() called")
51
+
50
52
  // Skip initialization if already initialized
51
53
  if (getSDKInstanceOrNull() != null) {
54
+ Log.d("ZixflowRN", ">>> SDK already initialized, skipping")
52
55
  logger.info("Zixflow SDK is already initialized. Skipping initialization.")
53
56
  promise?.resolve(true)
54
57
  return
@@ -56,60 +59,86 @@ class NativeZixflowModule(
56
59
 
57
60
  try {
58
61
  val packageConfig = config.toMap()
59
- val cdpApiKey = packageConfig.getTypedValue<String>(
60
- Keys.Config.CDP_API_KEY
61
- ) ?: throw IllegalArgumentException("CDP API Key is required to initialize Zixflow")
62
+ val apiKey = packageConfig.getTypedValue<String>(
63
+ Keys.Config.API_KEY
64
+ ) ?: throw IllegalArgumentException("API Key is required to initialize Zixflow")
62
65
 
63
66
  val logLevelRawValue = packageConfig.getTypedValue<String>(Keys.Config.LOG_LEVEL)
64
- val regionRawValue = packageConfig.getTypedValue<String>(Keys.Config.REGION)
65
- val region = regionRawValue.let { Region.getRegion(it) }
66
67
  val screenViewRawValue =
67
68
  packageConfig.getTypedValue<String>(Keys.Config.SCREEN_VIEW_USE)
68
69
 
70
+ val apiHostValue = packageConfig.getTypedValue<String>(Keys.Config.API_HOST)
71
+ val cdnHostValue = packageConfig.getTypedValue<String>(Keys.Config.CDN_HOST)
72
+
73
+ Log.d("ZixflowRN", "==========================================")
74
+ Log.d("ZixflowRN", "Initializing Zixflow SDK")
75
+ Log.d("ZixflowRN", "apiKey: $apiKey")
76
+ Log.d("ZixflowRN", "apiHost: $apiHostValue")
77
+ Log.d("ZixflowRN", "cdnHost: $cdnHostValue")
78
+ Log.d("ZixflowRN", "==========================================")
79
+
69
80
  ZixflowBuilder(
70
81
  applicationContext = reactContext.applicationContext as Application,
71
- cdpApiKey = cdpApiKey
82
+ apiKey = apiKey
72
83
  ).apply {
73
- logLevelRawValue?.let { logLevel(CioLogLevel.getLogLevel(it)) }
74
- regionRawValue?.let { region(region) }
84
+ logLevelRawValue?.let { logLevel(ZixflowLogLevel.getLogLevel(it)) }
75
85
  screenViewRawValue?.let { screenViewUse(ScreenView.getScreenView(it)) }
76
86
 
77
87
  packageConfig.getTypedValue<Boolean>(Keys.Config.AUTO_TRACK_DEVICE_ATTRIBUTES)
78
88
  ?.let { autoTrackDeviceAttributes(it) }
79
- packageConfig.getTypedValue<String>(Keys.Config.MIGRATION_SITE_ID)
80
- ?.let { migrationSiteId(it) }
81
89
  packageConfig.getTypedValue<Int>(Keys.Config.FLUSH_AT)
82
90
  ?.let { flushAt(it) }
83
91
  packageConfig.getTypedValue<Int>(Keys.Config.FLUSH_INTERVAL)
84
92
  ?.let { flushInterval(it) }
85
93
  packageConfig.getTypedValue<Boolean>(Keys.Config.TRACK_APP_LIFECYCLE_EVENTS)
86
94
  ?.let { trackApplicationLifecycleEvents(it) }
87
- packageConfig.getTypedValue<String>(Keys.Config.API_HOST)
88
- ?.let { apiHost(it) }
89
- packageConfig.getTypedValue<String>(Keys.Config.CDN_HOST)
90
- ?.let { cdnHost(it) }
95
+ apiHostValue?.let {
96
+ Log.d("ZixflowRN", "Calling apiHost($it)")
97
+ apiHost(it)
98
+ }
99
+ cdnHostValue?.let {
100
+ Log.d("ZixflowRN", "Calling cdnHost($it)")
101
+ cdnHost(it)
102
+ }
91
103
 
92
- // Configure push messaging module based on config provided by customer app
104
+ // Configure push messaging module based on config provided by customer app.
105
+ // Live Activities are hosted by the FCM push module, so the `liveNotifications`
106
+ // config is applied to the same module.
93
107
  packageConfig.getTypedValue<Map<String, Any>>(key = "push").let { pushConfig ->
94
108
  NativeMessagingPushModule.addNativeModuleFromConfig(
95
109
  builder = this,
96
- config = pushConfig ?: emptyMap()
110
+ config = pushConfig ?: emptyMap(),
111
+ liveNotificationsConfig = packageConfig.getTypedValue<Map<String, Any>>(key = "liveNotifications")
97
112
  )
98
113
  }
99
- // Configure in-app messaging module based on config provided by customer app
100
114
  packageConfig.getTypedValue<Map<String, Any>>(key = "inApp")?.let { inAppConfig ->
101
115
  NativeMessagingInAppModule.addNativeModuleFromConfig(
102
116
  builder = this,
103
- config = inAppConfig,
104
- region = region
117
+ config = inAppConfig
105
118
  )
106
119
  }
107
- // Configure location module if enabled via gradle property
120
+ // Configure location module. Geofence implies location, so register location
121
+ // (with the app's config if given, otherwise defaults) whenever location or
122
+ // geofence is enabled, since geofence relies on the location module's fixes.
123
+ // ZIXFLOW_LOCATION_ENABLED is already true for geofence-enabled builds.
108
124
  if (BuildConfig.ZIXFLOW_LOCATION_ENABLED) {
109
- packageConfig.getTypedValue<Map<String, Any>>(key = "location")?.let { locationConfig ->
125
+ val locationConfig = packageConfig.getTypedValue<Map<String, Any>>(key = "location")
126
+ val geofenceConfigured = BuildConfig.ZIXFLOW_GEOFENCE_ENABLED &&
127
+ packageConfig.getTypedValue<Map<String, Any>>(key = "geofence") != null
128
+ if (locationConfig != null || geofenceConfigured) {
110
129
  NativeLocationModule.addNativeModuleFromConfig(
111
130
  builder = this,
112
- config = locationConfig
131
+ config = locationConfig ?: emptyMap()
132
+ )
133
+ }
134
+ }
135
+ // Configure geofence module if enabled via gradle property; it runs
136
+ // automatically once registered and relies on the location module above.
137
+ if (BuildConfig.ZIXFLOW_GEOFENCE_ENABLED) {
138
+ packageConfig.getTypedValue<Map<String, Any>>(key = "geofence")?.let { geofenceConfig ->
139
+ NativeGeofenceModule.addNativeModuleFromConfig(
140
+ builder = this,
141
+ config = geofenceConfig
113
142
  )
114
143
  }
115
144
  }
@@ -123,6 +152,22 @@ class NativeZixflowModule(
123
152
  }
124
153
  }
125
154
 
155
+ override fun setDeepLinkRoutingReady() {
156
+ // UIScene and React Native Linking readiness are iOS-only concerns.
157
+ }
158
+
159
+ override fun registerDeepLinkHandler() {
160
+ // UIScene deep-link acknowledgement is an iOS-only concern.
161
+ }
162
+
163
+ override fun unregisterDeepLinkHandler() {
164
+ // UIScene deep-link acknowledgement is an iOS-only concern.
165
+ }
166
+
167
+ override fun acknowledgeDeepLink(id: String?, handled: Boolean) {
168
+ // UIScene deep-link acknowledgement is an iOS-only concern.
169
+ }
170
+
126
171
  override fun identify(params: ReadableMap?) {
127
172
  val userId = params?.getString("userId")
128
173
  val traits = params?.getMap("traits")
@@ -6,10 +6,14 @@ import com.facebook.react.bridge.ReactApplicationContext
6
6
  import com.facebook.react.module.model.ReactModuleInfo
7
7
  import com.facebook.react.module.model.ReactModuleInfoProvider
8
8
  import com.facebook.react.uimanager.ViewManager
9
+ import com.zixflow.reactnative.sdk.geofence.NativeGeofenceModule
10
+ import com.zixflow.reactnative.sdk.liveactivities.NativeLiveActivitiesModule
9
11
  import com.zixflow.reactnative.sdk.location.NativeLocationModule
10
12
  import com.zixflow.reactnative.sdk.logging.NativeZixflowLoggingModule
11
13
  import com.zixflow.reactnative.sdk.messaginginapp.InlineInAppMessageViewManager
12
14
  import com.zixflow.reactnative.sdk.messaginginapp.NativeMessagingInAppModule
15
+ import com.zixflow.reactnative.sdk.messaginginbox.NotificationInboxBellViewManager
16
+ import com.zixflow.reactnative.sdk.messaginginbox.NotificationInboxViewManager
13
17
  import com.zixflow.reactnative.sdk.messagingpush.NativeMessagingPushModule
14
18
  import com.zixflow.reactnative.sdk.util.assertNotNull
15
19
 
@@ -22,7 +26,11 @@ class ZixflowReactNativePackage : BaseReactPackage() {
22
26
  * Creates the list of view managers for the Zixflow React Native SDK.
23
27
  */
24
28
  override fun createViewManagers(reactContext: ReactApplicationContext): List<ViewManager<*, *>> {
25
- return listOf(InlineInAppMessageViewManager())
29
+ return listOf(
30
+ InlineInAppMessageViewManager(),
31
+ NotificationInboxBellViewManager(),
32
+ NotificationInboxViewManager()
33
+ )
26
34
  }
27
35
 
28
36
  override fun getModule(name: String, reactContext: ReactApplicationContext): NativeModule? {
@@ -31,11 +39,23 @@ class ZixflowReactNativePackage : BaseReactPackage() {
31
39
  // See: https://reactnative.dev/docs/fabric-native-components-introduction?platforms=android#4-write-the-reactwebviewpackage
32
40
  return when (name) {
33
41
  InlineInAppMessageViewManager.NAME -> InlineInAppMessageViewManager()
42
+ NotificationInboxBellViewManager.NAME -> NotificationInboxBellViewManager()
43
+ NotificationInboxViewManager.NAME -> NotificationInboxViewManager()
34
44
  NativeZixflowLoggingModule.NAME -> NativeZixflowLoggingModule(reactContext)
35
45
  NativeZixflowModule.NAME -> NativeZixflowModule(reactContext = reactContext)
46
+ // Unconditional on purpose, unlike Location below. Location has its own artifact
47
+ // (com.zixflow.android:location) that the flag switches between `api` and `compileOnly`,
48
+ // so gating it genuinely keeps a dependency off the consumer's classpath. Live
49
+ // Notifications ship inside messaging-push-fcm, already a hard dependency here, so a flag
50
+ // would remove nothing — and the module is inert until `liveNotifications` config enables
51
+ // a type. iOS gates its equivalent only because the subspec pulls in extra pods.
52
+ NativeLiveActivitiesModule.NAME -> NativeLiveActivitiesModule(reactContext)
36
53
  NativeLocationModule.NAME -> if (BuildConfig.ZIXFLOW_LOCATION_ENABLED) {
37
54
  NativeLocationModule(reactContext)
38
55
  } else null
56
+ NativeGeofenceModule.NAME -> if (BuildConfig.ZIXFLOW_GEOFENCE_ENABLED) {
57
+ NativeGeofenceModule(reactContext)
58
+ } else null
39
59
  NativeMessagingInAppModule.NAME -> NativeMessagingInAppModule(reactContext)
40
60
  NativeMessagingPushModule.NAME -> NativeMessagingPushModule(reactContext)
41
61
  else -> assertNotNull<NativeModule>(value = null) { "Unknown module name: $name" }
@@ -69,9 +89,13 @@ class ZixflowReactNativePackage : BaseReactPackage() {
69
89
  // doesn't crash at import time. getModule() returns null when disabled.
70
90
  val moduleNames: List<String> = listOf(
71
91
  InlineInAppMessageViewManager.NAME,
92
+ NotificationInboxBellViewManager.NAME,
93
+ NotificationInboxViewManager.NAME,
72
94
  NativeZixflowLoggingModule.NAME,
73
95
  NativeZixflowModule.NAME,
96
+ NativeLiveActivitiesModule.NAME,
74
97
  NativeLocationModule.NAME,
98
+ NativeGeofenceModule.NAME,
75
99
  NativeMessagingInAppModule.NAME,
76
100
  NativeMessagingPushModule.NAME,
77
101
  )
@@ -3,18 +3,34 @@ package com.zixflow.reactnative.sdk.constant
3
3
  internal object Keys {
4
4
  object Config {
5
5
  const val LOG_LEVEL = "logLevel"
6
- const val REGION = "region"
7
6
  const val AUTO_TRACK_DEVICE_ATTRIBUTES = "autoTrackDeviceAttributes"
8
- const val CDP_API_KEY = "cdpApiKey"
7
+ const val API_KEY = "apiKey"
9
8
  const val SITE_ID = "siteId"
10
- const val MIGRATION_SITE_ID = "migrationSiteId"
11
9
  const val TRACK_APP_LIFECYCLE_EVENTS = "trackApplicationLifecycleEvents"
12
10
  const val FLUSH_AT = "flushAt"
13
11
  const val FLUSH_INTERVAL = "flushInterval"
14
12
  const val SCREEN_VIEW_USE = "screenViewUse"
15
13
  const val API_HOST = "apiHost"
16
14
  const val CDN_HOST = "cdnHost"
15
+ const val NOTIFICATION_INBOX_ACCESSIBILITY_LABELS = "notificationInboxAccessibilityLabels"
16
+ const val COLOR_SCHEME = "colorScheme"
17
17
  // Push messaging
18
18
  const val PUSH_CLICK_BEHAVIOR = "pushClickBehavior"
19
19
  }
20
+
21
+ /**
22
+ * Keys of the `notificationInboxAccessibilityLabels` sub-map.
23
+ *
24
+ * [BELL_WITH_UNREAD_COUNT] carries a template string containing [COUNT_PLACEHOLDER] rather than
25
+ * a callback, because wrapper configuration crosses a bridge that carries data but not
26
+ * functions. The native SDK takes a `(Int) -> String`, so the template is converted to one when
27
+ * the module is configured.
28
+ */
29
+ object InboxAccessibilityLabels {
30
+ const val BELL = "bell"
31
+ const val BELL_WITH_UNREAD_COUNT = "bellWithUnreadCount"
32
+ const val LOADING_INDICATOR = "loadingIndicator"
33
+ const val EMPTY_STATE = "emptyState"
34
+ const val COUNT_PLACEHOLDER = "{count}"
35
+ }
20
36
  }
@@ -0,0 +1,65 @@
1
+ package com.zixflow.reactnative.sdk.geofence
2
+
3
+ import com.facebook.react.bridge.ReactApplicationContext
4
+ import com.facebook.react.module.annotations.ReactModule
5
+ import com.zixflow.geofence.GeofenceLocationMode
6
+ import com.zixflow.geofence.GeofenceModuleConfig
7
+ import com.zixflow.geofence.ModuleGeofence
8
+ import com.zixflow.reactnative.sdk.NativeZixflowGeofenceSpec
9
+ import com.zixflow.reactnative.sdk.extension.getTypedValue
10
+ import com.zixflow.sdk.ZixflowBuilder
11
+ import com.zixflow.sdk.core.di.SDKComponent
12
+ import com.zixflow.sdk.core.util.Logger
13
+
14
+ /**
15
+ * React Native module implementation for Zixflow Geofence Native SDK
16
+ * using TurboModules with new architecture.
17
+ *
18
+ * The reference to [ModuleGeofence] is isolated in this file so the geofence dependency is
19
+ * only loaded when the module is enabled and bundled. Geofence depends on the location
20
+ * module, which the caller registers alongside it.
21
+ */
22
+ @ReactModule(name = NativeGeofenceModule.NAME)
23
+ class NativeGeofenceModule(
24
+ private val reactContext: ReactApplicationContext,
25
+ ) : NativeZixflowGeofenceSpec(reactContext) {
26
+ private val logger: Logger
27
+ get() = SDKComponent.logger
28
+
29
+ private fun getModuleGeofence() = runCatching {
30
+ ModuleGeofence.instance()
31
+ }.onFailure {
32
+ logger.error("Geofence module is not initialized. Ensure geofence config is provided during SDK initialization.")
33
+ }.getOrNull()
34
+
35
+ override fun refreshFromCurrentLocation() {
36
+ getModuleGeofence()?.refreshFromCurrentLocation()
37
+ }
38
+
39
+ companion object {
40
+ const val NAME = "NativeZixflowGeofence"
41
+
42
+ /**
43
+ * Adds the geofence module to the native Android SDK based on the configuration
44
+ * provided by the customer app.
45
+ *
46
+ * @param builder instance of ZixflowBuilder to add the geofence module.
47
+ * @param config configuration provided by the customer app for the geofence module.
48
+ */
49
+ internal fun addNativeModuleFromConfig(
50
+ builder: ZixflowBuilder,
51
+ config: Map<String, Any>
52
+ ) {
53
+ val locationModeValue = config.getTypedValue<String>("locationMode")
54
+ // Uppercase before matching so casing can't diverge from iOS (which uppercases too);
55
+ // enumValueOf is case-sensitive. Unknown values fall back to the SDK default.
56
+ val locationMode = locationModeValue?.let { value ->
57
+ runCatching { enumValueOf<GeofenceLocationMode>(value.uppercase()) }.getOrNull()
58
+ }
59
+
60
+ val configBuilder = GeofenceModuleConfig.Builder()
61
+ locationMode?.let { configBuilder.setLocationMode(it) }
62
+ builder.addZixflowModule(ModuleGeofence(configBuilder.build()))
63
+ }
64
+ }
65
+ }