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,390 @@
|
|
|
1
|
+
#if ZIXFLOW_LIVEACTIVITIES_ENABLED
|
|
2
|
+
import ActivityKit
|
|
3
|
+
import ZixflowDataPipelines
|
|
4
|
+
import ZixflowInternalCommon
|
|
5
|
+
import ZixflowLiveActivities
|
|
6
|
+
import ZixflowLiveActivities_Attributes
|
|
7
|
+
import ZixflowLiveActivities_Templates
|
|
8
|
+
import Foundation
|
|
9
|
+
import UIKit
|
|
10
|
+
|
|
11
|
+
@objc(NativeZixflowLiveActivities)
|
|
12
|
+
public class NativeLiveActivities: NSObject {
|
|
13
|
+
/// Reverse-DNS activity type identifiers for the SDK's built-in templates. These are the same
|
|
14
|
+
/// strings the backend sends as `notificationType` and that Android's `LiveNotificationType`
|
|
15
|
+
/// exposes, so JS, both native SDKs, and the wire format share one vocabulary.
|
|
16
|
+
enum TypeIdentifier {
|
|
17
|
+
static let segments = "com.zixflow.livenotifications.segments"
|
|
18
|
+
static let countdownTimer = "com.zixflow.livenotifications.countdowntimer"
|
|
19
|
+
/// Discriminator JavaScript sends for the custom template. Not a wire identifier — the
|
|
20
|
+
/// activity is reported under the app's own `liveNotifications.customType`.
|
|
21
|
+
static let custom = "custom"
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/// Type-erased handles keyed by activity id. The native `start` returns a generic
|
|
25
|
+
/// `CIOLiveActivity<Attributes>` that can't cross the bridge, so we keep closures that capture
|
|
26
|
+
/// the concrete handle and rebuild its content-state from a JS map on update.
|
|
27
|
+
private struct ActivityBox {
|
|
28
|
+
let update: ([String: Any]) async throws -> Void
|
|
29
|
+
let end: ([String: Any]?) async throws -> Void
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
private static var activities: [String: ActivityBox] = [:]
|
|
33
|
+
private static let lock = NSLock()
|
|
34
|
+
|
|
35
|
+
/// Records an `update`/`end` aimed at an activity this process never started. Not surfaced to
|
|
36
|
+
/// JavaScript — see the call sites — but worth a log, because the same message covers both a
|
|
37
|
+
/// genuine caller mistake and the expected post-restart / push-started cases.
|
|
38
|
+
private static func logUnknownActivity(_ activityId: String, method: String) {
|
|
39
|
+
DIGraphShared.shared.logger.info(
|
|
40
|
+
"Live Activities: \(method) ignored — no activity with id \(activityId) was started by this app session. " +
|
|
41
|
+
"Activities started before an app restart, or started by a push, are not tracked in-process."
|
|
42
|
+
)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// MARK: - Module registration
|
|
46
|
+
|
|
47
|
+
/// Build the Live Activities module from the SDK config's `liveNotifications` key, mirroring
|
|
48
|
+
/// ``NativeLocation/module(from:)``. Registers the enabled built-in template attribute types so
|
|
49
|
+
/// `Zixflow.liveActivities.start` can request them, and so push-to-start tokens register for
|
|
50
|
+
/// them at SDK init.
|
|
51
|
+
///
|
|
52
|
+
/// Unrecognized type identifiers are ignored: a newer native SDK may ship templates this
|
|
53
|
+
/// wrapper build doesn't know, and that must never break registration of the ones it does.
|
|
54
|
+
static func module(from config: [String: Any]) -> LiveActivitiesModule? {
|
|
55
|
+
guard let liveConfig = config["liveNotifications"] as? [String: Any] else { return nil }
|
|
56
|
+
guard #available(iOS 16.2, *) else { return nil }
|
|
57
|
+
let types = (liveConfig["types"] as? [String]) ?? []
|
|
58
|
+
var builder = LiveActivityConfigBuilder()
|
|
59
|
+
for type in types {
|
|
60
|
+
switch type {
|
|
61
|
+
case TypeIdentifier.segments:
|
|
62
|
+
builder = builder.register(CIOSegmentsAttributes.self)
|
|
63
|
+
case TypeIdentifier.countdownTimer:
|
|
64
|
+
builder = builder.register(CIOCountdownTimerAttributes.self)
|
|
65
|
+
default:
|
|
66
|
+
continue
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
// The custom template registers one SDK-owned Swift type under the app's own identifier.
|
|
70
|
+
// That indirection is what lets a JavaScript app have a custom activity at all: the SDK needs
|
|
71
|
+
// a metatype to register and to observe push-to-start for, and a metatype can't cross a bridge.
|
|
72
|
+
let trimmedCustomType = (liveConfig["customType"] as? String)?
|
|
73
|
+
.trimmingCharacters(in: .whitespacesAndNewlines)
|
|
74
|
+
let customType = (trimmedCustomType?.isEmpty == false) ? trimmedCustomType : nil
|
|
75
|
+
if let customType {
|
|
76
|
+
builder = builder.register(CIOCustomAttributes.self, identifier: customType)
|
|
77
|
+
}
|
|
78
|
+
return LiveActivitiesModule(config: builder.build())
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// MARK: - Bridge methods
|
|
82
|
+
|
|
83
|
+
@objc(start:resolve:reject:)
|
|
84
|
+
public func start(
|
|
85
|
+
_ payload: NSDictionary,
|
|
86
|
+
resolve: @escaping RCTPromiseResolveBlock,
|
|
87
|
+
reject: @escaping RCTPromiseRejectBlock
|
|
88
|
+
) {
|
|
89
|
+
guard #available(iOS 16.2, *) else {
|
|
90
|
+
return reject(Self.unavailableCode, Self.unavailableMessage, nil)
|
|
91
|
+
}
|
|
92
|
+
guard let map = payload as? [String: Any], let type = map["type"] as? String else {
|
|
93
|
+
return reject("live_activity_start_failed", "payload.type is required", nil)
|
|
94
|
+
}
|
|
95
|
+
do {
|
|
96
|
+
// A nil handle means the module isn't registered or this type wasn't enabled. The
|
|
97
|
+
// native SDK logs and returns nil rather than throwing, so surface it as a rejected
|
|
98
|
+
// promise — never a crash.
|
|
99
|
+
let id: String
|
|
100
|
+
switch type {
|
|
101
|
+
case TypeIdentifier.segments:
|
|
102
|
+
guard let handle = try Zixflow.liveActivities.start(
|
|
103
|
+
CIOSegmentsAttributes(header: try Self.requireString(map, "header")),
|
|
104
|
+
contentState: Self.segmentsState(from: map)
|
|
105
|
+
) else {
|
|
106
|
+
return reject(Self.notRegisteredCode, Self.notRegisteredMessage(type), nil)
|
|
107
|
+
}
|
|
108
|
+
Self.store(handle: handle, contentBuilder: Self.segmentsState)
|
|
109
|
+
id = handle.id
|
|
110
|
+
case TypeIdentifier.countdownTimer:
|
|
111
|
+
guard let handle = try Zixflow.liveActivities.start(
|
|
112
|
+
CIOCountdownTimerAttributes(header: try Self.requireString(map, "header")),
|
|
113
|
+
contentState: Self.countdownState(from: map)
|
|
114
|
+
) else {
|
|
115
|
+
return reject(Self.notRegisteredCode, Self.notRegisteredMessage(type), nil)
|
|
116
|
+
}
|
|
117
|
+
Self.store(handle: handle, contentBuilder: Self.countdownState)
|
|
118
|
+
id = handle.id
|
|
119
|
+
case TypeIdentifier.custom:
|
|
120
|
+
// No pre-check on the stored identifier: the SDK config can also be built by generated
|
|
121
|
+
// native code that never calls `module(from:)` — the Expo config plugin does exactly
|
|
122
|
+
// that — so a nil stored value doesn't mean the type is unregistered. Attempt the start
|
|
123
|
+
// and let the SDK answer; a nil handle means it genuinely isn't registered.
|
|
124
|
+
guard let handle = try Zixflow.liveActivities.start(
|
|
125
|
+
CIOCustomAttributes(),
|
|
126
|
+
contentState: Self.customState(from: map)
|
|
127
|
+
) else {
|
|
128
|
+
return reject(Self.notRegisteredCode, Self.customNotRegisteredMessage, nil)
|
|
129
|
+
}
|
|
130
|
+
Self.store(handle: handle, contentBuilder: Self.customState)
|
|
131
|
+
id = handle.id
|
|
132
|
+
default:
|
|
133
|
+
// A newer native SDK may know this type even though this wrapper build doesn't.
|
|
134
|
+
// Fail softly so an unrecognized template can never crash the host app.
|
|
135
|
+
return reject(Self.unsupportedTypeCode, "Unsupported Live Activity template: \(type)", nil)
|
|
136
|
+
}
|
|
137
|
+
resolve(id)
|
|
138
|
+
} catch {
|
|
139
|
+
reject("live_activity_start_failed", error.localizedDescription, error)
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
@objc(update:payload:resolve:reject:)
|
|
144
|
+
public func update(
|
|
145
|
+
_ activityId: String,
|
|
146
|
+
payload: NSDictionary,
|
|
147
|
+
resolve: @escaping RCTPromiseResolveBlock,
|
|
148
|
+
reject: @escaping RCTPromiseRejectBlock
|
|
149
|
+
) {
|
|
150
|
+
Self.lock.lock()
|
|
151
|
+
let box = Self.activities[activityId]
|
|
152
|
+
Self.lock.unlock()
|
|
153
|
+
// An unknown id means the update did not happen, so it must not report success. Unlike `end`
|
|
154
|
+
// — where re-ending an already-ended activity is a legitimate no-op — there is nothing
|
|
155
|
+
// idempotent about an update that never applied. Android *does* perform it (it routes the id
|
|
156
|
+
// straight to the native SDK), so resolving here would make the same call report success on
|
|
157
|
+
// both platforms while only one of them did anything.
|
|
158
|
+
guard let box else {
|
|
159
|
+
Self.logUnknownActivity(activityId, method: "update")
|
|
160
|
+
return reject(
|
|
161
|
+
"live_activity_update_failed",
|
|
162
|
+
"No live activity found for id \(activityId). On iOS only activities started in this " +
|
|
163
|
+
"app session can be updated.",
|
|
164
|
+
nil
|
|
165
|
+
)
|
|
166
|
+
}
|
|
167
|
+
guard let map = payload as? [String: Any] else {
|
|
168
|
+
return reject("live_activity_update_failed", "payload is required", nil)
|
|
169
|
+
}
|
|
170
|
+
Task {
|
|
171
|
+
do {
|
|
172
|
+
try await box.update(map)
|
|
173
|
+
resolve(nil)
|
|
174
|
+
} catch {
|
|
175
|
+
reject("live_activity_update_failed", error.localizedDescription, error)
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
@objc(end:payload:resolve:reject:)
|
|
181
|
+
public func end(
|
|
182
|
+
_ activityId: String,
|
|
183
|
+
payload: NSDictionary?,
|
|
184
|
+
resolve: @escaping RCTPromiseResolveBlock,
|
|
185
|
+
reject: @escaping RCTPromiseRejectBlock
|
|
186
|
+
) {
|
|
187
|
+
Self.lock.lock()
|
|
188
|
+
let box = Self.activities[activityId]
|
|
189
|
+
Self.lock.unlock()
|
|
190
|
+
// Unknown/already-ended id is treated as success (idempotent end). See `update` for why an
|
|
191
|
+
// unknown id is not an error.
|
|
192
|
+
guard let box else {
|
|
193
|
+
Self.logUnknownActivity(activityId, method: "end")
|
|
194
|
+
return resolve(nil)
|
|
195
|
+
}
|
|
196
|
+
let map = payload as? [String: Any]
|
|
197
|
+
Task {
|
|
198
|
+
do {
|
|
199
|
+
try await box.end(map)
|
|
200
|
+
// Dropped only once the end succeeded. Removing up front would lose the handle on a
|
|
201
|
+
// throw, and the retry would then take the unknown-id path above and report success
|
|
202
|
+
// for an activity still on screen.
|
|
203
|
+
Self.forget(activityId)
|
|
204
|
+
resolve(nil)
|
|
205
|
+
} catch {
|
|
206
|
+
reject("live_activity_end_failed", error.localizedDescription, error)
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
@objc(handleWidgetUrl:resolve:reject:)
|
|
212
|
+
public func handleWidgetUrl(
|
|
213
|
+
_ urlString: String,
|
|
214
|
+
resolve: @escaping RCTPromiseResolveBlock,
|
|
215
|
+
reject _: @escaping RCTPromiseRejectBlock
|
|
216
|
+
) {
|
|
217
|
+
guard let url = URL(string: urlString) else {
|
|
218
|
+
resolve(urlString)
|
|
219
|
+
return
|
|
220
|
+
}
|
|
221
|
+
guard let destination = Self.handleWidgetUrl(url) else {
|
|
222
|
+
// React Native maps NSNull to JavaScript null. Resolving Swift nil produces undefined,
|
|
223
|
+
// which would violate the public Promise<string | null> contract.
|
|
224
|
+
resolve(NSNull())
|
|
225
|
+
return
|
|
226
|
+
}
|
|
227
|
+
resolve(destination.absoluteString)
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/// Report an `opened` metric for a tapped Live Activity and return the deep link to route to.
|
|
231
|
+
///
|
|
232
|
+
/// - Returns: the customer's redirect URL for a Zixflow widget URL (`nil` when it carries
|
|
233
|
+
/// none), or `url` unchanged when it isn't a Zixflow URL — so existing routing still
|
|
234
|
+
/// handles non-CIO links.
|
|
235
|
+
@discardableResult
|
|
236
|
+
public static func handleWidgetUrl(_ url: URL) -> URL? {
|
|
237
|
+
Zixflow.liveActivities.handleWidgetUrl(url)
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/// Report an `opened` metric for a tapped Live Activity and route its destination through the
|
|
241
|
+
/// configured Zixflow router. Ordinary URLs continue through React Native Linking.
|
|
242
|
+
@objc(handleAndRouteWidgetUrl:)
|
|
243
|
+
public static func handleAndRouteWidgetUrl(_ url: URL) {
|
|
244
|
+
guard let routableUrl = handleWidgetUrl(url) else { return }
|
|
245
|
+
if routableUrl == url {
|
|
246
|
+
ZixflowReactNativeDeepLinkRouter.route(routableUrl)
|
|
247
|
+
} else {
|
|
248
|
+
ZixflowReactNativeDeepLinkRouter.accept(routableUrl)
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/// Build React Native launch options from a scene connection, reporting a cold Live Activity
|
|
253
|
+
/// tap and routing its destination through the installed Zixflow scene router. Without the
|
|
254
|
+
/// acknowledged-handler opt-in, the destination remains in React Native's launch options. This
|
|
255
|
+
/// mirrors the `RCTConvertConnectionOptionsToLaunchOptions` conversion verified in React Native
|
|
256
|
+
/// 0.88.0-nightly-20260823-0c7f63a4e. Before `Zixflow.initialize`, the native Live Activities
|
|
257
|
+
/// stub parses the redirect and buffers the opened metric for the module to flush at initialization.
|
|
258
|
+
@objc(reactNativeLaunchOptionsFromConnectionOptions:)
|
|
259
|
+
public static func reactNativeLaunchOptions(
|
|
260
|
+
from connectionOptions: UIScene.ConnectionOptions
|
|
261
|
+
) -> [UIApplication.LaunchOptionsKey: Any] {
|
|
262
|
+
var launchOptions: [UIApplication.LaunchOptionsKey: Any] = [:]
|
|
263
|
+
|
|
264
|
+
if let url = connectionOptions.urlContexts.first?.url,
|
|
265
|
+
let routableUrl = handleWidgetUrl(url)
|
|
266
|
+
{
|
|
267
|
+
if ZixflowReactNativeDeepLinkRouter.requiresAcknowledgedHandler,
|
|
268
|
+
routableUrl != url
|
|
269
|
+
{
|
|
270
|
+
ZixflowReactNativeDeepLinkRouter.accept(routableUrl)
|
|
271
|
+
} else {
|
|
272
|
+
launchOptions[.url] = routableUrl
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
if let userActivity = connectionOptions.userActivities.first {
|
|
277
|
+
launchOptions[.userActivityDictionary] = [
|
|
278
|
+
UIApplication.LaunchOptionsKey.userActivityType.rawValue: userActivity.activityType,
|
|
279
|
+
"UIApplicationLaunchOptionsUserActivityKey": userActivity,
|
|
280
|
+
]
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
return launchOptions
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
// MARK: - Helpers
|
|
287
|
+
|
|
288
|
+
@available(iOS 16.2, *)
|
|
289
|
+
private static func store<A: ActivityAttributes>(
|
|
290
|
+
handle: CIOLiveActivity<A>,
|
|
291
|
+
contentBuilder: @escaping ([String: Any]) throws -> A.ContentState
|
|
292
|
+
) {
|
|
293
|
+
let box = ActivityBox(
|
|
294
|
+
// ActivityKit keeps the last content-state on screen when `end` is given none, so a
|
|
295
|
+
// final payload is what lets the activity show a terminal state rather than freezing
|
|
296
|
+
// mid-progress.
|
|
297
|
+
update: { map in await handle.update(try contentBuilder(map)) },
|
|
298
|
+
end: { map in await handle.end(try map.map(contentBuilder)) }
|
|
299
|
+
)
|
|
300
|
+
lock.lock()
|
|
301
|
+
activities[handle.id] = box
|
|
302
|
+
lock.unlock()
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
private static func forget(_ activityId: String) {
|
|
306
|
+
lock.lock()
|
|
307
|
+
activities.removeValue(forKey: activityId)
|
|
308
|
+
lock.unlock()
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
/// Thrown for a missing required field so the caller sees a rejected promise naming it, rather
|
|
312
|
+
/// than an activity rendering with a blank line. Matches Android, whose `requireString` /
|
|
313
|
+
/// `requireDouble` already reject — an untyped JavaScript caller should not get a silent
|
|
314
|
+
/// half-rendered card on one platform and an error on the other.
|
|
315
|
+
private struct MissingFieldError: LocalizedError {
|
|
316
|
+
let field: String
|
|
317
|
+
var errorDescription: String? { "\(field) is required" }
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
private static func requireString(_ map: [String: Any], _ key: String) throws -> String {
|
|
321
|
+
guard let value = map[key] as? String else { throw MissingFieldError(field: key) }
|
|
322
|
+
return value
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
private static func requireInt(_ map: [String: Any], _ key: String) throws -> Int {
|
|
326
|
+
guard let value = map[key] as? NSNumber else { throw MissingFieldError(field: key) }
|
|
327
|
+
return value.intValue
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
@available(iOS 16.2, *)
|
|
331
|
+
private static func segmentsState(from map: [String: Any]) throws -> CIOSegmentsAttributes.ContentState {
|
|
332
|
+
CIOSegmentsAttributes.ContentState(
|
|
333
|
+
status: try requireString(map, "status"),
|
|
334
|
+
substatus: map["substatus"] as? String,
|
|
335
|
+
segmentsTotal: try requireInt(map, "segmentsTotal"),
|
|
336
|
+
segmentsComplete: try requireInt(map, "segmentsComplete"),
|
|
337
|
+
trailingText: map["trailingText"] as? String
|
|
338
|
+
)
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
@available(iOS 16.2, *)
|
|
342
|
+
private static func countdownState(from map: [String: Any]) throws -> CIOCountdownTimerAttributes.ContentState {
|
|
343
|
+
var endTime: EpochSecondsDate?
|
|
344
|
+
if let seconds = map["endTime"] as? NSNumber {
|
|
345
|
+
endTime = EpochSecondsDate(Date(timeIntervalSince1970: seconds.doubleValue))
|
|
346
|
+
}
|
|
347
|
+
return CIOCountdownTimerAttributes.ContentState(
|
|
348
|
+
title: try requireString(map, "title"),
|
|
349
|
+
statusMessage: map["statusMessage"] as? String,
|
|
350
|
+
endTime: endTime
|
|
351
|
+
)
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
/// Builds the custom template's content-state from the JS payload's `data` map.
|
|
355
|
+
///
|
|
356
|
+
/// Values are coerced to strings rather than rejected: JavaScript numbers and booleans arrive as
|
|
357
|
+
/// `NSNumber`, and refusing them would make `{ eta: 5 }` fail for no reason a caller can see.
|
|
358
|
+
/// Anything without a sensible text form is dropped instead of stringifying as gibberish.
|
|
359
|
+
@available(iOS 16.2, *)
|
|
360
|
+
private static func customState(from map: [String: Any]) throws -> CIOCustomAttributes.ContentState {
|
|
361
|
+
let raw = map["data"] as? [String: Any] ?? [:]
|
|
362
|
+
var data: [String: String] = [:]
|
|
363
|
+
for (key, value) in raw {
|
|
364
|
+
switch value {
|
|
365
|
+
case let string as String: data[key] = string
|
|
366
|
+
case let number as NSNumber: data[key] = number.stringValue
|
|
367
|
+
default: continue
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
return CIOCustomAttributes.ContentState(data: data)
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
private static let unavailableCode = "live_activity_module_unavailable"
|
|
374
|
+
private static let unavailableMessage =
|
|
375
|
+
"Live Activities require iOS 16.2 or later."
|
|
376
|
+
|
|
377
|
+
private static let customNotRegisteredMessage =
|
|
378
|
+
"No custom Live Activity type is registered. Set `liveNotifications.customType` in your " +
|
|
379
|
+
"Zixflow SDK config to your own reverse-DNS identifier, and render CIOCustomAttributes " +
|
|
380
|
+
"in your Widget Extension."
|
|
381
|
+
|
|
382
|
+
private static let notRegisteredCode = "live_activity_type_not_registered"
|
|
383
|
+
private static func notRegisteredMessage(_ type: String) -> String {
|
|
384
|
+
"Live Activity type '\(type)' is not registered. Add it to `liveNotifications.types` in your " +
|
|
385
|
+
"Zixflow SDK config, and make sure your widget extension renders it."
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
private static let unsupportedTypeCode = "live_activity_type_unsupported"
|
|
389
|
+
}
|
|
390
|
+
#endif
|
|
@@ -6,11 +6,13 @@ import CoreLocation
|
|
|
6
6
|
@objc(NativeZixflowLocation)
|
|
7
7
|
public class NativeLocation: NSObject {
|
|
8
8
|
|
|
9
|
-
/// Parses the root config and returns a `LocationModule`
|
|
10
|
-
///
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
let
|
|
9
|
+
/// Parses the root config and returns a `LocationModule` when location config is present
|
|
10
|
+
/// or when geofence is enabled (geofence depends on the location module). Keeps config
|
|
11
|
+
/// parsing within the location module. Defaults to `manual` tracking when no config is given.
|
|
12
|
+
static func module(from config: [String: Any], geofenceEnabled: Bool = false) -> LocationModule? {
|
|
13
|
+
let locationConfig = config["location"] as? [String: Any]
|
|
14
|
+
guard locationConfig != nil || geofenceEnabled else { return nil }
|
|
15
|
+
let trackingModeValue = locationConfig?["trackingMode"] as? String
|
|
14
16
|
let mode: LocationTrackingMode
|
|
15
17
|
switch trackingModeValue?.uppercased() {
|
|
16
18
|
case "OFF":
|
|
@@ -3,14 +3,12 @@ import ZixflowInternalCommon
|
|
|
3
3
|
import ZixflowMessagingInApp
|
|
4
4
|
|
|
5
5
|
enum SDKConfigBuilderError: Error {
|
|
6
|
-
case
|
|
6
|
+
case missingApiKey
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
extension SDKConfigBuilder {
|
|
10
10
|
private enum Config: String {
|
|
11
|
-
case
|
|
12
|
-
case cdpApiKey
|
|
13
|
-
case region
|
|
11
|
+
case apiKey
|
|
14
12
|
case logLevel
|
|
15
13
|
case apiHost
|
|
16
14
|
case cdnHost
|
|
@@ -23,13 +21,11 @@ extension SDKConfigBuilder {
|
|
|
23
21
|
|
|
24
22
|
@available(iOSApplicationExtension, unavailable)
|
|
25
23
|
static func create(from config: [String: Any?]) throws -> SDKConfigBuilder {
|
|
26
|
-
guard let
|
|
27
|
-
throw SDKConfigBuilderError.
|
|
24
|
+
guard let apiKey = config[Config.apiKey.rawValue] as? String else {
|
|
25
|
+
throw SDKConfigBuilderError.missingApiKey
|
|
28
26
|
}
|
|
29
27
|
|
|
30
|
-
let builder = SDKConfigBuilder(
|
|
31
|
-
Config.migrationSiteId.ifNotNil(in: config, thenPassItTo: builder.migrationSiteId)
|
|
32
|
-
Config.region.ifNotNil(in: config, thenPassItTo: builder.region, transformingBy: Region.getRegion)
|
|
28
|
+
let builder = SDKConfigBuilder(apiKey: apiKey)
|
|
33
29
|
Config.logLevel.ifNotNil(in: config, thenPassItTo: builder.logLevel, transformingBy: ZixflowLogLevel.getLogLevel)
|
|
34
30
|
Config.flushAt.ifNotNil(in: config, thenPassItTo: builder.flushAt) { (value: Double) in Int(value) }
|
|
35
31
|
Config.flushInterval.ifNotNil(in: config, thenPassItTo: builder.flushInterval)
|
|
@@ -11,6 +11,10 @@ enum ZixflowConstants {
|
|
|
11
11
|
static let errorWithMessage = "errorWithMessage"
|
|
12
12
|
static let messageActionTaken = "messageActionTaken"
|
|
13
13
|
|
|
14
|
+
// Notification Inbox event listener
|
|
15
|
+
static let messageOpened = "messageOpened"
|
|
16
|
+
static let inboxMessage = "message"
|
|
17
|
+
|
|
14
18
|
// Push Messaging
|
|
15
19
|
static let zixflowDeliveryId = "ZIXFLOW-Delivery-ID"
|
|
16
20
|
static let zixflowDeliveryToken = "ZIXFLOW-Delivery-Token"
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _NotificationInboxBellNativeComponent = _interopRequireDefault(require("../specs/components/NotificationInboxBellNativeComponent"));
|
|
9
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
+
/**
|
|
12
|
+
* Props for the {@link NotificationInboxBellView} component.
|
|
13
|
+
*/
|
|
14
|
+
/** @public */
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* The Visual Notification Inbox bell (with unread badge). Tapping it opens the
|
|
18
|
+
* SDK's own inbox panel — the host presents nothing.
|
|
19
|
+
*
|
|
20
|
+
* Place it wherever the app's layout calls for it. Remote branding still styles
|
|
21
|
+
* the bell itself (colors, icon), but branding's *position* is not applied: the
|
|
22
|
+
* host owns placement via `style`. The bell renders nothing when the inbox has
|
|
23
|
+
* nothing to show, so give it a fixed size for predictable layout — at least 88
|
|
24
|
+
* points/dp square, since the native composition insets the 56pt bell by 16 on
|
|
25
|
+
* each side and a smaller box squeezes the circle onto the glyph.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```tsx
|
|
29
|
+
* <NotificationInboxBellView
|
|
30
|
+
* style={{ width: 88, height: 88 }}
|
|
31
|
+
* onTap={() => analytics.track('inbox_bell_tapped')}
|
|
32
|
+
* />
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
/** @public */
|
|
36
|
+
const NotificationInboxBellView = ({
|
|
37
|
+
onTap,
|
|
38
|
+
...props
|
|
39
|
+
}) => {
|
|
40
|
+
const handleTap = () => {
|
|
41
|
+
onTap?.();
|
|
42
|
+
};
|
|
43
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_NotificationInboxBellNativeComponent.default, {
|
|
44
|
+
...props,
|
|
45
|
+
onTap: handleTap
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
var _default = exports.default = NotificationInboxBellView;
|
|
49
|
+
//# sourceMappingURL=NotificationInboxBellView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_NotificationInboxBellNativeComponent","_jsxRuntime","e","__esModule","default","NotificationInboxBellView","onTap","props","handleTap","jsx","_default","exports"],"sourceRoot":"../../../src","sources":["components/NotificationInboxBellView.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,qCAAA,GAAAF,sBAAA,CAAAC,OAAA;AAEkE,IAAAE,WAAA,GAAAF,OAAA;AAAA,SAAAD,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAElE;AACA;AACA;AACA;;AAeA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMG,yBAAmE,GAAGA,CAAC;EAC3EC,KAAK;EACL,GAAGC;AACL,CAAC,KAAK;EACJ,MAAMC,SAAS,GAAGA,CAAA,KAAM;IACtBF,KAAK,GAAG,CAAC;EACX,CAAC;EAED,oBAAO,IAAAL,WAAA,CAAAQ,GAAA,EAACT,qCAAA,CAAAI,OAAoC;IAAA,GAAKG,KAAK;IAAED,KAAK,EAAEE;EAAU,CAAE,CAAC;AAC9E,CAAC;AAAC,IAAAE,QAAA,GAAAC,OAAA,CAAAP,OAAA,GAEaC,yBAAyB","ignoreList":[]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _NotificationInboxViewNativeComponent = _interopRequireDefault(require("../specs/components/NotificationInboxViewNativeComponent"));
|
|
9
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
+
/**
|
|
12
|
+
* Props for the {@link NotificationInboxView} component.
|
|
13
|
+
*/
|
|
14
|
+
/** @public */
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* The Visual Notification Inbox message list — the Jist-rendered messages —
|
|
18
|
+
* embeddable directly in your own screen. It fills the area you give it via
|
|
19
|
+
* `style` and brings no surrounding chrome (no bell, no scrim).
|
|
20
|
+
*
|
|
21
|
+
* Message actions are handled by the existing global InboxEventListener, so this
|
|
22
|
+
* component takes no per-message action callback.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```tsx
|
|
26
|
+
* <NotificationInboxView style={{ flex: 1 }} />
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
/** @public */
|
|
30
|
+
const NotificationInboxView = props => {
|
|
31
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_NotificationInboxViewNativeComponent.default, {
|
|
32
|
+
...props
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
var _default = exports.default = NotificationInboxView;
|
|
36
|
+
//# sourceMappingURL=NotificationInboxView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_NotificationInboxViewNativeComponent","_jsxRuntime","e","__esModule","default","NotificationInboxView","props","jsx","_default","exports"],"sourceRoot":"../../../src","sources":["components/NotificationInboxView.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,qCAAA,GAAAF,sBAAA,CAAAC,OAAA;AAEkE,IAAAE,WAAA,GAAAF,OAAA;AAAA,SAAAD,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAElE;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMG,qBAA2D,GAAIC,KAAK,IAAK;EAC7E,oBAAO,IAAAL,WAAA,CAAAM,GAAA,EAACP,qCAAA,CAAAI,OAAoC;IAAA,GAAKE;EAAK,CAAG,CAAC;AAC5D,CAAC;AAAC,IAAAE,QAAA,GAAAC,OAAA,CAAAL,OAAA,GAEaC,qBAAqB","ignoreList":[]}
|
|
@@ -9,6 +9,20 @@ Object.defineProperty(exports, "InlineInAppMessageView", {
|
|
|
9
9
|
return _InlineInAppMessageView.default;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
+
Object.defineProperty(exports, "NotificationInboxBellView", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _NotificationInboxBellView.default;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "NotificationInboxView", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _NotificationInboxView.default;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
12
24
|
var _InlineInAppMessageView = _interopRequireDefault(require("./InlineInAppMessageView.js"));
|
|
25
|
+
var _NotificationInboxBellView = _interopRequireDefault(require("./NotificationInboxBellView.js"));
|
|
26
|
+
var _NotificationInboxView = _interopRequireDefault(require("./NotificationInboxView.js"));
|
|
13
27
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
28
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_InlineInAppMessageView","_interopRequireDefault","require","e","__esModule","default"],"sourceRoot":"../../../src","sources":["components/index.ts"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_InlineInAppMessageView","_interopRequireDefault","require","_NotificationInboxBellView","_NotificationInboxView","e","__esModule","default"],"sourceRoot":"../../../src","sources":["components/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAEA,IAAAA,uBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAIA,IAAAC,0BAAA,GAAAF,sBAAA,CAAAC,OAAA;AAEA,IAAAE,sBAAA,GAAAH,sBAAA,CAAAC,OAAA;AAA2E,SAAAD,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA","ignoreList":[]}
|