zixflow-reactnative 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/android/build.gradle +4 -13
- package/android/gradle.properties +1 -1
- package/android/src/main/AndroidManifest.xml +5 -5
- package/android/src/main/java/{io/customer/reactnative/sdk/NativeCustomerIOModule.kt → com/zixflow/reactnative/sdk/NativeZixflowModule.kt} +35 -35
- package/android/src/main/java/{io/customer/reactnative/sdk/CustomerIOReactNativePackage.kt → com/zixflow/reactnative/sdk/ZixflowReactNativePackage.kt} +15 -15
- package/android/src/main/java/{io/customer → com/zixflow}/reactnative/sdk/constant/Keys.kt +1 -1
- package/android/src/main/java/{io/customer → com/zixflow}/reactnative/sdk/extension/MapExtensions.kt +1 -1
- package/android/src/main/java/{io/customer → com/zixflow}/reactnative/sdk/extension/ReactExtensions.kt +1 -1
- package/android/src/main/java/{io/customer → com/zixflow}/reactnative/sdk/extension/StringExtensions.kt +1 -1
- package/android/src/main/java/{io/customer → com/zixflow}/reactnative/sdk/extension/ViewExtensions.kt +1 -1
- package/android/src/main/java/{io/customer → com/zixflow}/reactnative/sdk/location/NativeLocationModule.kt +15 -15
- package/android/src/main/java/{io/customer/reactnative/sdk/logging/NativeCustomerIOLoggingModule.kt → com/zixflow/reactnative/sdk/logging/NativeZixflowLoggingModule.kt} +10 -10
- package/android/src/main/java/{io/customer → com/zixflow}/reactnative/sdk/messaginginapp/InlineInAppMessageViewManager.kt +2 -2
- package/android/src/main/java/{io/customer → com/zixflow}/reactnative/sdk/messaginginapp/NativeMessagingInAppModule.kt +26 -26
- package/android/src/main/java/{io/customer → com/zixflow}/reactnative/sdk/messaginginapp/NotificationInboxExtensions.kt +5 -5
- package/android/src/main/java/{io/customer → com/zixflow}/reactnative/sdk/messaginginapp/ReactInAppEventListener.kt +4 -4
- package/android/src/main/java/{io/customer → com/zixflow}/reactnative/sdk/messaginginapp/ReactInAppPlatformDelegate.kt +3 -3
- package/android/src/main/java/{io/customer → com/zixflow}/reactnative/sdk/messaginginapp/ReactInlineInAppMessageView.kt +5 -5
- package/android/src/main/java/{io/customer → com/zixflow}/reactnative/sdk/messaginginapp/ReactNotificationInboxChangeListener.kt +3 -3
- package/android/src/main/java/{io/customer → com/zixflow}/reactnative/sdk/messagingpush/NativeMessagingPushModule.kt +25 -25
- package/android/src/main/java/{io/customer → com/zixflow}/reactnative/sdk/messagingpush/PermissionStatus.kt +1 -1
- package/android/src/main/java/{io/customer → com/zixflow}/reactnative/sdk/messagingpush/PushMessagingExtensions.kt +2 -2
- package/android/src/main/java/{io/customer → com/zixflow}/reactnative/sdk/util/Preconditions.kt +3 -3
- package/android/src/main/res/values/{customer_io_config.xml → zixflow_config.xml} +2 -2
- package/ios/wrappers/{NativeCustomerIO.mm → NativeZixflow.mm} +9 -9
- package/ios/wrappers/{NativeCustomerIO.swift → NativeZixflow.swift} +31 -31
- package/ios/wrappers/inapp/InboxMessage+Conversion.swift +1 -1
- package/ios/wrappers/inapp/NativeMessagingInApp.mm +8 -8
- package/ios/wrappers/inapp/NativeMessagingInApp.swift +7 -7
- package/ios/wrappers/inapp/ReactInAppEventListener.swift +12 -12
- package/ios/wrappers/inapp/inline/ReactInlineMessageView.swift +1 -1
- package/ios/wrappers/location/NativeLocation.mm +8 -8
- package/ios/wrappers/location/NativeLocation.swift +6 -6
- package/ios/wrappers/logging/{NativeCustomerIOLogging.mm → NativeZixflowLogging.mm} +14 -14
- package/ios/wrappers/logging/{NativeCustomerIOLogging.swift → NativeZixflowLogging.swift} +6 -6
- package/ios/wrappers/push/NativeMessagingPush.mm +8 -8
- package/ios/wrappers/push/NativeMessagingPush.swift +12 -12
- package/ios/wrappers/utils/Preconditions.swift +1 -1
- package/ios/wrappers/utils/{RCTCustomerIOUtils.h → RCTZixflowUtils.h} +3 -3
- package/ios/wrappers/utils/{CioConfigUtils.swift → ZixflowConfigUtils.swift} +4 -4
- package/ios/wrappers/utils/{CioConstants.swift → ZixflowConstants.swift} +4 -4
- package/lib/commonjs/native-logger-listener.js +10 -10
- package/lib/commonjs/native-logger-listener.js.map +1 -1
- package/lib/commonjs/notification-inbox.js +4 -4
- package/lib/commonjs/notification-inbox.js.map +1 -1
- package/lib/commonjs/postInstall.js +1 -1
- package/lib/commonjs/postInstall.js.map +1 -1
- package/lib/commonjs/specs/modules/{NativeCustomerIO.js → NativeZixflow.js} +6 -6
- package/lib/commonjs/specs/modules/NativeZixflow.js.map +1 -0
- package/lib/commonjs/specs/modules/{NativeCustomerIOLocation.js → NativeZixflowLocation.js} +4 -4
- package/lib/commonjs/specs/modules/NativeZixflowLocation.js.map +1 -0
- package/lib/commonjs/specs/modules/NativeZixflowLogging.js +19 -0
- package/lib/commonjs/specs/modules/NativeZixflowLogging.js.map +1 -0
- package/lib/commonjs/specs/modules/NativeZixflowMessagingInApp.js +16 -0
- package/lib/commonjs/specs/modules/NativeZixflowMessagingInApp.js.map +1 -0
- package/lib/commonjs/specs/modules/{NativeCustomerIOMessagingPush.js → NativeZixflowMessagingPush.js} +4 -4
- package/lib/commonjs/specs/modules/NativeZixflowMessagingPush.js.map +1 -0
- package/lib/commonjs/types/data-pipelines.js +23 -23
- package/lib/commonjs/types/data-pipelines.js.map +1 -1
- package/lib/commonjs/types/push.js +6 -6
- package/lib/commonjs/types/push.js.map +1 -1
- package/lib/commonjs/utils/native-bridge.js +1 -1
- package/lib/commonjs/utils/native-bridge.js.map +1 -1
- package/lib/commonjs/utils/param-validation.js +4 -4
- package/lib/commonjs/utils/param-validation.js.map +1 -1
- package/lib/commonjs/{customerio-cdp.js → zixflow-cdp.js} +19 -19
- package/lib/commonjs/zixflow-cdp.js.map +1 -0
- package/lib/commonjs/{customerio-inapp.js → zixflow-inapp.js} +8 -7
- package/lib/commonjs/zixflow-inapp.js.map +1 -0
- package/lib/commonjs/{customerio-location.js → zixflow-location.js} +10 -10
- package/lib/commonjs/zixflow-location.js.map +1 -0
- package/lib/commonjs/zixflow-params.js +2 -0
- package/lib/commonjs/zixflow-params.js.map +1 -0
- package/lib/commonjs/{customerio-push.js → zixflow-push.js} +11 -11
- package/lib/commonjs/zixflow-push.js.map +1 -0
- package/lib/commonjs/zixflow.js +19 -26
- package/lib/commonjs/zixflow.js.map +1 -1
- package/lib/module/index.js +3 -3
- package/lib/module/native-logger-listener.js +11 -11
- package/lib/module/native-logger-listener.js.map +1 -1
- package/lib/module/notification-inbox.js +4 -4
- package/lib/module/notification-inbox.js.map +1 -1
- package/lib/module/postInstall.js +1 -1
- package/lib/module/postInstall.js.map +1 -1
- package/lib/module/specs/modules/{NativeCustomerIO.js → NativeZixflow.js} +6 -6
- package/lib/module/specs/modules/NativeZixflow.js.map +1 -0
- package/lib/module/specs/modules/NativeZixflowLocation.js +13 -0
- package/lib/module/specs/modules/NativeZixflowLocation.js.map +1 -0
- package/lib/module/specs/modules/NativeZixflowLogging.js +18 -0
- package/lib/module/specs/modules/NativeZixflowLogging.js.map +1 -0
- package/lib/module/specs/modules/NativeZixflowMessagingInApp.js +15 -0
- package/lib/module/specs/modules/NativeZixflowMessagingInApp.js.map +1 -0
- package/lib/module/specs/modules/NativeZixflowMessagingPush.js +13 -0
- package/lib/module/specs/modules/NativeZixflowMessagingPush.js.map +1 -0
- package/lib/module/types/data-pipelines.js +22 -22
- package/lib/module/types/data-pipelines.js.map +1 -1
- package/lib/module/types/push.js +5 -5
- package/lib/module/types/push.js.map +1 -1
- package/lib/module/utils/native-bridge.js +1 -1
- package/lib/module/utils/native-bridge.js.map +1 -1
- package/lib/module/utils/param-validation.js +4 -4
- package/lib/module/utils/param-validation.js.map +1 -1
- package/lib/module/{customerio-cdp.js → zixflow-cdp.js} +16 -16
- package/lib/module/zixflow-cdp.js.map +1 -0
- package/lib/module/{customerio-inapp.js → zixflow-inapp.js} +6 -6
- package/lib/module/zixflow-inapp.js.map +1 -0
- package/lib/module/{customerio-location.js → zixflow-location.js} +6 -6
- package/lib/module/zixflow-location.js.map +1 -0
- package/lib/module/zixflow-params.js +2 -0
- package/lib/module/zixflow-params.js.map +1 -0
- package/lib/module/{customerio-push.js → zixflow-push.js} +10 -10
- package/lib/module/zixflow-push.js.map +1 -0
- package/lib/module/zixflow.js +5 -11
- package/lib/module/zixflow.js.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +2 -2
- package/lib/typescript/commonjs/native-logger-listener.d.ts.map +1 -1
- package/lib/typescript/commonjs/notification-inbox.d.ts +1 -1
- package/lib/typescript/commonjs/specs/modules/{NativeCustomerIO.d.ts → NativeZixflow.d.ts} +5 -5
- package/lib/typescript/commonjs/specs/modules/NativeZixflow.d.ts.map +1 -0
- package/lib/typescript/commonjs/specs/modules/{NativeCustomerIOLocation.d.ts → NativeZixflowLocation.d.ts} +3 -3
- package/lib/typescript/commonjs/specs/modules/NativeZixflowLocation.d.ts.map +1 -0
- package/lib/typescript/commonjs/specs/modules/NativeZixflowLogging.d.ts +18 -0
- package/lib/typescript/commonjs/specs/modules/NativeZixflowLogging.d.ts.map +1 -0
- package/lib/typescript/commonjs/specs/modules/{NativeCustomerIOMessagingInApp.d.ts → NativeZixflowMessagingInApp.d.ts} +4 -4
- package/lib/typescript/commonjs/specs/modules/NativeZixflowMessagingInApp.d.ts.map +1 -0
- package/lib/typescript/{module/specs/modules/NativeCustomerIOMessagingPush.d.ts → commonjs/specs/modules/NativeZixflowMessagingPush.d.ts} +3 -3
- package/lib/typescript/commonjs/specs/modules/NativeZixflowMessagingPush.d.ts.map +1 -0
- package/lib/typescript/commonjs/types/data-pipelines.d.ts +14 -14
- package/lib/typescript/commonjs/types/data-pipelines.d.ts.map +1 -1
- package/lib/typescript/commonjs/types/internal.d.ts +2 -2
- package/lib/typescript/commonjs/types/push.d.ts +2 -2
- package/lib/typescript/commonjs/types/push.d.ts.map +1 -1
- package/lib/typescript/commonjs/utils/param-validation.d.ts +2 -2
- package/lib/typescript/commonjs/utils/param-validation.d.ts.map +1 -1
- package/lib/typescript/commonjs/{customerio-cdp.d.ts → zixflow-cdp.d.ts} +12 -12
- package/lib/typescript/commonjs/zixflow-cdp.d.ts.map +1 -0
- package/lib/typescript/{module/customerio-inapp.d.ts → commonjs/zixflow-inapp.d.ts} +4 -4
- package/lib/typescript/commonjs/zixflow-inapp.d.ts.map +1 -0
- package/lib/typescript/commonjs/{customerio-location.d.ts → zixflow-location.d.ts} +5 -5
- package/lib/typescript/commonjs/zixflow-location.d.ts.map +1 -0
- package/lib/typescript/commonjs/{cio-params.d.ts → zixflow-params.d.ts} +1 -1
- package/lib/typescript/commonjs/zixflow-params.d.ts.map +1 -0
- package/lib/typescript/{module/customerio-push.d.ts → commonjs/zixflow-push.d.ts} +11 -11
- package/lib/typescript/commonjs/zixflow-push.d.ts.map +1 -0
- package/lib/typescript/commonjs/zixflow.d.ts +5 -7
- package/lib/typescript/commonjs/zixflow.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +2 -2
- package/lib/typescript/module/native-logger-listener.d.ts.map +1 -1
- package/lib/typescript/module/notification-inbox.d.ts +1 -1
- package/lib/typescript/module/specs/modules/{NativeCustomerIO.d.ts → NativeZixflow.d.ts} +5 -5
- package/lib/typescript/module/specs/modules/NativeZixflow.d.ts.map +1 -0
- package/lib/typescript/module/specs/modules/{NativeCustomerIOLocation.d.ts → NativeZixflowLocation.d.ts} +3 -3
- package/lib/typescript/module/specs/modules/NativeZixflowLocation.d.ts.map +1 -0
- package/lib/typescript/module/specs/modules/NativeZixflowLogging.d.ts +18 -0
- package/lib/typescript/module/specs/modules/NativeZixflowLogging.d.ts.map +1 -0
- package/lib/typescript/module/specs/modules/{NativeCustomerIOMessagingInApp.d.ts → NativeZixflowMessagingInApp.d.ts} +4 -4
- package/lib/typescript/module/specs/modules/NativeZixflowMessagingInApp.d.ts.map +1 -0
- package/lib/typescript/{commonjs/specs/modules/NativeCustomerIOMessagingPush.d.ts → module/specs/modules/NativeZixflowMessagingPush.d.ts} +3 -3
- package/lib/typescript/module/specs/modules/NativeZixflowMessagingPush.d.ts.map +1 -0
- package/lib/typescript/module/types/data-pipelines.d.ts +14 -14
- package/lib/typescript/module/types/data-pipelines.d.ts.map +1 -1
- package/lib/typescript/module/types/internal.d.ts +2 -2
- package/lib/typescript/module/types/push.d.ts +2 -2
- package/lib/typescript/module/types/push.d.ts.map +1 -1
- package/lib/typescript/module/utils/param-validation.d.ts +2 -2
- package/lib/typescript/module/utils/param-validation.d.ts.map +1 -1
- package/lib/typescript/module/{customerio-cdp.d.ts → zixflow-cdp.d.ts} +12 -12
- package/lib/typescript/module/zixflow-cdp.d.ts.map +1 -0
- package/lib/typescript/{commonjs/customerio-inapp.d.ts → module/zixflow-inapp.d.ts} +4 -4
- package/lib/typescript/module/zixflow-inapp.d.ts.map +1 -0
- package/lib/typescript/module/{customerio-location.d.ts → zixflow-location.d.ts} +5 -5
- package/lib/typescript/module/zixflow-location.d.ts.map +1 -0
- package/lib/typescript/module/{cio-params.d.ts → zixflow-params.d.ts} +1 -1
- package/lib/typescript/module/zixflow-params.d.ts.map +1 -0
- package/lib/typescript/{commonjs/customerio-push.d.ts → module/zixflow-push.d.ts} +11 -11
- package/lib/typescript/module/zixflow-push.d.ts.map +1 -0
- package/lib/typescript/module/zixflow.d.ts +5 -7
- package/lib/typescript/module/zixflow.d.ts.map +1 -1
- package/package.json +11 -12
- package/src/index.ts +3 -3
- package/src/native-logger-listener.ts +14 -14
- package/src/notification-inbox.ts +5 -5
- package/src/postInstall.js +1 -1
- package/src/specs/modules/{NativeCustomerIO.ts → NativeZixflow.ts} +5 -5
- package/src/specs/modules/{NativeCustomerIOLocation.ts → NativeZixflowLocation.ts} +3 -3
- package/src/specs/modules/NativeZixflowLogging.ts +22 -0
- package/src/specs/modules/{NativeCustomerIOMessagingInApp.ts → NativeZixflowMessagingInApp.ts} +4 -4
- package/src/specs/modules/{NativeCustomerIOMessagingPush.ts → NativeZixflowMessagingPush.ts} +3 -3
- package/src/types/data-pipelines.ts +14 -14
- package/src/types/internal.ts +2 -2
- package/src/types/push.ts +2 -2
- package/src/utils/native-bridge.ts +1 -1
- package/src/utils/param-validation.ts +8 -8
- package/src/{customerio-cdp.ts → zixflow-cdp.ts} +17 -17
- package/src/{customerio-inapp.ts → zixflow-inapp.ts} +6 -6
- package/src/{customerio-location.ts → zixflow-location.ts} +6 -6
- package/src/{customerio-push.ts → zixflow-push.ts} +19 -17
- package/src/zixflow.ts +5 -15
- package/zixflow-reactnative.podspec +16 -22
- package/customerio-reactnative.podspec +0 -60
- package/lib/commonjs/cio-params.js +0 -2
- package/lib/commonjs/cio-params.js.map +0 -1
- package/lib/commonjs/customerio-cdp.js.map +0 -1
- package/lib/commonjs/customerio-inapp.js.map +0 -1
- package/lib/commonjs/customerio-location.js.map +0 -1
- package/lib/commonjs/customerio-push.js.map +0 -1
- package/lib/commonjs/specs/modules/NativeCustomerIO.js.map +0 -1
- package/lib/commonjs/specs/modules/NativeCustomerIOLocation.js.map +0 -1
- package/lib/commonjs/specs/modules/NativeCustomerIOLogging.js +0 -19
- package/lib/commonjs/specs/modules/NativeCustomerIOLogging.js.map +0 -1
- package/lib/commonjs/specs/modules/NativeCustomerIOMessagingInApp.js +0 -16
- package/lib/commonjs/specs/modules/NativeCustomerIOMessagingInApp.js.map +0 -1
- package/lib/commonjs/specs/modules/NativeCustomerIOMessagingPush.js.map +0 -1
- package/lib/module/cio-params.js +0 -2
- package/lib/module/cio-params.js.map +0 -1
- package/lib/module/customerio-cdp.js.map +0 -1
- package/lib/module/customerio-inapp.js.map +0 -1
- package/lib/module/customerio-location.js.map +0 -1
- package/lib/module/customerio-push.js.map +0 -1
- package/lib/module/specs/modules/NativeCustomerIO.js.map +0 -1
- package/lib/module/specs/modules/NativeCustomerIOLocation.js +0 -13
- package/lib/module/specs/modules/NativeCustomerIOLocation.js.map +0 -1
- package/lib/module/specs/modules/NativeCustomerIOLogging.js +0 -18
- package/lib/module/specs/modules/NativeCustomerIOLogging.js.map +0 -1
- package/lib/module/specs/modules/NativeCustomerIOMessagingInApp.js +0 -15
- package/lib/module/specs/modules/NativeCustomerIOMessagingInApp.js.map +0 -1
- package/lib/module/specs/modules/NativeCustomerIOMessagingPush.js +0 -13
- package/lib/module/specs/modules/NativeCustomerIOMessagingPush.js.map +0 -1
- package/lib/typescript/commonjs/cio-params.d.ts.map +0 -1
- package/lib/typescript/commonjs/customerio-cdp.d.ts.map +0 -1
- package/lib/typescript/commonjs/customerio-inapp.d.ts.map +0 -1
- package/lib/typescript/commonjs/customerio-location.d.ts.map +0 -1
- package/lib/typescript/commonjs/customerio-push.d.ts.map +0 -1
- package/lib/typescript/commonjs/specs/modules/NativeCustomerIO.d.ts.map +0 -1
- package/lib/typescript/commonjs/specs/modules/NativeCustomerIOLocation.d.ts.map +0 -1
- package/lib/typescript/commonjs/specs/modules/NativeCustomerIOLogging.d.ts +0 -18
- package/lib/typescript/commonjs/specs/modules/NativeCustomerIOLogging.d.ts.map +0 -1
- package/lib/typescript/commonjs/specs/modules/NativeCustomerIOMessagingInApp.d.ts.map +0 -1
- package/lib/typescript/commonjs/specs/modules/NativeCustomerIOMessagingPush.d.ts.map +0 -1
- package/lib/typescript/module/cio-params.d.ts.map +0 -1
- package/lib/typescript/module/customerio-cdp.d.ts.map +0 -1
- package/lib/typescript/module/customerio-inapp.d.ts.map +0 -1
- package/lib/typescript/module/customerio-location.d.ts.map +0 -1
- package/lib/typescript/module/customerio-push.d.ts.map +0 -1
- package/lib/typescript/module/specs/modules/NativeCustomerIO.d.ts.map +0 -1
- package/lib/typescript/module/specs/modules/NativeCustomerIOLocation.d.ts.map +0 -1
- package/lib/typescript/module/specs/modules/NativeCustomerIOLogging.d.ts +0 -18
- package/lib/typescript/module/specs/modules/NativeCustomerIOLogging.d.ts.map +0 -1
- package/lib/typescript/module/specs/modules/NativeCustomerIOMessagingInApp.d.ts.map +0 -1
- package/lib/typescript/module/specs/modules/NativeCustomerIOMessagingPush.d.ts.map +0 -1
- package/src/specs/modules/NativeCustomerIOLogging.ts +0 -24
- /package/android/{cio-core.gradle → zixflow-core.gradle} +0 -0
- /package/src/{cio-params.ts → zixflow-params.ts} +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
package
|
|
1
|
+
package com.zixflow.reactnative.sdk.messaginginapp
|
|
2
2
|
|
|
3
3
|
import com.facebook.react.bridge.Arguments
|
|
4
4
|
import com.facebook.react.bridge.ReadableMap
|
|
5
|
-
import
|
|
6
|
-
import
|
|
5
|
+
import com.zixflow.messaginginapp.gist.data.model.InboxMessage
|
|
6
|
+
import com.zixflow.messaginginapp.inbox.NotificationInboxChangeListener
|
|
7
7
|
|
|
8
8
|
class ReactNotificationInboxChangeListener private constructor() : NotificationInboxChangeListener {
|
|
9
9
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
package
|
|
1
|
+
package com.zixflow.reactnative.sdk.messagingpush
|
|
2
2
|
|
|
3
3
|
import android.Manifest
|
|
4
4
|
import android.app.Activity
|
|
@@ -13,30 +13,30 @@ import com.facebook.react.bridge.ReactContext
|
|
|
13
13
|
import com.facebook.react.bridge.ReadableMap
|
|
14
14
|
import com.facebook.react.modules.core.PermissionAwareActivity
|
|
15
15
|
import com.facebook.react.modules.core.PermissionListener
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
-
import
|
|
30
|
-
import
|
|
16
|
+
import com.zixflow.messagingpush.ZixflowFirebaseMessagingService
|
|
17
|
+
import com.zixflow.messagingpush.MessagingPushModuleConfig
|
|
18
|
+
import com.zixflow.messagingpush.ModuleMessagingPushFCM
|
|
19
|
+
import com.zixflow.messagingpush.config.PushClickBehavior
|
|
20
|
+
import com.zixflow.messagingpush.di.pushModuleConfig
|
|
21
|
+
import com.zixflow.messagingpush.di.pushTrackingUtil
|
|
22
|
+
import com.zixflow.reactnative.sdk.NativeZixflowMessagingPushSpec
|
|
23
|
+
import com.zixflow.reactnative.sdk.constant.Keys
|
|
24
|
+
import com.zixflow.reactnative.sdk.extension.getTypedValue
|
|
25
|
+
import com.zixflow.reactnative.sdk.extension.takeIfNotBlank
|
|
26
|
+
import com.zixflow.reactnative.sdk.util.unsupportedOnAndroid
|
|
27
|
+
import com.zixflow.sdk.Zixflow
|
|
28
|
+
import com.zixflow.sdk.ZixflowBuilder
|
|
29
|
+
import com.zixflow.sdk.core.di.SDKComponent
|
|
30
|
+
import com.zixflow.sdk.core.util.Logger
|
|
31
31
|
import java.util.UUID
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
|
-
* React Native module implementation for
|
|
34
|
+
* React Native module implementation for Zixflow Push Messaging Native SDK using
|
|
35
35
|
* TurboModules with new architecture.
|
|
36
36
|
*/
|
|
37
37
|
class NativeMessagingPushModule(
|
|
38
38
|
private val reactContext: ReactApplicationContext,
|
|
39
|
-
) :
|
|
39
|
+
) : NativeZixflowMessagingPushSpec(reactContext), PermissionListener, ActivityEventListener {
|
|
40
40
|
private val logger: Logger
|
|
41
41
|
get() = SDKComponent.logger
|
|
42
42
|
|
|
@@ -103,7 +103,7 @@ class NativeMessagingPushModule(
|
|
|
103
103
|
|
|
104
104
|
/**
|
|
105
105
|
* Handles push notification received. This is helpful in processing push notifications
|
|
106
|
-
* received outside the
|
|
106
|
+
* received outside the Zixflow SDK.
|
|
107
107
|
*
|
|
108
108
|
* @param message push payload received from FCM.
|
|
109
109
|
* @param handleNotificationTrigger indicating if the local notification should be triggered.
|
|
@@ -122,7 +122,7 @@ class NativeMessagingPushModule(
|
|
|
122
122
|
// Generate destination string, see docs on receiver method for more details
|
|
123
123
|
val destination =
|
|
124
124
|
message.getString("to")?.takeIfNotBlank() ?: UUID.randomUUID().toString()
|
|
125
|
-
val isNotificationHandled =
|
|
125
|
+
val isNotificationHandled = ZixflowFirebaseMessagingService.onMessageReceived(
|
|
126
126
|
context = reactContext,
|
|
127
127
|
remoteMessage = message.toFCMRemoteMessage(destination = destination),
|
|
128
128
|
handleNotificationTrigger = handleNotificationTrigger,
|
|
@@ -150,7 +150,7 @@ class NativeMessagingPushModule(
|
|
|
150
150
|
override fun getRegisteredDeviceToken(promise: Promise?) {
|
|
151
151
|
try {
|
|
152
152
|
// Get the device token from SDK
|
|
153
|
-
val deviceToken: String? =
|
|
153
|
+
val deviceToken: String? = Zixflow.instance().registeredDeviceToken
|
|
154
154
|
|
|
155
155
|
if (deviceToken != null) {
|
|
156
156
|
promise?.resolve(deviceToken)
|
|
@@ -234,7 +234,7 @@ class NativeMessagingPushModule(
|
|
|
234
234
|
}
|
|
235
235
|
|
|
236
236
|
companion object {
|
|
237
|
-
const val NAME = "
|
|
237
|
+
const val NAME = "NativeZixflowMessagingPush"
|
|
238
238
|
|
|
239
239
|
/**
|
|
240
240
|
* Copying value os [Manifest.permission.POST_NOTIFICATIONS] as constant so we don't have to
|
|
@@ -252,11 +252,11 @@ class NativeMessagingPushModule(
|
|
|
252
252
|
* Adds push messaging module to native Android SDK based on the configuration provided by
|
|
253
253
|
* customer app.
|
|
254
254
|
*
|
|
255
|
-
* @param builder instance of
|
|
255
|
+
* @param builder instance of ZixflowBuilder to add push messaging module.
|
|
256
256
|
* @param config configuration provided by customer app for push messaging module.
|
|
257
257
|
*/
|
|
258
258
|
internal fun addNativeModuleFromConfig(
|
|
259
|
-
builder:
|
|
259
|
+
builder: ZixflowBuilder,
|
|
260
260
|
config: Map<String, Any>
|
|
261
261
|
) {
|
|
262
262
|
val androidConfig =
|
|
@@ -277,7 +277,7 @@ class NativeMessagingPushModule(
|
|
|
277
277
|
setPushClickBehavior(pushClickBehavior = pushClickBehavior)
|
|
278
278
|
}.build(),
|
|
279
279
|
)
|
|
280
|
-
builder.
|
|
280
|
+
builder.addZixflowModule(module)
|
|
281
281
|
}
|
|
282
282
|
}
|
|
283
283
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
package
|
|
1
|
+
package com.zixflow.reactnative.sdk.messagingpush
|
|
2
2
|
|
|
3
3
|
import com.facebook.react.bridge.ReadableMap
|
|
4
4
|
import com.google.firebase.messaging.RemoteMessage
|
|
5
|
-
import
|
|
5
|
+
import com.zixflow.reactnative.sdk.extension.toMap
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Safely transforms any value to string
|
package/android/src/main/java/{io/customer → com/zixflow}/reactnative/sdk/util/Preconditions.kt
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
package
|
|
1
|
+
package com.zixflow.reactnative.sdk.util
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import com.zixflow.reactnative.sdk.BuildConfig
|
|
4
|
+
import com.zixflow.sdk.core.di.SDKComponent
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Asserts that a value is non-null in debug builds.
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
<!--
|
|
4
4
|
SDK source to be used in user-agent string
|
|
5
5
|
-->
|
|
6
|
-
<string name="
|
|
6
|
+
<string name="zixflow_react_native_sdk_client_source">ReactNative</string>
|
|
7
7
|
<!--
|
|
8
8
|
SDK version to be used in user-agent string
|
|
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="
|
|
12
|
+
<string name="zixflow_react_native_sdk_client_version">1.1.0</string>
|
|
13
13
|
</resources>
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
#import "utils/
|
|
1
|
+
#import "utils/RCTZixflowUtils.h"
|
|
2
2
|
#import <React/RCTBridgeModule.h>
|
|
3
3
|
#import <RNZixflowSpec/RNZixflowSpec.h>
|
|
4
4
|
|
|
5
5
|
// Objective-C wrapper for new architecture TurboModule implementation
|
|
6
|
-
@interface
|
|
6
|
+
@interface RCTNativeZixflow : NSObject <NativeZixflowSpec>
|
|
7
7
|
// Bridge to Swift implementation for cross-language compatibility
|
|
8
|
-
@property(nonatomic, strong) id<
|
|
8
|
+
@property(nonatomic, strong) id<NativeZixflowSpec> swiftBridge;
|
|
9
9
|
@end
|
|
10
10
|
|
|
11
|
-
@implementation
|
|
11
|
+
@implementation RCTNativeZixflow
|
|
12
12
|
|
|
13
13
|
RCT_EXPORT_MODULE()
|
|
14
14
|
|
|
15
15
|
// Create TurboModule instance for new architecture JSI integration
|
|
16
16
|
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
|
|
17
17
|
(const facebook::react::ObjCTurboModule::InitParams &)params {
|
|
18
|
-
return std::make_shared<facebook::react::
|
|
18
|
+
return std::make_shared<facebook::react::NativeZixflowSpecJSI>(params);
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
// Validates Swift bridge is available before method calls
|
|
@@ -26,10 +26,10 @@ RCT_EXPORT_MODULE()
|
|
|
26
26
|
- (instancetype)init {
|
|
27
27
|
if (self = [super init]) {
|
|
28
28
|
// Use runtime class lookup to avoid import issues and circular dependencies
|
|
29
|
-
Class swiftClass = NSClassFromString(@"
|
|
30
|
-
RCT_ASSERT_NOT_NIL(swiftClass, @"
|
|
29
|
+
Class swiftClass = NSClassFromString(@"NativeZixflow");
|
|
30
|
+
RCT_ASSERT_NOT_NIL(swiftClass, @"NativeZixflow Swift class", @"during runtime lookup");
|
|
31
31
|
_swiftBridge = [[swiftClass alloc] init];
|
|
32
|
-
[self assertBridgeAvailable:@"creating
|
|
32
|
+
[self assertBridgeAvailable:@"creating NativeZixflow Swift instance"];
|
|
33
33
|
}
|
|
34
34
|
return self;
|
|
35
35
|
}
|
|
@@ -95,6 +95,6 @@ RCT_EXPORT_MODULE()
|
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
// Export class factory function for React Native component registration
|
|
98
|
-
Class<RCTBridgeModule>
|
|
98
|
+
Class<RCTBridgeModule> NativeZixflowCls(void) { return RCTNativeZixflow.class; }
|
|
99
99
|
|
|
100
100
|
@end
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
@objc(
|
|
7
|
-
public class
|
|
8
|
-
private let logger:
|
|
9
|
-
/// Checks whether the
|
|
1
|
+
import ZixflowAnalytics
|
|
2
|
+
import ZixflowDataPipelines
|
|
3
|
+
import ZixflowInternalCommon
|
|
4
|
+
import ZixflowMessagingInApp
|
|
5
|
+
|
|
6
|
+
@objc(NativeZixflow)
|
|
7
|
+
public class NativeZixflow: NSObject {
|
|
8
|
+
private let logger: ZixflowInternalCommon.Logger = DIGraphShared.shared.logger
|
|
9
|
+
/// Checks whether the Zixflow SDK has been initialized.
|
|
10
10
|
/// Returns `true` if the SDK has been successfully initialized, `false` otherwise.
|
|
11
|
-
private var isInitialized: Bool {
|
|
11
|
+
private var isInitialized: Bool { Zixflow.shared.implementation != nil }
|
|
12
12
|
|
|
13
|
-
/// Ensures that the
|
|
13
|
+
/// Ensures that the Zixflow SDK is initialized before performing operations.
|
|
14
14
|
/// Logs an error and returns false if the SDK is not initialized.
|
|
15
15
|
private func ensureInitialized() -> Bool {
|
|
16
16
|
guard isInitialized else {
|
|
17
|
-
logger.error("
|
|
17
|
+
logger.error("Zixflow SDK is not initialized. Please call initialize() first.")
|
|
18
18
|
return false
|
|
19
19
|
}
|
|
20
20
|
return true
|
|
@@ -29,7 +29,7 @@ public class NativeCustomerIO: NSObject {
|
|
|
29
29
|
) {
|
|
30
30
|
// Skip initialization if already initialized
|
|
31
31
|
if isInitialized {
|
|
32
|
-
logger.info("
|
|
32
|
+
logger.info("Zixflow SDK is already initialized. Skipping initialization.")
|
|
33
33
|
resolve(true)
|
|
34
34
|
return
|
|
35
35
|
}
|
|
@@ -41,14 +41,14 @@ public class NativeCustomerIO: NSObject {
|
|
|
41
41
|
// Override SDK client info to include wrapper metadata in user agent
|
|
42
42
|
if let source = packageSource, let sdkVersion = packageVersion {
|
|
43
43
|
DIGraphShared.shared.override(
|
|
44
|
-
value:
|
|
44
|
+
value: ZixflowSdkClient(source: source, sdkVersion: sdkVersion),
|
|
45
45
|
forType: SdkClient.self
|
|
46
46
|
)
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
let sdkConfigBuilder = try SDKConfigBuilder.create(from: config)
|
|
50
50
|
|
|
51
|
-
#if
|
|
51
|
+
#if ZIXFLOW_LOCATION_ENABLED
|
|
52
52
|
if let locationModule = NativeLocation.module(from: config) {
|
|
53
53
|
_ = sdkConfigBuilder.addModule(locationModule)
|
|
54
54
|
}
|
|
@@ -56,13 +56,13 @@ public class NativeCustomerIO: NSObject {
|
|
|
56
56
|
|
|
57
57
|
let builtConfig = sdkConfigBuilder.build()
|
|
58
58
|
|
|
59
|
-
// Only
|
|
59
|
+
// Only Zixflow.initialize must run on the main thread (e.g. for Location module).
|
|
60
60
|
DispatchQueue.main.async { [weak self] in
|
|
61
61
|
guard let self = self else {
|
|
62
|
-
reject(
|
|
62
|
+
reject(ZixflowConstants.zixflowTag, "Error initializing Zixflow SDK", nil)
|
|
63
63
|
return
|
|
64
64
|
}
|
|
65
|
-
|
|
65
|
+
Zixflow.initialize(withConfig: builtConfig)
|
|
66
66
|
|
|
67
67
|
do {
|
|
68
68
|
// Initialize in-app messaging if config provided
|
|
@@ -75,13 +75,13 @@ public class NativeCustomerIO: NSObject {
|
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
self.logger.debug(
|
|
78
|
-
"
|
|
78
|
+
"Zixflow SDK (\(packageSource ?? "") \(packageVersion ?? "")) initialized with config: \(config)"
|
|
79
79
|
)
|
|
80
80
|
resolve(true)
|
|
81
81
|
}
|
|
82
82
|
} catch {
|
|
83
|
-
logger.error("Initializing
|
|
84
|
-
reject(
|
|
83
|
+
logger.error("Initializing Zixflow SDK failed with error: \(error)")
|
|
84
|
+
reject(ZixflowConstants.zixflowTag, "Error initializing Zixflow SDK", nil)
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
|
|
@@ -94,11 +94,11 @@ public class NativeCustomerIO: NSObject {
|
|
|
94
94
|
|
|
95
95
|
if let userId = userId {
|
|
96
96
|
// Identify with userId and optional traits
|
|
97
|
-
|
|
97
|
+
Zixflow.shared.identify(userId: userId, traits: traits)
|
|
98
98
|
} else if traits != nil {
|
|
99
99
|
// Anonymous profile identification with traits only
|
|
100
100
|
if let traitsJson = try? JSON(traits as Any) {
|
|
101
|
-
|
|
101
|
+
Zixflow.shared.identify(traits: traitsJson)
|
|
102
102
|
} else {
|
|
103
103
|
logger.error("Unable to parse traits to JSON: \(String(describing: traits))")
|
|
104
104
|
}
|
|
@@ -110,37 +110,37 @@ public class NativeCustomerIO: NSObject {
|
|
|
110
110
|
@objc
|
|
111
111
|
func clearIdentify() {
|
|
112
112
|
guard ensureInitialized() else { return }
|
|
113
|
-
|
|
113
|
+
Zixflow.shared.clearIdentify()
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
@objc
|
|
117
117
|
func track(_ name: String, properties: [String: Any]?) {
|
|
118
118
|
guard ensureInitialized() else { return }
|
|
119
|
-
|
|
119
|
+
Zixflow.shared.track(name: name, properties: properties)
|
|
120
120
|
}
|
|
121
121
|
|
|
122
122
|
@objc
|
|
123
123
|
func screen(_ title: String, properties: [String: Any]?) {
|
|
124
124
|
guard ensureInitialized() else { return }
|
|
125
|
-
|
|
125
|
+
Zixflow.shared.screen(title: title, properties: properties)
|
|
126
126
|
}
|
|
127
127
|
|
|
128
128
|
@objc
|
|
129
129
|
func setProfileAttributes(_ attributes: [String: Any]) {
|
|
130
130
|
guard ensureInitialized() else { return }
|
|
131
|
-
|
|
131
|
+
Zixflow.shared.setProfileAttributes(attributes)
|
|
132
132
|
}
|
|
133
133
|
|
|
134
134
|
@objc
|
|
135
135
|
func setDeviceAttributes(_ attributes: [String: Any]) {
|
|
136
136
|
guard ensureInitialized() else { return }
|
|
137
|
-
|
|
137
|
+
Zixflow.shared.setDeviceAttributes(attributes)
|
|
138
138
|
}
|
|
139
139
|
|
|
140
140
|
@objc
|
|
141
141
|
func registerDeviceToken(_ token: String) {
|
|
142
142
|
guard ensureInitialized() else { return }
|
|
143
|
-
|
|
143
|
+
Zixflow.shared.registerDeviceToken(token)
|
|
144
144
|
}
|
|
145
145
|
|
|
146
146
|
@objc
|
|
@@ -151,12 +151,12 @@ public class NativeCustomerIO: NSObject {
|
|
|
151
151
|
return
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
-
|
|
154
|
+
Zixflow.shared.trackMetric(deliveryID: deliveryId, event: metricEvent, deviceToken: deviceToken)
|
|
155
155
|
}
|
|
156
156
|
|
|
157
157
|
@objc
|
|
158
158
|
func deleteDeviceToken() {
|
|
159
159
|
guard ensureInitialized() else { return }
|
|
160
|
-
|
|
160
|
+
Zixflow.shared.deleteDeviceToken()
|
|
161
161
|
}
|
|
162
162
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#import "../utils/
|
|
1
|
+
#import "../utils/RCTZixflowUtils.h"
|
|
2
2
|
#import <React/RCTBridgeModule.h>
|
|
3
3
|
#import <React/RCTEventEmitter.h>
|
|
4
4
|
#import <React/RCTInitializing.h>
|
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
#import <RNZixflowSpec/RNZixflowSpec.h>
|
|
7
7
|
|
|
8
8
|
// Protocol that extends the spec with setEventEmitter method
|
|
9
|
-
@protocol NativeMessagingInAppBridge <
|
|
9
|
+
@protocol NativeMessagingInAppBridge <NativeZixflowMessagingInAppSpec, RCTInitializing, RCTInvalidating>
|
|
10
10
|
- (void)setEventEmitter:(id)emitter;
|
|
11
11
|
@end
|
|
12
12
|
|
|
13
13
|
// Objective-C wrapper for new architecture TurboModule implementation
|
|
14
14
|
@interface RCTNativeMessagingInApp
|
|
15
|
-
:
|
|
15
|
+
: NativeZixflowMessagingInAppSpecBase <NativeZixflowMessagingInAppSpec>
|
|
16
16
|
// Bridge to Swift implementation for cross-language compatibility
|
|
17
17
|
@property(nonatomic, strong) id<NativeMessagingInAppBridge> swiftBridge;
|
|
18
18
|
@end
|
|
@@ -24,7 +24,7 @@ RCT_EXPORT_MODULE()
|
|
|
24
24
|
// Create TurboModule instance for new architecture JSI integration
|
|
25
25
|
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
|
|
26
26
|
(const facebook::react::ObjCTurboModule::InitParams &)params {
|
|
27
|
-
return std::make_shared<facebook::react::
|
|
27
|
+
return std::make_shared<facebook::react::NativeZixflowMessagingInAppSpecJSI>(params);
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
// Validates Swift bridge is available before method calls
|
|
@@ -35,10 +35,10 @@ RCT_EXPORT_MODULE()
|
|
|
35
35
|
- (instancetype)init {
|
|
36
36
|
if (self = [super init]) {
|
|
37
37
|
// Use runtime class lookup to avoid import issues and circular dependencies
|
|
38
|
-
Class swiftClass = NSClassFromString(@"
|
|
39
|
-
RCT_ASSERT_NOT_NIL(swiftClass, @"
|
|
38
|
+
Class swiftClass = NSClassFromString(@"NativeZixflowMessagingInApp");
|
|
39
|
+
RCT_ASSERT_NOT_NIL(swiftClass, @"NativeZixflowMessagingInApp Swift class", @"during runtime lookup");
|
|
40
40
|
_swiftBridge = [[swiftClass alloc] init];
|
|
41
|
-
[self assertBridgeAvailable:@"creating
|
|
41
|
+
[self assertBridgeAvailable:@"creating NativeZixflowMessagingInApp Swift instance"];
|
|
42
42
|
|
|
43
43
|
// Set event emitter reference for new architecture
|
|
44
44
|
[_swiftBridge setEventEmitter:self];
|
|
@@ -115,7 +115,7 @@ RCT_EXPORT_MODULE()
|
|
|
115
115
|
}
|
|
116
116
|
|
|
117
117
|
// Export class factory function for React Native component registration
|
|
118
|
-
Class<RCTBridgeModule>
|
|
118
|
+
Class<RCTBridgeModule> NativeZixflowMessagingInAppCls(void) {
|
|
119
119
|
return RCTNativeMessagingInApp.class;
|
|
120
120
|
}
|
|
121
121
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import ZixflowInternalCommon
|
|
2
|
+
import ZixflowMessagingInApp
|
|
3
3
|
import Foundation
|
|
4
4
|
import React
|
|
5
5
|
|
|
6
6
|
// In-app messaging module for new React Native architecture (TurboModule)
|
|
7
|
-
@objc(
|
|
7
|
+
@objc(NativeZixflowMessagingInApp)
|
|
8
8
|
public class NativeMessagingInApp: NSObject {
|
|
9
9
|
// Reference to the ObjC event emitter for new architecture (TurboModule)
|
|
10
10
|
private weak var objcEventEmitter: AnyObject?
|
|
@@ -12,7 +12,7 @@ public class NativeMessagingInApp: NSObject {
|
|
|
12
12
|
self?.sendEvent(body: body)
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
private let logger:
|
|
15
|
+
private let logger: ZixflowInternalCommon.Logger = DIGraphShared.shared.logger
|
|
16
16
|
|
|
17
17
|
// Task that consumes the inbox messages stream
|
|
18
18
|
private var messagesStreamTask: Task<Void, Never>?
|
|
@@ -41,7 +41,7 @@ public class NativeMessagingInApp: NSObject {
|
|
|
41
41
|
|
|
42
42
|
// Note: Inbox change listener is set up lazily when inbox is first accessed via
|
|
43
43
|
// setupInboxListener(), not here. Notification Inbox becomes available only after
|
|
44
|
-
//
|
|
44
|
+
// Zixflow.initialize() is called, which may not have happened yet at this point.
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
// Clear in-app event listener to prevent memory leaks - called by React Native
|
|
@@ -70,7 +70,7 @@ public class NativeMessagingInApp: NSObject {
|
|
|
70
70
|
guard let inbox = requireInboxInstance() else {
|
|
71
71
|
reject(
|
|
72
72
|
"INBOX_NOT_AVAILABLE",
|
|
73
|
-
"Notification Inbox is not available. Ensure
|
|
73
|
+
"Notification Inbox is not available. Ensure Zixflow SDK is initialized.",
|
|
74
74
|
nil
|
|
75
75
|
)
|
|
76
76
|
return
|
|
@@ -123,7 +123,7 @@ public class NativeMessagingInApp: NSObject {
|
|
|
123
123
|
/// Note: Notification Inbox is only available after SDK is initialized
|
|
124
124
|
private func requireInboxInstance() -> NotificationInbox? {
|
|
125
125
|
guard MessagingInApp.shared.implementation != nil else {
|
|
126
|
-
logger.error("Notification Inbox is not available. Ensure
|
|
126
|
+
logger.error("Notification Inbox is not available. Ensure Zixflow SDK is initialized.")
|
|
127
127
|
return nil
|
|
128
128
|
}
|
|
129
129
|
return MessagingInApp.shared.inbox
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import ZixflowInternalCommon
|
|
2
|
+
import ZixflowMessagingInApp
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* React Native bridge for
|
|
5
|
+
* React Native bridge for Zixflow in-app messaging events.
|
|
6
6
|
* Converts native SDK events to JavaScript compatible format.
|
|
7
7
|
*/
|
|
8
8
|
public class ReactInAppEventListener: InAppEventListener {
|
|
@@ -36,36 +36,36 @@ public class ReactInAppEventListener: InAppEventListener {
|
|
|
36
36
|
actionName: String? = nil
|
|
37
37
|
) {
|
|
38
38
|
var data: [String: Any?] = [
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
ZixflowConstants.eventType: eventType,
|
|
40
|
+
ZixflowConstants.messageId: message.messageId,
|
|
41
|
+
ZixflowConstants.deliveryId: message.deliveryId
|
|
42
42
|
]
|
|
43
43
|
|
|
44
44
|
if let actionValue = actionValue {
|
|
45
|
-
data[
|
|
45
|
+
data[ZixflowConstants.actionValue] = actionValue
|
|
46
46
|
}
|
|
47
47
|
if let actionName = actionName {
|
|
48
|
-
data[
|
|
48
|
+
data[ZixflowConstants.actionName] = actionName
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
eventEmitter?(data)
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
public func messageShown(message: InAppMessage) {
|
|
55
|
-
emitInAppEvent(eventType:
|
|
55
|
+
emitInAppEvent(eventType: ZixflowConstants.messageShown, message: message)
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
public func messageDismissed(message: InAppMessage) {
|
|
59
|
-
emitInAppEvent(eventType:
|
|
59
|
+
emitInAppEvent(eventType: ZixflowConstants.messageDismissed, message: message)
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
public func errorWithMessage(message: InAppMessage) {
|
|
63
|
-
emitInAppEvent(eventType:
|
|
63
|
+
emitInAppEvent(eventType: ZixflowConstants.errorWithMessage, message: message)
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
public func messageActionTaken(message: InAppMessage, actionValue: String, actionName: String) {
|
|
67
67
|
emitInAppEvent(
|
|
68
|
-
eventType:
|
|
68
|
+
eventType: ZixflowConstants.messageActionTaken,
|
|
69
69
|
message: message,
|
|
70
70
|
actionValue: actionValue,
|
|
71
71
|
actionName: actionName
|
|
@@ -2,25 +2,25 @@
|
|
|
2
2
|
#import <RNZixflowSpec/RNZixflowSpec.h>
|
|
3
3
|
|
|
4
4
|
// Objective-C wrapper for new architecture TurboModule implementation
|
|
5
|
-
@interface
|
|
5
|
+
@interface RCTNativeZixflowLocation : NSObject <NativeZixflowLocationSpec>
|
|
6
6
|
// Bridge to Swift implementation for cross-language compatibility
|
|
7
|
-
@property(nonatomic, strong) id<
|
|
7
|
+
@property(nonatomic, strong) id<NativeZixflowLocationSpec> swiftBridge;
|
|
8
8
|
@end
|
|
9
9
|
|
|
10
|
-
@implementation
|
|
10
|
+
@implementation RCTNativeZixflowLocation
|
|
11
11
|
|
|
12
12
|
RCT_EXPORT_MODULE()
|
|
13
13
|
|
|
14
14
|
// Create TurboModule instance for new architecture JSI integration
|
|
15
15
|
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
|
|
16
16
|
(const facebook::react::ObjCTurboModule::InitParams &)params {
|
|
17
|
-
return std::make_shared<facebook::react::
|
|
17
|
+
return std::make_shared<facebook::react::NativeZixflowLocationSpecJSI>(params);
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
- (instancetype)init {
|
|
21
21
|
if (self = [super init]) {
|
|
22
|
-
// Use runtime class lookup - NativeLocation class only exists when
|
|
23
|
-
Class swiftClass = NSClassFromString(@"
|
|
22
|
+
// Use runtime class lookup - NativeLocation class only exists when ZixflowLocation subspec is installed
|
|
23
|
+
Class swiftClass = NSClassFromString(@"NativeZixflowLocation");
|
|
24
24
|
if (swiftClass) {
|
|
25
25
|
_swiftBridge = [[swiftClass alloc] init];
|
|
26
26
|
}
|
|
@@ -45,8 +45,8 @@ RCT_EXPORT_MODULE()
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
// Export class factory function for React Native component registration
|
|
48
|
-
Class<RCTBridgeModule>
|
|
49
|
-
return
|
|
48
|
+
Class<RCTBridgeModule> NativeZixflowLocationCls(void) {
|
|
49
|
+
return RCTNativeZixflowLocation.class;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
@end
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
#if
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
#if ZIXFLOW_LOCATION_ENABLED
|
|
2
|
+
import ZixflowDataPipelines
|
|
3
|
+
import ZixflowLocation
|
|
4
4
|
import CoreLocation
|
|
5
5
|
|
|
6
|
-
@objc(
|
|
6
|
+
@objc(NativeZixflowLocation)
|
|
7
7
|
public class NativeLocation: NSObject {
|
|
8
8
|
|
|
9
9
|
/// Parses the root config and returns a `LocationModule` if location config is present.
|
|
@@ -26,12 +26,12 @@ public class NativeLocation: NSObject {
|
|
|
26
26
|
@objc
|
|
27
27
|
func setLastKnownLocation(_ latitude: Double, longitude: Double) {
|
|
28
28
|
let location = CLLocation(latitude: latitude, longitude: longitude)
|
|
29
|
-
|
|
29
|
+
Zixflow.location.setLastKnownLocation(location)
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
@objc
|
|
33
33
|
func requestLocationUpdate() {
|
|
34
|
-
|
|
34
|
+
Zixflow.location.requestLocationUpdate()
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
#endif
|