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,14 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Zixflow SDK - Main entry point
|
|
3
3
|
*
|
|
4
|
-
* This provides the Zixflow-branded API
|
|
4
|
+
* This provides the Zixflow-branded API.
|
|
5
5
|
*/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export declare const Zixflow: typeof CustomerIO;
|
|
6
|
+
export { Zixflow } from './zixflow-cdp';
|
|
7
|
+
export { ZixflowInAppMessaging } from './zixflow-inapp';
|
|
8
|
+
export { ZixflowLocation } from './zixflow-location';
|
|
9
|
+
export { ZixflowPushMessaging } from './zixflow-push';
|
|
11
10
|
export * from './types';
|
|
12
11
|
export * from './notification-inbox';
|
|
13
|
-
export { CustomerIOInAppMessaging, CustomerIOLocation, CustomerIOPushMessaging, };
|
|
14
12
|
//# sourceMappingURL=zixflow.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zixflow.d.ts","sourceRoot":"","sources":["../../../src/zixflow.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"zixflow.d.ts","sourceRoot":"","sources":["../../../src/zixflow.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAGtD,cAAc,SAAS,CAAC;AACxB,cAAc,sBAAsB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zixflow-reactnative",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "Official Zixflow SDK for React Native. Customer engagement platform built on proven
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"description": "Official Zixflow SDK for React Native. Customer engagement platform built on proven Zixflow technology. Track customers and send messages to your iOS/Android apps.",
|
|
5
5
|
"source": "./src/index.ts",
|
|
6
6
|
"main": "./lib/commonjs/index.js",
|
|
7
7
|
"module": "./lib/module/index.js",
|
|
@@ -19,10 +19,8 @@
|
|
|
19
19
|
},
|
|
20
20
|
"./package.json": "./package.json"
|
|
21
21
|
},
|
|
22
|
-
"zixflowNativeiOSSdkVersion": "= 1.
|
|
23
|
-
"zixflowNativeAndroidSdkVersion": "1.
|
|
24
|
-
"cioNativeiOSSdkVersion": "~> 3.10",
|
|
25
|
-
"cioiOSFirebaseWrapperSdkVersion": "~> 1.0",
|
|
22
|
+
"zixflowNativeiOSSdkVersion": "= 1.1.2",
|
|
23
|
+
"zixflowNativeAndroidSdkVersion": "1.1.1",
|
|
26
24
|
"files": [
|
|
27
25
|
"src",
|
|
28
26
|
"lib",
|
|
@@ -77,6 +75,7 @@
|
|
|
77
75
|
"@react-native-community/cli": "^20.0.0",
|
|
78
76
|
"@react-native/babel-preset": "^0.83.0",
|
|
79
77
|
"@react-native/eslint-config": "^0.83.0",
|
|
78
|
+
"@react-native/metro-config": "^0.86.0",
|
|
80
79
|
"@react-native/typescript-config": "^0.83.0",
|
|
81
80
|
"@types/react": "^19.2.0",
|
|
82
81
|
"@typescript-eslint/eslint-plugin": "^8.31.1",
|
|
@@ -147,18 +146,18 @@
|
|
|
147
146
|
"type": "all",
|
|
148
147
|
"jsSrcsDir": "./src/specs",
|
|
149
148
|
"android": {
|
|
150
|
-
"javaPackageName": "
|
|
149
|
+
"javaPackageName": "com.zixflow.reactnative.sdk"
|
|
151
150
|
},
|
|
152
151
|
"ios": {
|
|
153
152
|
"componentProvider": {
|
|
154
153
|
"InlineMessageNative": "RCTInlineMessageNative"
|
|
155
154
|
},
|
|
156
155
|
"modulesProvider": {
|
|
157
|
-
"
|
|
158
|
-
"
|
|
159
|
-
"
|
|
160
|
-
"
|
|
161
|
-
"
|
|
156
|
+
"NativeZixflowLogging": "RCTNativeZixflowLogging",
|
|
157
|
+
"NativeZixflow": "RCTNativeZixflow",
|
|
158
|
+
"NativeZixflowLocation": "RCTNativeZixflowLocation",
|
|
159
|
+
"NativeZixflowMessagingInApp": "RCTNativeMessagingInApp",
|
|
160
|
+
"NativeZixflowMessagingPush": "RCTNativeMessagingPush"
|
|
162
161
|
}
|
|
163
162
|
}
|
|
164
163
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file serves as the entry point for the module zixflow-reactnative.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Zixflow React Native SDK - A powerful SDK for building
|
|
5
|
+
* customer engagement features in React Native applications.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
// Export
|
|
8
|
+
// Export the Zixflow API
|
|
9
9
|
export * from './zixflow';
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import NativeZixflowLogging from './specs/modules/NativeZixflowLogging';
|
|
2
|
+
import { ZixflowLogLevel } from './types';
|
|
3
3
|
import { callNativeModule, ensureNativeModule } from './utils/native-bridge';
|
|
4
4
|
|
|
5
|
-
// Reference to the native
|
|
6
|
-
const nativeModule = ensureNativeModule(
|
|
5
|
+
// Reference to the native Zixflow logging module for SDK operations
|
|
6
|
+
const nativeModule = ensureNativeModule(NativeZixflowLogging);
|
|
7
7
|
|
|
8
8
|
// Wrapper function that ensures SDK is initialized before calling native methods
|
|
9
9
|
const withNativeModule = <R>(
|
|
10
|
-
fn: (native: typeof
|
|
10
|
+
fn: (native: typeof NativeZixflowLogging) => R
|
|
11
11
|
): R => {
|
|
12
12
|
return callNativeModule(nativeModule, fn);
|
|
13
13
|
};
|
|
@@ -15,8 +15,8 @@ const withNativeModule = <R>(
|
|
|
15
15
|
/* @internal */
|
|
16
16
|
export class NativeLoggerListener {
|
|
17
17
|
private static isInitialized = false;
|
|
18
|
-
// Prefix for all
|
|
19
|
-
private static loggerPrefix = '[
|
|
18
|
+
// Prefix for all Zixflow log messages
|
|
19
|
+
private static loggerPrefix = '[Zixflow] ';
|
|
20
20
|
|
|
21
21
|
static async initialize(): Promise<void> {
|
|
22
22
|
// Prevent multiple registrations of the same log listener
|
|
@@ -29,17 +29,17 @@ export class NativeLoggerListener {
|
|
|
29
29
|
// By doing it asynchronously, we ensure the logs are captured on both
|
|
30
30
|
// the JavaScript and native ends.
|
|
31
31
|
const logEvent = async (event: {
|
|
32
|
-
logLevel:
|
|
32
|
+
logLevel: ZixflowLogLevel;
|
|
33
33
|
message: string;
|
|
34
34
|
}) => {
|
|
35
35
|
switch (event.logLevel) {
|
|
36
|
-
case
|
|
36
|
+
case ZixflowLogLevel.Debug:
|
|
37
37
|
console.debug(this.loggerPrefix + event.message);
|
|
38
38
|
break;
|
|
39
|
-
case
|
|
39
|
+
case ZixflowLogLevel.Info:
|
|
40
40
|
console.info(this.loggerPrefix + event.message);
|
|
41
41
|
break;
|
|
42
|
-
case
|
|
42
|
+
case ZixflowLogLevel.Error:
|
|
43
43
|
console.error(this.loggerPrefix + event.message);
|
|
44
44
|
break;
|
|
45
45
|
default:
|
|
@@ -49,7 +49,7 @@ export class NativeLoggerListener {
|
|
|
49
49
|
};
|
|
50
50
|
|
|
51
51
|
const logHandler = (data: any) => {
|
|
52
|
-
const event = data as { logLevel:
|
|
52
|
+
const event = data as { logLevel: ZixflowLogLevel; message: string };
|
|
53
53
|
logEvent(event);
|
|
54
54
|
};
|
|
55
55
|
|
|
@@ -58,7 +58,7 @@ export class NativeLoggerListener {
|
|
|
58
58
|
// Register TurboModule event listener and return subscription.
|
|
59
59
|
// This method is generated by codegen in the native modules.
|
|
60
60
|
// Wrapped in try-catch due to previous reports of crashes on certain Android architectures.
|
|
61
|
-
native.
|
|
61
|
+
native.onZixflowLogEvent(logHandler);
|
|
62
62
|
} catch (error) {
|
|
63
63
|
NativeLoggerListener.warn('Failed to attach log listener:', error);
|
|
64
64
|
}
|
|
@@ -66,7 +66,7 @@ export class NativeLoggerListener {
|
|
|
66
66
|
this.isInitialized = true;
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
// Logs warning messages in development mode only, with
|
|
69
|
+
// Logs warning messages in development mode only, with Zixflow prefix
|
|
70
70
|
static warn(message: string, error?: unknown) {
|
|
71
71
|
if (__DEV__) {
|
|
72
72
|
console.warn(this.loggerPrefix + message, error);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { type EventSubscription } from 'react-native';
|
|
2
2
|
import { NativeLoggerListener } from './native-logger-listener';
|
|
3
|
-
import type { Spec as CodegenSpec } from './specs/modules/
|
|
4
|
-
import
|
|
3
|
+
import type { Spec as CodegenSpec } from './specs/modules/NativeZixflowMessagingInApp';
|
|
4
|
+
import NativeZixflowMessagingInApp from './specs/modules/NativeZixflowMessagingInApp';
|
|
5
5
|
import type { InboxMessage, NotificationInboxChangeListener } from './types';
|
|
6
6
|
import { callNativeModule, ensureNativeModule } from './utils/native-bridge';
|
|
7
7
|
|
|
8
|
-
// Reference to the native
|
|
9
|
-
const nativeModule = ensureNativeModule(
|
|
8
|
+
// Reference to the native Zixflow In-App Messaging module
|
|
9
|
+
const nativeModule = ensureNativeModule(NativeZixflowMessagingInApp);
|
|
10
10
|
|
|
11
11
|
// Wrapper function that ensures SDK is initialized before calling native methods
|
|
12
12
|
const withNativeModule = <R>(fn: (native: CodegenSpec) => R): R => {
|
|
@@ -32,7 +32,7 @@ interface NotificationInboxPublicSpec {
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
/**
|
|
35
|
-
* Native inbox methods from CodegenSpec that should be excluded from
|
|
35
|
+
* Native inbox methods from CodegenSpec that should be excluded from ZixflowInAppMessaging.
|
|
36
36
|
* Includes both public methods (in NotificationInboxPublicSpec) and internal methods.
|
|
37
37
|
*
|
|
38
38
|
* @internal
|
package/src/postInstall.js
CHANGED
|
@@ -2,9 +2,9 @@ import { TurboModuleRegistry, type TurboModule } from 'react-native';
|
|
|
2
2
|
import type { UnsafeObject } from 'react-native/Libraries/Types/CodegenTypes';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* Native module specification for
|
|
5
|
+
* Native module specification for Zixflow React Native SDK
|
|
6
6
|
*
|
|
7
|
-
* This module defines the TurboModule interface for
|
|
7
|
+
* This module defines the TurboModule interface for Zixflow SDK native bridge.
|
|
8
8
|
* Types use basic primitives for React Native Codegen compatibility, while the public
|
|
9
9
|
* API layer provides more specific TypeScript types for better developer experience.
|
|
10
10
|
*
|
|
@@ -21,7 +21,7 @@ import type { UnsafeObject } from 'react-native/Libraries/Types/CodegenTypes';
|
|
|
21
21
|
*
|
|
22
22
|
* Used for all complex data structures passed to native methods to ensure
|
|
23
23
|
* React Native Codegen compatibility. The public API layer converts these
|
|
24
|
-
* to proper TypeScript types (CustomAttributes,
|
|
24
|
+
* to proper TypeScript types (CustomAttributes, ZixflowConfig, etc.) for
|
|
25
25
|
* better type safety and developer experience.
|
|
26
26
|
*
|
|
27
27
|
* @internal - Not exported to avoid conflicts with public API types
|
|
@@ -33,7 +33,7 @@ type NativeBridgeObject = UnsafeObject;
|
|
|
33
33
|
// =============================================================================
|
|
34
34
|
|
|
35
35
|
/**
|
|
36
|
-
* TurboModule specification for
|
|
36
|
+
* TurboModule specification for Zixflow SDK native bridge methods.
|
|
37
37
|
* Uses generic Object types for React Native Codegen compatibility.
|
|
38
38
|
*/
|
|
39
39
|
export interface Spec extends TurboModule {
|
|
@@ -52,4 +52,4 @@ export interface Spec extends TurboModule {
|
|
|
52
52
|
deleteDeviceToken(): void;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
export default TurboModuleRegistry.getEnforcing<Spec>('
|
|
55
|
+
export default TurboModuleRegistry.getEnforcing<Spec>('NativeZixflow');
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { TurboModuleRegistry, type TurboModule } from 'react-native';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* Native module specification for
|
|
4
|
+
* Native module specification for Zixflow Location React Native SDK
|
|
5
5
|
*
|
|
6
|
-
* @see
|
|
6
|
+
* @see NativeZixflow.ts for detailed documentation on TurboModule patterns,
|
|
7
7
|
* Codegen compatibility, and type safety approach.
|
|
8
8
|
*/
|
|
9
9
|
|
|
@@ -12,4 +12,4 @@ export interface Spec extends TurboModule {
|
|
|
12
12
|
requestLocationUpdate(): void;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
export default TurboModuleRegistry.get<Spec>('
|
|
15
|
+
export default TurboModuleRegistry.get<Spec>('NativeZixflowLocation');
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { TurboModuleRegistry, type TurboModule } from 'react-native';
|
|
2
|
+
import type {
|
|
3
|
+
EventEmitter,
|
|
4
|
+
UnsafeObject,
|
|
5
|
+
} from 'react-native/Libraries/Types/CodegenTypes';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Native module specification for Zixflow Logging React Native SDK
|
|
9
|
+
*
|
|
10
|
+
* This module defines the TurboModule interface for Zixflow logging bridge.
|
|
11
|
+
* Used internally for printing logs to React Native environment instead of native.
|
|
12
|
+
*
|
|
13
|
+
* @see NativeZixflow.ts for detailed documentation on TurboModule patterns,
|
|
14
|
+
* Codegen compatibility, and type safety approach.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/** TurboModule interface for Zixflow logging native operations */
|
|
18
|
+
export interface Spec extends TurboModule {
|
|
19
|
+
readonly onZixflowLogEvent: EventEmitter<UnsafeObject>;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export default TurboModuleRegistry.getEnforcing<Spec>('NativeZixflowLogging');
|
package/src/specs/modules/{NativeCustomerIOMessagingInApp.ts → NativeZixflowMessagingInApp.ts}
RENAMED
|
@@ -5,13 +5,13 @@ import type {
|
|
|
5
5
|
} from 'react-native/Libraries/Types/CodegenTypes';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
* Native module specification for
|
|
8
|
+
* Native module specification for Zixflow In-App Messaging React Native SDK
|
|
9
9
|
*
|
|
10
|
-
* @see
|
|
10
|
+
* @see NativeZixflow.ts for detailed documentation on TurboModule patterns,
|
|
11
11
|
* Codegen compatibility, and type safety approach.
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
|
-
/** TurboModule interface for
|
|
14
|
+
/** TurboModule interface for Zixflow In-App Messaging native operations */
|
|
15
15
|
export interface Spec extends TurboModule {
|
|
16
16
|
dismissMessage(): void;
|
|
17
17
|
readonly onInAppEventReceived: EventEmitter<UnsafeObject>;
|
|
@@ -26,5 +26,5 @@ export interface Spec extends TurboModule {
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
export default TurboModuleRegistry.getEnforcing<Spec>(
|
|
29
|
-
'
|
|
29
|
+
'NativeZixflowMessagingInApp'
|
|
30
30
|
);
|
package/src/specs/modules/{NativeCustomerIOMessagingPush.ts → NativeZixflowMessagingPush.ts}
RENAMED
|
@@ -2,9 +2,9 @@ import { TurboModuleRegistry, type TurboModule } from 'react-native';
|
|
|
2
2
|
import type { UnsafeObject } from 'react-native/Libraries/Types/CodegenTypes';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* Native module specification for
|
|
5
|
+
* Native module specification for Zixflow Push Messaging React Native SDK
|
|
6
6
|
*
|
|
7
|
-
* @see
|
|
7
|
+
* @see NativeZixflow.ts for detailed documentation on TurboModule patterns,
|
|
8
8
|
* Codegen compatibility, and type safety approach.
|
|
9
9
|
*/
|
|
10
10
|
|
|
@@ -23,5 +23,5 @@ export interface Spec extends TurboModule {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
export default TurboModuleRegistry.getEnforcing<Spec>(
|
|
26
|
-
'
|
|
26
|
+
'NativeZixflowMessagingPush'
|
|
27
27
|
);
|
|
@@ -3,7 +3,7 @@ import type { PushClickBehaviorAndroid } from './push';
|
|
|
3
3
|
/**
|
|
4
4
|
* Key-value pairs for custom user attributes and event properties.
|
|
5
5
|
*
|
|
6
|
-
* Provides a type-safe interface for passing custom data to
|
|
6
|
+
* Provides a type-safe interface for passing custom data to Zixflow.
|
|
7
7
|
* While the native bridge uses generic Object types for Codegen compatibility,
|
|
8
8
|
* this type gives developers better TypeScript intellisense and validation.
|
|
9
9
|
*
|
|
@@ -21,7 +21,7 @@ import type { PushClickBehaviorAndroid } from './push';
|
|
|
21
21
|
export type CustomAttributes = Record<string, any>;
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
|
-
* Parameters for identifying a user in
|
|
24
|
+
* Parameters for identifying a user in Zixflow.
|
|
25
25
|
*
|
|
26
26
|
* @param userId - Unique identifier for the user (email, username, etc.)
|
|
27
27
|
* @param traits - Additional user attributes and properties
|
|
@@ -34,9 +34,9 @@ export interface IdentifyParams {
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
|
-
* Configuration options for initializing the
|
|
37
|
+
* Configuration options for initializing the Zixflow SDK.
|
|
38
38
|
*
|
|
39
|
-
* @param cdpApiKey - Customer Data Platform API key from
|
|
39
|
+
* @param cdpApiKey - Customer Data Platform API key from Zixflow dashboard
|
|
40
40
|
* @param migrationSiteId - Legacy site ID for migrating from tracking API
|
|
41
41
|
* @param region - Data center region (US or EU)
|
|
42
42
|
* @param logLevel - SDK logging verbosity level
|
|
@@ -52,11 +52,11 @@ export interface IdentifyParams {
|
|
|
52
52
|
*
|
|
53
53
|
* @public
|
|
54
54
|
*/
|
|
55
|
-
export type
|
|
55
|
+
export type ZixflowConfig = {
|
|
56
56
|
cdpApiKey: string;
|
|
57
57
|
migrationSiteId?: string;
|
|
58
|
-
region?:
|
|
59
|
-
logLevel?:
|
|
58
|
+
region?: ZixflowRegion;
|
|
59
|
+
logLevel?: ZixflowLogLevel;
|
|
60
60
|
apiHost?: string;
|
|
61
61
|
cdnHost?: string;
|
|
62
62
|
flushAt?: number;
|
|
@@ -74,18 +74,18 @@ export type CioConfig = {
|
|
|
74
74
|
};
|
|
75
75
|
location?: {
|
|
76
76
|
/** Location tracking mode. Defaults to 'manual' if location config is provided. */
|
|
77
|
-
trackingMode?:
|
|
77
|
+
trackingMode?: ZixflowLocationTrackingMode;
|
|
78
78
|
};
|
|
79
79
|
};
|
|
80
80
|
|
|
81
81
|
/**
|
|
82
|
-
* Log levels for
|
|
82
|
+
* Log levels for Zixflow SDK debugging and monitoring.
|
|
83
83
|
*
|
|
84
84
|
* Controls the verbosity of SDK logging output for debugging purposes.
|
|
85
85
|
*
|
|
86
86
|
* @public
|
|
87
87
|
*/
|
|
88
|
-
export enum
|
|
88
|
+
export enum ZixflowLogLevel {
|
|
89
89
|
/** No logging output */
|
|
90
90
|
None = 'none',
|
|
91
91
|
/** Only error messages */
|
|
@@ -97,11 +97,11 @@ export enum CioLogLevel {
|
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
/**
|
|
100
|
-
* Data center regions for
|
|
100
|
+
* Data center regions for Zixflow API endpoints.
|
|
101
101
|
*
|
|
102
102
|
* @public
|
|
103
103
|
*/
|
|
104
|
-
export enum
|
|
104
|
+
export enum ZixflowRegion {
|
|
105
105
|
US = 'US',
|
|
106
106
|
EU = 'EU',
|
|
107
107
|
}
|
|
@@ -122,11 +122,11 @@ export enum ScreenView {
|
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
/**
|
|
125
|
-
* Location tracking mode for the
|
|
125
|
+
* Location tracking mode for the Zixflow Location module.
|
|
126
126
|
*
|
|
127
127
|
* @public
|
|
128
128
|
*/
|
|
129
|
-
export enum
|
|
129
|
+
export enum ZixflowLocationTrackingMode {
|
|
130
130
|
/** Location tracking is disabled. All location operations no-op. */
|
|
131
131
|
Off = 'OFF',
|
|
132
132
|
/** Host app controls when location is captured (default when location config is provided). */
|
package/src/types/internal.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Internal-only types used within the
|
|
2
|
+
* Internal-only types used within the Zixflow React Native SDK implementation.
|
|
3
3
|
*
|
|
4
4
|
* Not intended for public use.
|
|
5
5
|
*/
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* Arguments passed to native SDK for package identification.
|
|
9
9
|
*
|
|
10
10
|
* Provides metadata about the host environment and SDK version to native
|
|
11
|
-
*
|
|
11
|
+
* Zixflow SDK for debugging and analytics.
|
|
12
12
|
*
|
|
13
13
|
* @internal
|
|
14
14
|
*/
|
package/src/types/push.ts
CHANGED
|
@@ -23,7 +23,7 @@ export enum PushClickBehaviorAndroid {
|
|
|
23
23
|
*
|
|
24
24
|
* @public
|
|
25
25
|
*/
|
|
26
|
-
export type
|
|
26
|
+
export type ZixflowPushPermissionOptions = {
|
|
27
27
|
ios?: {
|
|
28
28
|
/** Request permission to show badge numbers on app icon */
|
|
29
29
|
badge: boolean;
|
|
@@ -40,7 +40,7 @@ export type CioPushPermissionOptions = {
|
|
|
40
40
|
*
|
|
41
41
|
* @public
|
|
42
42
|
*/
|
|
43
|
-
export enum
|
|
43
|
+
export enum ZixflowPushPermissionStatus {
|
|
44
44
|
/** User has granted push notification permissions */
|
|
45
45
|
Granted = 'GRANTED',
|
|
46
46
|
/** User has denied push notification permissions */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Platform } from 'react-native';
|
|
2
2
|
|
|
3
3
|
const LINKING_ERROR =
|
|
4
|
-
`The package '
|
|
4
|
+
`The package 'zixflow-reactnative' doesn't seem to be linked. Make sure: \n\n` +
|
|
5
5
|
Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
|
|
6
6
|
'- You rebuilt the app after installing the package\n' +
|
|
7
7
|
'- You are not using Expo managed workflow\n';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Argument validation utilities for SDK internal use
|
|
2
2
|
// Ensures input safety and throws clear errors when validation fails
|
|
3
3
|
|
|
4
|
-
import type {
|
|
4
|
+
import type { ZixflowConfig, CustomAttributes } from '../types';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Builds a standardized error message for validation failures.
|
|
@@ -28,7 +28,7 @@ function isUndefined(value: unknown): boolean {
|
|
|
28
28
|
*/
|
|
29
29
|
function failIf(condition: boolean, message: () => string): void {
|
|
30
30
|
if (__DEV__ && condition) {
|
|
31
|
-
throw new Error(`[
|
|
31
|
+
throw new Error(`[Zixflow] ${message()}`);
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
|
|
@@ -138,28 +138,28 @@ function validateAttributes(
|
|
|
138
138
|
}
|
|
139
139
|
|
|
140
140
|
/**
|
|
141
|
-
* Validates that the given value is a valid
|
|
141
|
+
* Validates that the given value is a valid ZixflowConfig object.
|
|
142
142
|
* Throws if required fields are missing or incorrectly typed.
|
|
143
143
|
*/
|
|
144
|
-
function validateConfig(value: unknown): asserts value is
|
|
144
|
+
function validateConfig(value: unknown): asserts value is ZixflowConfig {
|
|
145
145
|
const fieldName = 'config';
|
|
146
146
|
const usage = 'SDK';
|
|
147
147
|
|
|
148
148
|
validateRecord(value, fieldName, {
|
|
149
|
-
expectedType: '
|
|
149
|
+
expectedType: 'ZixflowConfig',
|
|
150
150
|
usage: usage,
|
|
151
151
|
});
|
|
152
152
|
|
|
153
|
-
const obj = value as
|
|
153
|
+
const obj = value as ZixflowConfig;
|
|
154
154
|
validateString(obj.cdpApiKey, `${fieldName}.cdpApiKey`, {
|
|
155
155
|
allowEmpty: false,
|
|
156
156
|
usage: usage,
|
|
157
157
|
});
|
|
158
158
|
}
|
|
159
159
|
|
|
160
|
-
// For type safety, we define a ConfigValidator type that asserts the value is a
|
|
160
|
+
// For type safety, we define a ConfigValidator type that asserts the value is a ZixflowConfig
|
|
161
161
|
// This allows us to use it in the assert object without needing to redefine the function signature
|
|
162
|
-
type ConfigValidator = (value: unknown) => asserts value is
|
|
162
|
+
type ConfigValidator = (value: unknown) => asserts value is ZixflowConfig;
|
|
163
163
|
|
|
164
164
|
export const assert: {
|
|
165
165
|
string: typeof validateString;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { ZixflowInAppMessaging } from './zixflow-inapp';
|
|
2
|
+
import { ZixflowLocation } from './zixflow-location';
|
|
3
|
+
import { ZixflowPushMessaging } from './zixflow-push';
|
|
4
4
|
import { NativeLoggerListener } from './native-logger-listener';
|
|
5
5
|
import {
|
|
6
6
|
default as NativeModule,
|
|
7
7
|
type Spec as CodegenSpec,
|
|
8
|
-
} from './specs/modules/
|
|
8
|
+
} from './specs/modules/NativeZixflow';
|
|
9
9
|
import {
|
|
10
|
-
|
|
10
|
+
ZixflowLogLevel,
|
|
11
11
|
MetricEvent,
|
|
12
|
-
type
|
|
12
|
+
type ZixflowConfig,
|
|
13
13
|
type CustomAttributes,
|
|
14
14
|
type IdentifyParams,
|
|
15
15
|
} from './types';
|
|
@@ -19,10 +19,10 @@ import { assert, validate } from './utils/param-validation';
|
|
|
19
19
|
|
|
20
20
|
const packageJson = require('../../package.json');
|
|
21
21
|
|
|
22
|
-
// Track whether
|
|
22
|
+
// Track whether Zixflow SDK has been initialized to prevent usage before setup
|
|
23
23
|
let _initialized = false;
|
|
24
24
|
|
|
25
|
-
// Reference to the native
|
|
25
|
+
// Reference to the native Zixflow Data Pipelines module for SDK operations
|
|
26
26
|
const nativeModule = ensureNativeModule(NativeModule);
|
|
27
27
|
|
|
28
28
|
// Wrapper function that ensures SDK is initialized before calling native methods
|
|
@@ -31,12 +31,12 @@ const withNativeModule = <R>(fn: (native: CodegenSpec) => R): R => {
|
|
|
31
31
|
};
|
|
32
32
|
|
|
33
33
|
/** @public */
|
|
34
|
-
export class
|
|
35
|
-
/** Initialize the
|
|
36
|
-
static readonly initialize = async (config:
|
|
34
|
+
export class Zixflow {
|
|
35
|
+
/** Initialize the Zixflow SDK with given configuration. */
|
|
36
|
+
static readonly initialize = async (config: ZixflowConfig) => {
|
|
37
37
|
assert.config(config);
|
|
38
38
|
|
|
39
|
-
if (config.logLevel && config.logLevel !==
|
|
39
|
+
if (config.logLevel && config.logLevel !== ZixflowLogLevel.None) {
|
|
40
40
|
NativeLoggerListener.initialize();
|
|
41
41
|
}
|
|
42
42
|
|
|
@@ -173,18 +173,18 @@ export class CustomerIO {
|
|
|
173
173
|
};
|
|
174
174
|
|
|
175
175
|
/**
|
|
176
|
-
* Check if the
|
|
176
|
+
* Check if the Zixflow SDK has been initialized.
|
|
177
177
|
* @deprecated This method will be removed in a future version. If you need this functionality, please contact us.
|
|
178
178
|
*/
|
|
179
179
|
static readonly isInitialized = () => _initialized;
|
|
180
180
|
|
|
181
|
-
static readonly inAppMessaging = new
|
|
182
|
-
static readonly location = new
|
|
183
|
-
static readonly pushMessaging = new
|
|
181
|
+
static readonly inAppMessaging = new ZixflowInAppMessaging();
|
|
182
|
+
static readonly location = new ZixflowLocation();
|
|
183
|
+
static readonly pushMessaging = new ZixflowPushMessaging();
|
|
184
184
|
}
|
|
185
185
|
|
|
186
186
|
// Initialize native logger when this module loads to ensure it's always available.
|
|
187
|
-
// Since
|
|
187
|
+
// Since this is the main SDK entry point and always imported,
|
|
188
188
|
// this guarantees logger initialization even when native-logger-listener.ts
|
|
189
189
|
// isn't directly accessed, also supporting auto-initialization in Expo apps.
|
|
190
190
|
NativeLoggerListener.initNativeLogger();
|
|
@@ -5,9 +5,9 @@ import {
|
|
|
5
5
|
NotificationInbox,
|
|
6
6
|
type NotificationInboxSpec,
|
|
7
7
|
} from './notification-inbox';
|
|
8
|
-
import
|
|
8
|
+
import NativeZixflowMessagingInApp, {
|
|
9
9
|
type Spec as CodegenSpec,
|
|
10
|
-
} from './specs/modules/
|
|
10
|
+
} from './specs/modules/NativeZixflowMessagingInApp';
|
|
11
11
|
import type { InAppMessageEventType } from './types';
|
|
12
12
|
import { callNativeModule, ensureNativeModule } from './utils/native-bridge';
|
|
13
13
|
|
|
@@ -21,8 +21,8 @@ interface NativeInAppSpec extends Omit<
|
|
|
21
21
|
keyof TurboModule | NotificationInboxSpec | 'onInAppEventReceived'
|
|
22
22
|
> {}
|
|
23
23
|
|
|
24
|
-
// Reference to the native
|
|
25
|
-
const nativeModule = ensureNativeModule(
|
|
24
|
+
// Reference to the native Zixflow Data Pipelines module for SDK operations
|
|
25
|
+
const nativeModule = ensureNativeModule(NativeZixflowMessagingInApp);
|
|
26
26
|
|
|
27
27
|
// Wrapper function that ensures SDK is initialized before calling native methods
|
|
28
28
|
const withNativeModule = <R>(fn: (native: CodegenSpec) => R): R => {
|
|
@@ -34,7 +34,7 @@ const withNativeModule = <R>(fn: (native: CodegenSpec) => R): R => {
|
|
|
34
34
|
*
|
|
35
35
|
* @public
|
|
36
36
|
*/
|
|
37
|
-
class
|
|
37
|
+
class ZixflowInAppMessaging implements NativeInAppSpec {
|
|
38
38
|
private _notificationInbox?: NotificationInbox;
|
|
39
39
|
|
|
40
40
|
registerEventsListener(
|
|
@@ -124,4 +124,4 @@ class InAppMessageEvent {
|
|
|
124
124
|
export type { InlineInAppMessageViewProps } from './components';
|
|
125
125
|
export { NotificationInbox } from './notification-inbox';
|
|
126
126
|
export type { InboxMessage, NotificationInboxChangeListener } from './types';
|
|
127
|
-
export {
|
|
127
|
+
export { ZixflowInAppMessaging, InAppMessageEvent, InlineInAppMessageView };
|