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.
- package/README.md +2224 -322
- package/android/build.gradle +18 -1
- package/android/consumer-rules.pro +3 -2
- package/android/gradle.properties +1 -1
- package/android/src/main/java/com/zixflow/reactnative/sdk/NativeZixflowModule.kt +69 -24
- package/android/src/main/java/com/zixflow/reactnative/sdk/ZixflowReactNativePackage.kt +25 -1
- package/android/src/main/java/com/zixflow/reactnative/sdk/constant/Keys.kt +19 -3
- package/android/src/main/java/com/zixflow/reactnative/sdk/geofence/NativeGeofenceModule.kt +65 -0
- package/android/src/main/java/com/zixflow/reactnative/sdk/liveactivities/NativeLiveActivitiesModule.kt +310 -0
- package/android/src/main/java/com/zixflow/reactnative/sdk/logging/NativeZixflowLoggingModule.kt +2 -2
- package/android/src/main/java/com/zixflow/reactnative/sdk/messaginginapp/NativeMessagingInAppModule.kt +149 -10
- package/android/src/main/java/com/zixflow/reactnative/sdk/messaginginapp/ReactInboxEventListener.kt +99 -0
- package/android/src/main/java/com/zixflow/reactnative/sdk/messaginginbox/NotificationInboxBellViewManager.kt +38 -0
- package/android/src/main/java/com/zixflow/reactnative/sdk/messaginginbox/NotificationInboxViewManager.kt +30 -0
- package/android/src/main/java/com/zixflow/reactnative/sdk/messaginginbox/ReactComposeHostView.kt +96 -0
- package/android/src/main/java/com/zixflow/reactnative/sdk/messaginginbox/ReactNotificationInboxBellView.kt +48 -0
- package/android/src/main/java/com/zixflow/reactnative/sdk/messaginginbox/ReactNotificationInboxView.kt +17 -0
- package/android/src/main/java/com/zixflow/reactnative/sdk/messagingpush/NativeMessagingPushModule.kt +11 -1
- package/android/src/main/res/values/zixflow_config.xml +1 -1
- package/android/zixflow-core.gradle +17 -7
- package/docs/cocoapods-deployment-target-normalization.md +139 -0
- package/ios/cocoapods_deployment_target.rb +432 -0
- package/ios/wrappers/NativeZixflow.mm +37 -0
- package/ios/wrappers/NativeZixflow.swift +135 -1
- package/ios/wrappers/ZixflowReactNativeDeepLinkRequestStore.swift +123 -0
- package/ios/wrappers/ZixflowReactNativeDeepLinkRouter.swift +312 -0
- package/ios/wrappers/geofence/NativeGeofence.mm +46 -0
- package/ios/wrappers/geofence/NativeGeofence.swift +27 -0
- package/ios/wrappers/inapp/NativeMessagingInApp.mm +22 -0
- package/ios/wrappers/inapp/NativeMessagingInApp.swift +90 -0
- package/ios/wrappers/inbox/InboxHostContainment.swift +40 -0
- package/ios/wrappers/inbox/RCTNotificationInboxBellNative.h +12 -0
- package/ios/wrappers/inbox/RCTNotificationInboxBellNative.mm +98 -0
- package/ios/wrappers/inbox/RCTNotificationInboxViewNative.h +12 -0
- package/ios/wrappers/inbox/RCTNotificationInboxViewNative.mm +78 -0
- package/ios/wrappers/inbox/ReactInboxEventListener.swift +76 -0
- package/ios/wrappers/inbox/ReactNotificationInboxBellView.h +22 -0
- package/ios/wrappers/inbox/ReactNotificationInboxBellView.swift +109 -0
- package/ios/wrappers/inbox/ReactNotificationInboxView.h +22 -0
- package/ios/wrappers/inbox/ReactNotificationInboxView.swift +69 -0
- package/ios/wrappers/liveactivities/NativeLiveActivities.mm +83 -0
- package/ios/wrappers/liveactivities/NativeLiveActivities.swift +390 -0
- package/ios/wrappers/location/NativeLocation.swift +7 -5
- package/ios/wrappers/utils/ZixflowConfigUtils.swift +5 -9
- package/ios/wrappers/utils/ZixflowConstants.swift +4 -0
- package/ios/wrappers/zixflow_reactnative.h +6 -0
- package/lib/commonjs/components/NotificationInboxBellView.js +49 -0
- package/lib/commonjs/components/NotificationInboxBellView.js.map +1 -0
- package/lib/commonjs/components/NotificationInboxView.js +36 -0
- package/lib/commonjs/components/NotificationInboxView.js.map +1 -0
- package/lib/commonjs/components/index.js +14 -0
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/index.js +81 -4
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/notification-inbox.js +1 -0
- package/lib/commonjs/notification-inbox.js.map +1 -1
- package/lib/commonjs/specs/components/NotificationInboxBellNativeComponent.ts +24 -0
- package/lib/commonjs/specs/components/NotificationInboxViewNativeComponent.ts +22 -0
- package/lib/commonjs/specs/modules/NativeZixflow.js.map +1 -1
- package/lib/commonjs/specs/modules/NativeZixflowGeofence.js +15 -0
- package/lib/commonjs/specs/modules/NativeZixflowGeofence.js.map +1 -0
- package/lib/commonjs/specs/modules/NativeZixflowLiveActivities.js +23 -0
- package/lib/commonjs/specs/modules/NativeZixflowLiveActivities.js.map +1 -0
- package/lib/commonjs/specs/modules/NativeZixflowMessagingInApp.js +3 -1
- package/lib/commonjs/specs/modules/NativeZixflowMessagingInApp.js.map +1 -1
- package/lib/commonjs/specs/modules/NativeZixflowMessagingPush.js +3 -1
- package/lib/commonjs/specs/modules/NativeZixflowMessagingPush.js.map +1 -1
- package/lib/commonjs/types/data-pipelines.js +15 -15
- package/lib/commonjs/types/data-pipelines.js.map +1 -1
- package/lib/commonjs/types/in-app.js +24 -1
- package/lib/commonjs/types/in-app.js.map +1 -1
- package/lib/commonjs/types/inbox.js +79 -0
- package/lib/commonjs/types/inbox.js.map +1 -0
- package/lib/commonjs/types/index.js +22 -0
- package/lib/commonjs/types/index.js.map +1 -1
- package/lib/commonjs/types/live-activities.js +85 -0
- package/lib/commonjs/types/live-activities.js.map +1 -0
- package/lib/commonjs/utils/param-validation.js +77 -2
- package/lib/commonjs/utils/param-validation.js.map +1 -1
- package/lib/commonjs/zixflow-cdp.js +101 -11
- package/lib/commonjs/zixflow-cdp.js.map +1 -1
- package/lib/commonjs/zixflow-geofence.js +55 -0
- package/lib/commonjs/zixflow-geofence.js.map +1 -0
- package/lib/commonjs/zixflow-inapp.js +120 -0
- package/lib/commonjs/zixflow-inapp.js.map +1 -1
- package/lib/commonjs/zixflow-liveactivities.js +85 -0
- package/lib/commonjs/zixflow-liveactivities.js.map +1 -0
- package/lib/commonjs/zixflow.js.map +1 -1
- package/lib/module/components/NotificationInboxBellView.js +44 -0
- package/lib/module/components/NotificationInboxBellView.js.map +1 -0
- package/lib/module/components/NotificationInboxView.js +31 -0
- package/lib/module/components/NotificationInboxView.js.map +1 -0
- package/lib/module/components/index.js +5 -0
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/index.js +8 -3
- package/lib/module/index.js.map +1 -1
- package/lib/module/notification-inbox.js +1 -1
- package/lib/module/notification-inbox.js.map +1 -1
- package/lib/module/specs/components/NotificationInboxBellNativeComponent.ts +24 -0
- package/lib/module/specs/components/NotificationInboxViewNativeComponent.ts +22 -0
- package/lib/module/specs/modules/NativeZixflow.js.map +1 -1
- package/lib/module/specs/modules/NativeZixflowGeofence.js +13 -0
- package/lib/module/specs/modules/NativeZixflowGeofence.js.map +1 -0
- package/lib/module/specs/modules/NativeZixflowLiveActivities.js +21 -0
- package/lib/module/specs/modules/NativeZixflowLiveActivities.js.map +1 -0
- package/lib/module/specs/modules/NativeZixflowMessagingInApp.js +3 -1
- package/lib/module/specs/modules/NativeZixflowMessagingInApp.js.map +1 -1
- package/lib/module/specs/modules/NativeZixflowMessagingPush.js +3 -1
- package/lib/module/specs/modules/NativeZixflowMessagingPush.js.map +1 -1
- package/lib/module/types/data-pipelines.js +15 -15
- package/lib/module/types/data-pipelines.js.map +1 -1
- package/lib/module/types/in-app.js +24 -0
- package/lib/module/types/in-app.js.map +1 -1
- package/lib/module/types/inbox.js +75 -0
- package/lib/module/types/inbox.js.map +1 -0
- package/lib/module/types/index.js +2 -0
- package/lib/module/types/index.js.map +1 -1
- package/lib/module/types/live-activities.js +88 -0
- package/lib/module/types/live-activities.js.map +1 -0
- package/lib/module/utils/param-validation.js +77 -2
- package/lib/module/utils/param-validation.js.map +1 -1
- package/lib/module/zixflow-cdp.js +101 -11
- package/lib/module/zixflow-cdp.js.map +1 -1
- package/lib/module/zixflow-geofence.js +50 -0
- package/lib/module/zixflow-geofence.js.map +1 -0
- package/lib/module/zixflow-inapp.js +99 -1
- package/lib/module/zixflow-inapp.js.map +1 -1
- package/lib/module/zixflow-liveactivities.js +80 -0
- package/lib/module/zixflow-liveactivities.js.map +1 -0
- package/lib/module/zixflow.js +0 -6
- package/lib/module/zixflow.js.map +1 -1
- package/lib/typescript/commonjs/components/NotificationInboxBellView.d.ts +39 -0
- package/lib/typescript/commonjs/components/NotificationInboxBellView.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/NotificationInboxView.d.ts +25 -0
- package/lib/typescript/commonjs/components/NotificationInboxView.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/index.d.ts +4 -0
- package/lib/typescript/commonjs/components/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +8 -1
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/notification-inbox.d.ts +5 -0
- package/lib/typescript/commonjs/notification-inbox.d.ts.map +1 -1
- package/lib/typescript/commonjs/specs/components/NotificationInboxBellNativeComponent.d.ts +13 -0
- package/lib/typescript/commonjs/specs/components/NotificationInboxBellNativeComponent.d.ts.map +1 -0
- package/lib/typescript/commonjs/specs/components/NotificationInboxViewNativeComponent.d.ts +12 -0
- package/lib/typescript/commonjs/specs/components/NotificationInboxViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/commonjs/specs/modules/NativeZixflow.d.ts +6 -1
- package/lib/typescript/commonjs/specs/modules/NativeZixflow.d.ts.map +1 -1
- package/lib/typescript/commonjs/specs/modules/NativeZixflowGeofence.d.ts +13 -0
- package/lib/typescript/commonjs/specs/modules/NativeZixflowGeofence.d.ts.map +1 -0
- package/lib/typescript/commonjs/specs/modules/NativeZixflowLiveActivities.d.ts +31 -0
- package/lib/typescript/commonjs/specs/modules/NativeZixflowLiveActivities.d.ts.map +1 -0
- package/lib/typescript/commonjs/specs/modules/NativeZixflowMessagingInApp.d.ts +5 -1
- package/lib/typescript/commonjs/specs/modules/NativeZixflowMessagingInApp.d.ts.map +1 -1
- package/lib/typescript/commonjs/specs/modules/NativeZixflowMessagingPush.d.ts +1 -1
- package/lib/typescript/commonjs/specs/modules/NativeZixflowMessagingPush.d.ts.map +1 -1
- package/lib/typescript/commonjs/types/data-pipelines.d.ts +54 -18
- package/lib/typescript/commonjs/types/data-pipelines.d.ts.map +1 -1
- package/lib/typescript/commonjs/types/in-app.d.ts +22 -0
- package/lib/typescript/commonjs/types/in-app.d.ts.map +1 -1
- package/lib/typescript/commonjs/types/inbox.d.ts +97 -0
- package/lib/typescript/commonjs/types/inbox.d.ts.map +1 -0
- package/lib/typescript/commonjs/types/index.d.ts +2 -0
- package/lib/typescript/commonjs/types/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/types/live-activities.d.ts +161 -0
- package/lib/typescript/commonjs/types/live-activities.d.ts.map +1 -0
- package/lib/typescript/commonjs/utils/param-validation.d.ts +7 -0
- package/lib/typescript/commonjs/utils/param-validation.d.ts.map +1 -1
- package/lib/typescript/commonjs/zixflow-cdp.d.ts +38 -0
- package/lib/typescript/commonjs/zixflow-cdp.d.ts.map +1 -1
- package/lib/typescript/commonjs/zixflow-geofence.d.ts +36 -0
- package/lib/typescript/commonjs/zixflow-geofence.d.ts.map +1 -0
- package/lib/typescript/commonjs/zixflow-inapp.d.ts +36 -2
- package/lib/typescript/commonjs/zixflow-inapp.d.ts.map +1 -1
- package/lib/typescript/commonjs/zixflow-liveactivities.d.ts +66 -0
- package/lib/typescript/commonjs/zixflow-liveactivities.d.ts.map +1 -0
- package/lib/typescript/commonjs/zixflow.d.ts +0 -5
- package/lib/typescript/commonjs/zixflow.d.ts.map +1 -1
- package/lib/typescript/module/components/NotificationInboxBellView.d.ts +39 -0
- package/lib/typescript/module/components/NotificationInboxBellView.d.ts.map +1 -0
- package/lib/typescript/module/components/NotificationInboxView.d.ts +25 -0
- package/lib/typescript/module/components/NotificationInboxView.d.ts.map +1 -0
- package/lib/typescript/module/components/index.d.ts +4 -0
- package/lib/typescript/module/components/index.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +8 -1
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/notification-inbox.d.ts +5 -0
- package/lib/typescript/module/notification-inbox.d.ts.map +1 -1
- package/lib/typescript/module/specs/components/NotificationInboxBellNativeComponent.d.ts +13 -0
- package/lib/typescript/module/specs/components/NotificationInboxBellNativeComponent.d.ts.map +1 -0
- package/lib/typescript/module/specs/components/NotificationInboxViewNativeComponent.d.ts +12 -0
- package/lib/typescript/module/specs/components/NotificationInboxViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/module/specs/modules/NativeZixflow.d.ts +6 -1
- package/lib/typescript/module/specs/modules/NativeZixflow.d.ts.map +1 -1
- package/lib/typescript/module/specs/modules/NativeZixflowGeofence.d.ts +13 -0
- package/lib/typescript/module/specs/modules/NativeZixflowGeofence.d.ts.map +1 -0
- package/lib/typescript/module/specs/modules/NativeZixflowLiveActivities.d.ts +31 -0
- package/lib/typescript/module/specs/modules/NativeZixflowLiveActivities.d.ts.map +1 -0
- package/lib/typescript/module/specs/modules/NativeZixflowMessagingInApp.d.ts +5 -1
- package/lib/typescript/module/specs/modules/NativeZixflowMessagingInApp.d.ts.map +1 -1
- package/lib/typescript/module/specs/modules/NativeZixflowMessagingPush.d.ts +1 -1
- package/lib/typescript/module/specs/modules/NativeZixflowMessagingPush.d.ts.map +1 -1
- package/lib/typescript/module/types/data-pipelines.d.ts +54 -18
- package/lib/typescript/module/types/data-pipelines.d.ts.map +1 -1
- package/lib/typescript/module/types/in-app.d.ts +22 -0
- package/lib/typescript/module/types/in-app.d.ts.map +1 -1
- package/lib/typescript/module/types/inbox.d.ts +97 -0
- package/lib/typescript/module/types/inbox.d.ts.map +1 -0
- package/lib/typescript/module/types/index.d.ts +2 -0
- package/lib/typescript/module/types/index.d.ts.map +1 -1
- package/lib/typescript/module/types/live-activities.d.ts +161 -0
- package/lib/typescript/module/types/live-activities.d.ts.map +1 -0
- package/lib/typescript/module/utils/param-validation.d.ts +7 -0
- package/lib/typescript/module/utils/param-validation.d.ts.map +1 -1
- package/lib/typescript/module/zixflow-cdp.d.ts +38 -0
- package/lib/typescript/module/zixflow-cdp.d.ts.map +1 -1
- package/lib/typescript/module/zixflow-geofence.d.ts +36 -0
- package/lib/typescript/module/zixflow-geofence.d.ts.map +1 -0
- package/lib/typescript/module/zixflow-inapp.d.ts +36 -2
- package/lib/typescript/module/zixflow-inapp.d.ts.map +1 -1
- package/lib/typescript/module/zixflow-liveactivities.d.ts +66 -0
- package/lib/typescript/module/zixflow-liveactivities.d.ts.map +1 -0
- package/lib/typescript/module/zixflow.d.ts +0 -5
- package/lib/typescript/module/zixflow.d.ts.map +1 -1
- package/package.json +14 -5
- package/src/components/NotificationInboxBellView.tsx +55 -0
- package/src/components/NotificationInboxView.tsx +30 -0
- package/src/components/index.ts +6 -0
- package/src/index.ts +8 -3
- package/src/notification-inbox.ts +1 -1
- package/src/specs/components/NotificationInboxBellNativeComponent.ts +24 -0
- package/src/specs/components/NotificationInboxViewNativeComponent.ts +22 -0
- package/src/specs/modules/NativeZixflow.ts +9 -1
- package/src/specs/modules/NativeZixflowGeofence.ts +14 -0
- package/src/specs/modules/NativeZixflowLiveActivities.ts +39 -0
- package/src/specs/modules/NativeZixflowMessagingInApp.ts +12 -1
- package/src/specs/modules/NativeZixflowMessagingPush.ts +3 -1
- package/src/types/data-pipelines.ts +55 -19
- package/src/types/in-app.ts +23 -0
- package/src/types/inbox.ts +110 -0
- package/src/types/index.ts +2 -0
- package/src/types/live-activities.ts +170 -0
- package/src/utils/param-validation.ts +104 -1
- package/src/zixflow-cdp.ts +119 -13
- package/src/zixflow-geofence.ts +56 -0
- package/src/zixflow-inapp.ts +125 -2
- package/src/zixflow-liveactivities.ts +86 -0
- package/src/zixflow.ts +0 -6
- package/zixflow-reactnative-richpush.podspec +6 -3
- package/zixflow-reactnative.podspec +28 -2
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
package com.zixflow.reactnative.sdk.messaginginbox
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.module.annotations.ReactModule
|
|
4
|
+
import com.facebook.react.uimanager.SimpleViewManager
|
|
5
|
+
import com.facebook.react.uimanager.ThemedReactContext
|
|
6
|
+
import com.facebook.react.uimanager.ViewManagerDelegate
|
|
7
|
+
import com.facebook.react.viewmanagers.NotificationInboxViewNativeManagerDelegate
|
|
8
|
+
import com.facebook.react.viewmanagers.NotificationInboxViewNativeManagerInterface
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* View manager for the Visual Notification Inbox message list (the Jist-rendered list,
|
|
12
|
+
* embeddable in the host's own screen). No props or events; sizing comes from the JS style.
|
|
13
|
+
*/
|
|
14
|
+
@ReactModule(name = NotificationInboxViewManager.NAME)
|
|
15
|
+
class NotificationInboxViewManager :
|
|
16
|
+
NotificationInboxViewNativeManagerInterface<ReactNotificationInboxView>,
|
|
17
|
+
SimpleViewManager<ReactNotificationInboxView>() {
|
|
18
|
+
private val delegate = NotificationInboxViewNativeManagerDelegate(this)
|
|
19
|
+
|
|
20
|
+
override fun getName() = NAME
|
|
21
|
+
override fun getDelegate(): ViewManagerDelegate<ReactNotificationInboxView> = delegate
|
|
22
|
+
|
|
23
|
+
override fun createViewInstance(
|
|
24
|
+
reactContext: ThemedReactContext
|
|
25
|
+
): ReactNotificationInboxView = ReactNotificationInboxView(reactContext)
|
|
26
|
+
|
|
27
|
+
companion object {
|
|
28
|
+
internal const val NAME = "NotificationInboxViewNative"
|
|
29
|
+
}
|
|
30
|
+
}
|
package/android/src/main/java/com/zixflow/reactnative/sdk/messaginginbox/ReactComposeHostView.kt
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
package com.zixflow.reactnative.sdk.messaginginbox
|
|
2
|
+
|
|
3
|
+
import android.content.Context
|
|
4
|
+
import android.view.Choreographer
|
|
5
|
+
import android.view.View
|
|
6
|
+
import android.widget.FrameLayout
|
|
7
|
+
import androidx.compose.runtime.Composable
|
|
8
|
+
import androidx.compose.ui.platform.ComposeView
|
|
9
|
+
import com.facebook.react.bridge.WritableMap
|
|
10
|
+
import com.zixflow.reactnative.sdk.extension.sendUIEventToReactJS
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Base React Native view that hosts a Jetpack Compose [content] inside a [ComposeView].
|
|
14
|
+
*
|
|
15
|
+
* Mirrors the role that the native SDK's `WrapperInlineView` plays for inline in-app
|
|
16
|
+
* messages, but the Visual Notification Inbox components are plain `@Composable`s, so we
|
|
17
|
+
* host them directly in a [ComposeView] rather than going through an inline-message wrapper.
|
|
18
|
+
*
|
|
19
|
+
* Subclasses provide the composable via [content] and emit events with [emitEvent].
|
|
20
|
+
*
|
|
21
|
+
* Layout note: React Native (Yoga) lays this view out, so the [ComposeView] is sized to the
|
|
22
|
+
* bounds RN assigns. Because RN children measured by native code don't always re-trigger a
|
|
23
|
+
* layout pass, we schedule a manual measure/layout via the [Choreographer] whenever the view
|
|
24
|
+
* is attached, matching how other RN-hosted native views keep themselves laid out.
|
|
25
|
+
*/
|
|
26
|
+
abstract class ReactComposeHostView(context: Context) : FrameLayout(context) {
|
|
27
|
+
|
|
28
|
+
private val composeView: ComposeView = ComposeView(context).apply {
|
|
29
|
+
layoutParams = LayoutParams(
|
|
30
|
+
LayoutParams.MATCH_PARENT,
|
|
31
|
+
LayoutParams.MATCH_PARENT
|
|
32
|
+
)
|
|
33
|
+
setContent { content() }
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** The Compose UI hosted by this view. Implemented by each concrete inbox component. */
|
|
37
|
+
@Composable
|
|
38
|
+
protected abstract fun content()
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* The Compose child is attached here rather than in `init`, gating setup on attachment the same
|
|
42
|
+
* way [com.zixflow.messaginginapp.ui.core.BaseInlineInAppMessageView] gates its subscription.
|
|
43
|
+
*
|
|
44
|
+
* Fabric measures a newly created view before the mount batch's INSERT attaches it to the
|
|
45
|
+
* window ([com.facebook.react.fabric.mounting.SurfaceMountingManager.updateLayout]), and
|
|
46
|
+
* `AbstractComposeView.onMeasure` unconditionally creates its composition, which needs a window
|
|
47
|
+
* to resolve the recomposer. Adding the child in `init` therefore threw
|
|
48
|
+
* `IllegalStateException: Cannot locate windowRecomposer` during that measure; the mount batch
|
|
49
|
+
* aborted and the half-mounted hierarchy crashed the host app.
|
|
50
|
+
*/
|
|
51
|
+
override fun onAttachedToWindow() {
|
|
52
|
+
super.onAttachedToWindow()
|
|
53
|
+
if (composeView.parent == null) {
|
|
54
|
+
addView(composeView)
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Dispatches a UI event back to the JS side using the React Native event dispatcher.
|
|
60
|
+
*
|
|
61
|
+
* @param eventName name registered in the view manager's
|
|
62
|
+
* `getExportedCustomDirectEventTypeConstants`.
|
|
63
|
+
* @param payload optional event data.
|
|
64
|
+
*/
|
|
65
|
+
protected fun emitEvent(eventName: String, payload: WritableMap? = null) {
|
|
66
|
+
sendUIEventToReactJS(eventName = eventName, payload = payload)
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* React Native lays out views off the main Android layout pass, so manually re-run
|
|
71
|
+
* measure + layout against the bounds RN assigned. Without this, native children of
|
|
72
|
+
* RN-managed views can render with a zero size.
|
|
73
|
+
*/
|
|
74
|
+
override fun requestLayout() {
|
|
75
|
+
super.requestLayout()
|
|
76
|
+
post(measureAndLayout)
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
private val measureAndLayout = Runnable {
|
|
80
|
+
// The callback is posted for the next frame, by which point the view may have been detached
|
|
81
|
+
// (Fabric recycles these). Measuring the Compose child without a window throws, so skip it —
|
|
82
|
+
// a later attach re-runs layout anyway.
|
|
83
|
+
if (!isAttachedToWindow) {
|
|
84
|
+
return@Runnable
|
|
85
|
+
}
|
|
86
|
+
measure(
|
|
87
|
+
MeasureSpec.makeMeasureSpec(width, MeasureSpec.EXACTLY),
|
|
88
|
+
MeasureSpec.makeMeasureSpec(height, MeasureSpec.EXACTLY)
|
|
89
|
+
)
|
|
90
|
+
layout(left, top, right, bottom)
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
private fun View.post(action: Runnable) {
|
|
94
|
+
Choreographer.getInstance().postFrameCallback { action.run() }
|
|
95
|
+
}
|
|
96
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
package com.zixflow.reactnative.sdk.messaginginbox
|
|
2
|
+
|
|
3
|
+
import android.content.Context
|
|
4
|
+
import android.view.MotionEvent
|
|
5
|
+
import androidx.compose.runtime.Composable
|
|
6
|
+
import com.facebook.react.bridge.Arguments
|
|
7
|
+
import com.zixflow.messaginginbox.NotificationInboxOverlay
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* React Native host for the Visual Notification Inbox bell.
|
|
11
|
+
*
|
|
12
|
+
* Hosts the native [NotificationInboxOverlay] composable rather than `NotificationInboxBell`: only the
|
|
13
|
+
* overlay ties the bell to the SDK's own inbox panel, and the wrapper deliberately does not reimplement
|
|
14
|
+
* panel presentation. Sized to the frame React Native assigns, that composition *is* a bell that opens
|
|
15
|
+
* the inbox — the component wrappers expose.
|
|
16
|
+
*
|
|
17
|
+
* Remote branding still styles the bell (colors, icon). Branding's bell *position* has no effect here:
|
|
18
|
+
* alignment resolves inside this view's bounds, so the JS host owns placement via `style`.
|
|
19
|
+
*
|
|
20
|
+
* [ON_TAP] is observational — the SDK opens the panel itself, so the host has nothing to do in response.
|
|
21
|
+
*/
|
|
22
|
+
class ReactNotificationInboxBellView(context: Context) : ReactComposeHostView(context) {
|
|
23
|
+
@Composable
|
|
24
|
+
override fun content() {
|
|
25
|
+
NotificationInboxOverlay()
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Reports taps without consuming them.
|
|
30
|
+
*
|
|
31
|
+
* `dispatchTouchEvent` rather than `onTouchEvent`: the Compose child consumes the bell tap, so a
|
|
32
|
+
* parent `onTouchEvent` would never run. Dispatching to super first keeps the gesture flowing to
|
|
33
|
+
* Compose (which opens the panel); we only observe the outcome. Reporting on ACTION_UP and only
|
|
34
|
+
* when the touch was consumed approximates "the bell took this tap" rather than firing for taps
|
|
35
|
+
* that landed on the transparent area around it.
|
|
36
|
+
*/
|
|
37
|
+
override fun dispatchTouchEvent(event: MotionEvent): Boolean {
|
|
38
|
+
val handled = super.dispatchTouchEvent(event)
|
|
39
|
+
if (handled && event.actionMasked == MotionEvent.ACTION_UP) {
|
|
40
|
+
emitEvent(ON_TAP, Arguments.createMap())
|
|
41
|
+
}
|
|
42
|
+
return handled
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
companion object {
|
|
46
|
+
const val ON_TAP = "onTap"
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
package com.zixflow.reactnative.sdk.messaginginbox
|
|
2
|
+
|
|
3
|
+
import android.content.Context
|
|
4
|
+
import androidx.compose.runtime.Composable
|
|
5
|
+
import com.zixflow.messaginginbox.NotificationInboxView
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* React Native host for the native [NotificationInboxView] composable (the Jist-rendered
|
|
9
|
+
* message list). Sizing is driven by the JS `style` prop. Message actions are handled by the
|
|
10
|
+
* existing global InboxEventListener, so this component emits no per-message events.
|
|
11
|
+
*/
|
|
12
|
+
class ReactNotificationInboxView(context: Context) : ReactComposeHostView(context) {
|
|
13
|
+
@Composable
|
|
14
|
+
override fun content() {
|
|
15
|
+
NotificationInboxView()
|
|
16
|
+
}
|
|
17
|
+
}
|
package/android/src/main/java/com/zixflow/reactnative/sdk/messagingpush/NativeMessagingPushModule.kt
CHANGED
|
@@ -23,6 +23,7 @@ import com.zixflow.reactnative.sdk.NativeZixflowMessagingPushSpec
|
|
|
23
23
|
import com.zixflow.reactnative.sdk.constant.Keys
|
|
24
24
|
import com.zixflow.reactnative.sdk.extension.getTypedValue
|
|
25
25
|
import com.zixflow.reactnative.sdk.extension.takeIfNotBlank
|
|
26
|
+
import com.zixflow.reactnative.sdk.liveactivities.NativeLiveActivitiesModule
|
|
26
27
|
import com.zixflow.reactnative.sdk.util.unsupportedOnAndroid
|
|
27
28
|
import com.zixflow.sdk.Zixflow
|
|
28
29
|
import com.zixflow.sdk.ZixflowBuilder
|
|
@@ -257,7 +258,8 @@ class NativeMessagingPushModule(
|
|
|
257
258
|
*/
|
|
258
259
|
internal fun addNativeModuleFromConfig(
|
|
259
260
|
builder: ZixflowBuilder,
|
|
260
|
-
config: Map<String, Any
|
|
261
|
+
config: Map<String, Any>,
|
|
262
|
+
liveNotificationsConfig: Map<String, Any>? = null,
|
|
261
263
|
) {
|
|
262
264
|
val androidConfig =
|
|
263
265
|
config.getTypedValue<Map<String, Any>>(key = "android") ?: emptyMap()
|
|
@@ -275,6 +277,14 @@ class NativeMessagingPushModule(
|
|
|
275
277
|
val module = ModuleMessagingPushFCM(
|
|
276
278
|
moduleConfig = MessagingPushModuleConfig.Builder().apply {
|
|
277
279
|
setPushClickBehavior(pushClickBehavior = pushClickBehavior)
|
|
280
|
+
// Live Notifications are hosted by the FCM push module, so their config is
|
|
281
|
+
// applied to the same MessagingPushModuleConfig.
|
|
282
|
+
liveNotificationsConfig?.let { liveConfig ->
|
|
283
|
+
NativeLiveActivitiesModule.applyLiveActivitiesConfig(
|
|
284
|
+
builder = this,
|
|
285
|
+
config = liveConfig,
|
|
286
|
+
)
|
|
287
|
+
}
|
|
278
288
|
}.build(),
|
|
279
289
|
)
|
|
280
290
|
builder.addZixflowModule(module)
|
|
@@ -9,5 +9,5 @@
|
|
|
9
9
|
This will be updated by update-version script with React Native package version
|
|
10
10
|
whenever new version of React Native package is released
|
|
11
11
|
-->
|
|
12
|
-
<string name="zixflow_react_native_sdk_client_version">1.1.
|
|
12
|
+
<string name="zixflow_react_native_sdk_client_version">1.1.4</string>
|
|
13
13
|
</resources>
|
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
dependencies {
|
|
2
|
-
api "com.zixflow.
|
|
3
|
-
api "com.zixflow.
|
|
4
|
-
api "com.zixflow.
|
|
2
|
+
api "com.zixflow.android:datapipelines:$zixflowAndroidSDKVersion"
|
|
3
|
+
api "com.zixflow.android:messaging-push-fcm:$zixflowAndroidSDKVersion"
|
|
4
|
+
api "com.zixflow.android:messaging-in-app:$zixflowAndroidSDKVersion"
|
|
5
|
+
// Visual Notification Inbox UI (Compose-based).
|
|
6
|
+
api "com.zixflow.android:messaging-inbox:$zixflowAndroidSDKVersion"
|
|
5
7
|
// Location module is optional - customers enable it by adding
|
|
6
|
-
// zixflow_location_enabled=true in their gradle.properties
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
// zixflow_location_enabled=true in their gradle.properties.
|
|
9
|
+
// Geofence implies Location: enabling geofence pulls in location too.
|
|
10
|
+
if (project.zixflowLocationEnabled || project.zixflowGeofenceEnabled) {
|
|
11
|
+
api "com.zixflow.android:location:$zixflowAndroidSDKVersion"
|
|
9
12
|
} else {
|
|
10
|
-
compileOnly "com.zixflow.
|
|
13
|
+
compileOnly "com.zixflow.android:location:$zixflowAndroidSDKVersion"
|
|
14
|
+
}
|
|
15
|
+
// Geofence module is optional - customers enable it by adding
|
|
16
|
+
// zixflow_geofence_enabled=true in their gradle.properties
|
|
17
|
+
if (project.zixflowGeofenceEnabled) {
|
|
18
|
+
api "com.zixflow.android:geofence:$zixflowAndroidSDKVersion"
|
|
19
|
+
} else {
|
|
20
|
+
compileOnly "com.zixflow.android:geofence:$zixflowAndroidSDKVersion"
|
|
11
21
|
}
|
|
12
22
|
}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
# CocoaPods deployment-target normalization
|
|
2
|
+
|
|
3
|
+
Xcode validates the deployment target of every generated CocoaPods target, including dependency,
|
|
4
|
+
aggregate, privacy-manifest, and resource-bundle targets. Xcode 27 rejects targets below the build
|
|
5
|
+
range supported by its iOS SDK even when the dependency itself is source-compatible with your app.
|
|
6
|
+
|
|
7
|
+
The `zixflow-reactnative` package includes an opt-in Podfile helper. It raises low or missing
|
|
8
|
+
generated settings to the greater of React Native's current minimum and iOS 15.0. For React Native
|
|
9
|
+
0.83 that value is iOS 15.1. It also covers integrated application, Notification Service
|
|
10
|
+
Extension, and widget targets, while preserving higher numeric deployment targets. When a target
|
|
11
|
+
setting is absent, the helper resolves its target xcconfig and then the same-named project build
|
|
12
|
+
configuration, preserving a higher inherited app or extension floor. The helper changes local build
|
|
13
|
+
settings in the generated Pods project and CocoaPods-integrated app or extension projects. It does
|
|
14
|
+
not rewrite a podspec or change runtime API availability.
|
|
15
|
+
|
|
16
|
+
The package owns and tests this copy of the helper because customer Podfiles must be able to load it
|
|
17
|
+
from the installed npm package. When its behavior changes, update the helper, tests, and guidance
|
|
18
|
+
together. It does not depend on a cross-repository source lock or require wrapper copies to remain
|
|
19
|
+
byte-identical.
|
|
20
|
+
|
|
21
|
+
Zixflow deliberately continues to publish native SDKs that support iOS versions below 15. A
|
|
22
|
+
podspec can therefore correctly declare that lower library minimum even when React Native or the
|
|
23
|
+
application consuming it requires a newer iOS version. CocoaPods carries deployment metadata from
|
|
24
|
+
Zixflow and third-party podspecs into generated build targets, but Xcode 27 no longer accepts
|
|
25
|
+
targets below the iOS SDK's supported build range. Raising every published podspec to iOS 15 would
|
|
26
|
+
unnecessarily drop older applications and would not control metadata from transitive
|
|
27
|
+
dependencies. The helper instead aligns the generated targets with the host application's chosen
|
|
28
|
+
minimum while leaving the packages' published runtime compatibility unchanged.
|
|
29
|
+
This is the supported integration policy for a React Native application that has moved its own
|
|
30
|
+
minimum to the required iOS floor.
|
|
31
|
+
|
|
32
|
+
> [!WARNING]
|
|
33
|
+
> This is an opt-in build migration. Integrated app and extension targets below the computed floor
|
|
34
|
+
> are raised to that floor. With React Native 0.83, shipping the resulting iOS 15.1 application
|
|
35
|
+
> means users on iOS 15.0 and earlier cannot install subsequent app updates. Adopt the helper only
|
|
36
|
+
> when your product has intentionally moved its application and extension deployment targets.
|
|
37
|
+
|
|
38
|
+
Resolve the helper through Node so hoisted and monorepo installations work, then call it after
|
|
39
|
+
`react_native_post_install` in the one existing `post_install` block:
|
|
40
|
+
|
|
41
|
+
```ruby
|
|
42
|
+
def node_resolve(script)
|
|
43
|
+
Pod::Executable.execute_command('node', ['-p',
|
|
44
|
+
"require.resolve('#{script}', {paths: [process.argv[1]]})",
|
|
45
|
+
__dir__
|
|
46
|
+
]).strip
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
customer_io_package_root = File.dirname(node_resolve('zixflow-reactnative/package.json'))
|
|
50
|
+
require File.join(customer_io_package_root, 'ios', 'cocoapods_deployment_target')
|
|
51
|
+
|
|
52
|
+
customer_io_minimum_ios_version = Zixflow::CocoaPodsDeploymentTarget.maximum(
|
|
53
|
+
min_ios_version_supported,
|
|
54
|
+
'15.0'
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
post_install do |installer|
|
|
58
|
+
react_native_post_install(
|
|
59
|
+
installer,
|
|
60
|
+
config[:reactNativePath],
|
|
61
|
+
:mac_catalyst_enabled => false
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
Zixflow::CocoaPodsDeploymentTarget.normalize!(
|
|
65
|
+
installer,
|
|
66
|
+
minimum_ios_version: customer_io_minimum_ios_version
|
|
67
|
+
)
|
|
68
|
+
end
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Remove the generated `ios/Pods` directory and run `pod install` again. When a target build-setting
|
|
72
|
+
key is absent, the helper resolves the target xcconfig and matching project configuration before
|
|
73
|
+
adding an override. A present target key is authoritative, so lower-precedence xcconfig and project
|
|
74
|
+
values are not inspected. This matches Xcode's treatment of an explicitly empty target value: it
|
|
75
|
+
is missing and must be normalized, rather than inherited from a lower-precedence value. For each
|
|
76
|
+
change, the helper prints a stable project, target, and configuration line with the original
|
|
77
|
+
effective value and final value. It fails the install if the selected effective value is
|
|
78
|
+
non-numeric, such as `$(CUSTOM_IOS_FLOOR)`, because the generated-project audit cannot prove its
|
|
79
|
+
resolved value. A non-numeric value at a lower precedence does not fail when an explicit target
|
|
80
|
+
setting already determines the effective value.
|
|
81
|
+
SDK-, architecture-, or configuration-qualified keys such as
|
|
82
|
+
`IPHONEOS_DEPLOYMENT_TARGET[sdk=iphoneos*]` also fail before mutation at the selected precedence.
|
|
83
|
+
Xcode can choose a qualified key over an unconditional value, so adding a numeric override would
|
|
84
|
+
not prove the effective floor and could lower a higher conditional project setting. Replace the
|
|
85
|
+
selected conditional matrix with one numeric, unconditional deployment target before rerunning the
|
|
86
|
+
helper.
|
|
87
|
+
|
|
88
|
+
If the helper reports a non-numeric selected value, use the project, target, and configuration in
|
|
89
|
+
the error to locate the authoritative `IPHONEOS_DEPLOYMENT_TARGET`. Replace the macro or inherited
|
|
90
|
+
expression at that precedence with its intended numeric version, then run `pod install` again. For
|
|
91
|
+
a generated Pods target, make that override durably in the Podfile's `post_install` hook before
|
|
92
|
+
calling `Zixflow::CocoaPodsDeploymentTarget.normalize!`, or correct the podspec that supplies the
|
|
93
|
+
expression; do not edit the generated project because the next install replaces it. Do not skip
|
|
94
|
+
that target: continuing with an unresolved expression would leave the generated project outside
|
|
95
|
+
the deterministic audit. The helper validates every selected value before changing any project,
|
|
96
|
+
so this failure does not leave a partially normalized installation.
|
|
97
|
+
|
|
98
|
+
If an error says a selected xcconfig cannot be read or parsed, repair or remove the reported base
|
|
99
|
+
configuration file reference for the reported project, target, and configuration. Lower-precedence
|
|
100
|
+
xcconfigs are not parsed when the target build-setting key is present. Run the helper in the
|
|
101
|
+
CocoaPods Ruby environment so the public `Xcodeproj::Config` parser is available.
|
|
102
|
+
Synchronized-group xcconfig references are not resolved by that public parser; if the helper
|
|
103
|
+
reports one, replace it with a standard xcconfig file reference, then run `pod install` again.
|
|
104
|
+
These cases fail before any project mutation.
|
|
105
|
+
|
|
106
|
+
## When the helper is no longer needed
|
|
107
|
+
|
|
108
|
+
Keep the helper while a supported dependency graph can validly include deployment metadata below
|
|
109
|
+
the host application's minimum. This is expected while Zixflow supports older iOS versions or
|
|
110
|
+
supported third-party pods continue to declare lower minimums. A `platform` declaration in the
|
|
111
|
+
application's Podfile alone does not guarantee that every generated target uses the same value.
|
|
112
|
+
|
|
113
|
+
The helper becomes unnecessary only when a clean install without it proves that every
|
|
114
|
+
target/configuration in every supported React Native and push-provider graph declares an effective
|
|
115
|
+
numeric deployment target at or above the host application's minimum. That state would normally
|
|
116
|
+
follow an intentional platform-support change across the SDK, wrappers, and relevant dependencies;
|
|
117
|
+
it is not a prerequisite for adopting Xcode 27. Keep the audit in CI after removing the helper so
|
|
118
|
+
a later dependency update cannot silently reintroduce a lower target.
|
|
119
|
+
|
|
120
|
+
Repository contributors also have a deterministic CI audit under `scripts/` that prints the target,
|
|
121
|
+
matching project, and effective value for every generated target/configuration pair in stable
|
|
122
|
+
order. That audit script is not part of the published npm package. It examines every target in each
|
|
123
|
+
passed project, including non-integrated targets that the normalizer intentionally does not change;
|
|
124
|
+
set those targets to the host minimum explicitly. Pass the `Pods` directory so the audit discovers
|
|
125
|
+
every `.xcodeproj` directly under it, including CocoaPods multi-project output, while ignoring
|
|
126
|
+
unrelated example projects vendored inside downloaded pod sources. It fails if a supplied path is
|
|
127
|
+
missing or contains no projects.
|
|
128
|
+
|
|
129
|
+
```sh
|
|
130
|
+
cd example
|
|
131
|
+
bundle exec ruby ../scripts/audit_cocoapods_deployment_targets.rb \
|
|
132
|
+
--minimum 15.1 \
|
|
133
|
+
ios/Pods \
|
|
134
|
+
ios/SampleApp.xcodeproj
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Keep this audit next to the React Native simulator build and unsigned generic-device archive.
|
|
138
|
+
Passing those checks does not prove real-device push delivery, signed archive export, or App Store
|
|
139
|
+
submission.
|