zixflow-reactnative 1.0.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/LICENSE +21 -0
- package/README.md +451 -0
- package/android/build.gradle +155 -0
- package/android/cio-core.gradle +12 -0
- package/android/consumer-rules.pro +3 -0
- package/android/gradle.properties +5 -0
- package/android/src/main/AndroidManifest.xml +19 -0
- package/android/src/main/java/io/customer/reactnative/sdk/CustomerIOReactNativePackage.kt +85 -0
- package/android/src/main/java/io/customer/reactnative/sdk/NativeCustomerIOModule.kt +201 -0
- package/android/src/main/java/io/customer/reactnative/sdk/constant/Keys.kt +20 -0
- package/android/src/main/java/io/customer/reactnative/sdk/extension/MapExtensions.kt +92 -0
- package/android/src/main/java/io/customer/reactnative/sdk/extension/ReactExtensions.kt +11 -0
- package/android/src/main/java/io/customer/reactnative/sdk/extension/StringExtensions.kt +3 -0
- package/android/src/main/java/io/customer/reactnative/sdk/extension/ViewExtensions.kt +34 -0
- package/android/src/main/java/io/customer/reactnative/sdk/location/NativeLocationModule.kt +66 -0
- package/android/src/main/java/io/customer/reactnative/sdk/logging/NativeCustomerIOLoggingModule.kt +90 -0
- package/android/src/main/java/io/customer/reactnative/sdk/messaginginapp/InlineInAppMessageViewManager.kt +56 -0
- package/android/src/main/java/io/customer/reactnative/sdk/messaginginapp/NativeMessagingInAppModule.kt +215 -0
- package/android/src/main/java/io/customer/reactnative/sdk/messaginginapp/NotificationInboxExtensions.kt +23 -0
- package/android/src/main/java/io/customer/reactnative/sdk/messaginginapp/ReactInAppEventListener.kt +77 -0
- package/android/src/main/java/io/customer/reactnative/sdk/messaginginapp/ReactInAppPlatformDelegate.kt +37 -0
- package/android/src/main/java/io/customer/reactnative/sdk/messaginginapp/ReactInlineInAppMessageView.kt +44 -0
- package/android/src/main/java/io/customer/reactnative/sdk/messaginginapp/ReactNotificationInboxChangeListener.kt +47 -0
- package/android/src/main/java/io/customer/reactnative/sdk/messagingpush/NativeMessagingPushModule.kt +283 -0
- package/android/src/main/java/io/customer/reactnative/sdk/messagingpush/PermissionStatus.kt +9 -0
- package/android/src/main/java/io/customer/reactnative/sdk/messagingpush/PushMessagingExtensions.kt +58 -0
- package/android/src/main/java/io/customer/reactnative/sdk/util/Preconditions.kt +35 -0
- package/android/src/main/res/values/customer_io_config.xml +13 -0
- package/customerio-reactnative.podspec +60 -0
- package/ios/CustomerioReactnative.xcodeproj/project.pbxproj +285 -0
- package/ios/CustomerioReactnative.xcodeproj/project.xcworkspace/contents.xcworkspacedata +4 -0
- package/ios/CustomerioReactnative.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/ios/wrappers/CustomerioReactnative-Bridging-Header.h +2 -0
- package/ios/wrappers/NativeCustomerIO.mm +100 -0
- package/ios/wrappers/NativeCustomerIO.swift +162 -0
- package/ios/wrappers/inapp/InboxMessage+Conversion.swift +22 -0
- package/ios/wrappers/inapp/NativeMessagingInApp.mm +122 -0
- package/ios/wrappers/inapp/NativeMessagingInApp.swift +214 -0
- package/ios/wrappers/inapp/ReactInAppEventListener.swift +74 -0
- package/ios/wrappers/inapp/inline/InlineInAppMessageStateEvent.swift +23 -0
- package/ios/wrappers/inapp/inline/RCTInlineMessageNative.h +18 -0
- package/ios/wrappers/inapp/inline/RCTInlineMessageNative.mm +168 -0
- package/ios/wrappers/inapp/inline/ReactInlineMessageView.h +42 -0
- package/ios/wrappers/inapp/inline/ReactInlineMessageView.swift +124 -0
- package/ios/wrappers/location/NativeLocation.mm +52 -0
- package/ios/wrappers/location/NativeLocation.swift +37 -0
- package/ios/wrappers/logging/NativeCustomerIOLogging.mm +81 -0
- package/ios/wrappers/logging/NativeCustomerIOLogging.swift +62 -0
- package/ios/wrappers/push/NativeMessagingPush.mm +87 -0
- package/ios/wrappers/push/NativeMessagingPush.swift +119 -0
- package/ios/wrappers/utils/CioConfigUtils.swift +63 -0
- package/ios/wrappers/utils/CioConstants.swift +25 -0
- package/ios/wrappers/utils/Preconditions.swift +20 -0
- package/ios/wrappers/utils/RCTCustomerIOUtils.h +19 -0
- package/lib/commonjs/cio-params.js +2 -0
- package/lib/commonjs/cio-params.js.map +1 -0
- package/lib/commonjs/components/InlineInAppMessageView.js +146 -0
- package/lib/commonjs/components/InlineInAppMessageView.js.map +1 -0
- package/lib/commonjs/components/index.js +14 -0
- package/lib/commonjs/components/index.js.map +1 -0
- package/lib/commonjs/customerio-cdp.js +163 -0
- package/lib/commonjs/customerio-cdp.js.map +1 -0
- package/lib/commonjs/customerio-inapp.js +107 -0
- package/lib/commonjs/customerio-inapp.js.map +1 -0
- package/lib/commonjs/customerio-location.js +53 -0
- package/lib/commonjs/customerio-location.js.map +1 -0
- package/lib/commonjs/customerio-push.js +115 -0
- package/lib/commonjs/customerio-push.js.map +1 -0
- package/lib/commonjs/index.js +17 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/native-logger-listener.js +84 -0
- package/lib/commonjs/native-logger-listener.js.map +1 -0
- package/lib/commonjs/notification-inbox.js +132 -0
- package/lib/commonjs/notification-inbox.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/postInstall.js +13 -0
- package/lib/commonjs/postInstall.js.map +1 -0
- package/lib/commonjs/specs/components/InlineMessageNativeComponent.ts +59 -0
- package/lib/commonjs/specs/modules/NativeCustomerIO.js +40 -0
- package/lib/commonjs/specs/modules/NativeCustomerIO.js.map +1 -0
- package/lib/commonjs/specs/modules/NativeCustomerIOLocation.js +15 -0
- package/lib/commonjs/specs/modules/NativeCustomerIOLocation.js.map +1 -0
- package/lib/commonjs/specs/modules/NativeCustomerIOLogging.js +19 -0
- package/lib/commonjs/specs/modules/NativeCustomerIOLogging.js.map +1 -0
- package/lib/commonjs/specs/modules/NativeCustomerIOMessagingInApp.js +16 -0
- package/lib/commonjs/specs/modules/NativeCustomerIOMessagingInApp.js.map +1 -0
- package/lib/commonjs/specs/modules/NativeCustomerIOMessagingPush.js +15 -0
- package/lib/commonjs/specs/modules/NativeCustomerIOMessagingPush.js.map +1 -0
- package/lib/commonjs/types/data-pipelines.js +123 -0
- package/lib/commonjs/types/data-pipelines.js.map +1 -0
- package/lib/commonjs/types/in-app.js +43 -0
- package/lib/commonjs/types/in-app.js.map +1 -0
- package/lib/commonjs/types/index.js +39 -0
- package/lib/commonjs/types/index.js.map +1 -0
- package/lib/commonjs/types/internal.js +2 -0
- package/lib/commonjs/types/internal.js.map +1 -0
- package/lib/commonjs/types/push.js +49 -0
- package/lib/commonjs/types/push.js.map +1 -0
- package/lib/commonjs/utils/native-bridge.js +31 -0
- package/lib/commonjs/utils/native-bridge.js.map +1 -0
- package/lib/commonjs/utils/param-validation.js +136 -0
- package/lib/commonjs/utils/param-validation.js.map +1 -0
- package/lib/commonjs/zixflow.js +71 -0
- package/lib/commonjs/zixflow.js.map +1 -0
- package/lib/module/cio-params.js +2 -0
- package/lib/module/cio-params.js.map +1 -0
- package/lib/module/components/InlineInAppMessageView.js +141 -0
- package/lib/module/components/InlineInAppMessageView.js.map +1 -0
- package/lib/module/components/index.js +6 -0
- package/lib/module/components/index.js.map +1 -0
- package/lib/module/customerio-cdp.js +157 -0
- package/lib/module/customerio-cdp.js.map +1 -0
- package/lib/module/customerio-inapp.js +92 -0
- package/lib/module/customerio-inapp.js.map +1 -0
- package/lib/module/customerio-location.js +48 -0
- package/lib/module/customerio-location.js.map +1 -0
- package/lib/module/customerio-push.js +111 -0
- package/lib/module/customerio-push.js.map +1 -0
- package/lib/module/index.js +12 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/native-logger-listener.js +79 -0
- package/lib/module/native-logger-listener.js.map +1 -0
- package/lib/module/notification-inbox.js +127 -0
- package/lib/module/notification-inbox.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/postInstall.js +13 -0
- package/lib/module/postInstall.js.map +1 -0
- package/lib/module/specs/components/InlineMessageNativeComponent.ts +59 -0
- package/lib/module/specs/modules/NativeCustomerIO.js +41 -0
- package/lib/module/specs/modules/NativeCustomerIO.js.map +1 -0
- package/lib/module/specs/modules/NativeCustomerIOLocation.js +13 -0
- package/lib/module/specs/modules/NativeCustomerIOLocation.js.map +1 -0
- package/lib/module/specs/modules/NativeCustomerIOLogging.js +18 -0
- package/lib/module/specs/modules/NativeCustomerIOLogging.js.map +1 -0
- package/lib/module/specs/modules/NativeCustomerIOMessagingInApp.js +15 -0
- package/lib/module/specs/modules/NativeCustomerIOMessagingInApp.js.map +1 -0
- package/lib/module/specs/modules/NativeCustomerIOMessagingPush.js +13 -0
- package/lib/module/specs/modules/NativeCustomerIOMessagingPush.js.map +1 -0
- package/lib/module/types/data-pipelines.js +126 -0
- package/lib/module/types/data-pipelines.js.map +1 -0
- package/lib/module/types/in-app.js +42 -0
- package/lib/module/types/in-app.js.map +1 -0
- package/lib/module/types/index.js +6 -0
- package/lib/module/types/index.js.map +1 -0
- package/lib/module/types/internal.js +2 -0
- package/lib/module/types/internal.js.map +1 -0
- package/lib/module/types/push.js +47 -0
- package/lib/module/types/push.js.map +1 -0
- package/lib/module/utils/native-bridge.js +25 -0
- package/lib/module/utils/native-bridge.js.map +1 -0
- package/lib/module/utils/param-validation.js +132 -0
- package/lib/module/utils/param-validation.js.map +1 -0
- package/lib/module/zixflow.js +23 -0
- package/lib/module/zixflow.js.map +1 -0
- package/lib/typescript/commonjs/cio-params.d.ts +5 -0
- package/lib/typescript/commonjs/cio-params.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/InlineInAppMessageView.d.ts +41 -0
- package/lib/typescript/commonjs/components/InlineInAppMessageView.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/customerio-cdp.d.ts +40 -0
- package/lib/typescript/commonjs/customerio-cdp.d.ts.map +1 -0
- package/lib/typescript/commonjs/customerio-inapp.d.ts +48 -0
- package/lib/typescript/commonjs/customerio-inapp.d.ts.map +1 -0
- package/lib/typescript/commonjs/customerio-location.d.ts +31 -0
- package/lib/typescript/commonjs/customerio-location.d.ts.map +1 -0
- package/lib/typescript/commonjs/customerio-push.d.ts +56 -0
- package/lib/typescript/commonjs/customerio-push.d.ts.map +1 -0
- package/lib/typescript/commonjs/index.d.ts +8 -0
- package/lib/typescript/commonjs/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/native-logger-listener.d.ts +8 -0
- package/lib/typescript/commonjs/native-logger-listener.d.ts.map +1 -0
- package/lib/typescript/commonjs/notification-inbox.d.ts +57 -0
- package/lib/typescript/commonjs/notification-inbox.d.ts.map +1 -0
- package/lib/typescript/commonjs/package.json +1 -0
- package/lib/typescript/commonjs/postInstall.d.ts +2 -0
- package/lib/typescript/commonjs/postInstall.d.ts.map +1 -0
- package/lib/typescript/commonjs/specs/components/InlineMessageNativeComponent.d.ts +40 -0
- package/lib/typescript/commonjs/specs/components/InlineMessageNativeComponent.d.ts.map +1 -0
- package/lib/typescript/commonjs/specs/modules/NativeCustomerIO.d.ts +46 -0
- package/lib/typescript/commonjs/specs/modules/NativeCustomerIO.d.ts.map +1 -0
- package/lib/typescript/commonjs/specs/modules/NativeCustomerIOLocation.d.ts +14 -0
- package/lib/typescript/commonjs/specs/modules/NativeCustomerIOLocation.d.ts.map +1 -0
- package/lib/typescript/commonjs/specs/modules/NativeCustomerIOLogging.d.ts +18 -0
- package/lib/typescript/commonjs/specs/modules/NativeCustomerIOLogging.d.ts.map +1 -0
- package/lib/typescript/commonjs/specs/modules/NativeCustomerIOMessagingInApp.d.ts +23 -0
- package/lib/typescript/commonjs/specs/modules/NativeCustomerIOMessagingInApp.d.ts.map +1 -0
- package/lib/typescript/commonjs/specs/modules/NativeCustomerIOMessagingPush.d.ts +20 -0
- package/lib/typescript/commonjs/specs/modules/NativeCustomerIOMessagingPush.d.ts.map +1 -0
- package/lib/typescript/commonjs/types/data-pipelines.d.ts +143 -0
- package/lib/typescript/commonjs/types/data-pipelines.d.ts.map +1 -0
- package/lib/typescript/commonjs/types/in-app.d.ts +67 -0
- package/lib/typescript/commonjs/types/in-app.d.ts.map +1 -0
- package/lib/typescript/commonjs/types/index.d.ts +4 -0
- package/lib/typescript/commonjs/types/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/types/internal.d.ts +20 -0
- package/lib/typescript/commonjs/types/internal.d.ts.map +1 -0
- package/lib/typescript/commonjs/types/push.d.ts +49 -0
- package/lib/typescript/commonjs/types/push.d.ts.map +1 -0
- package/lib/typescript/commonjs/utils/native-bridge.d.ts +9 -0
- package/lib/typescript/commonjs/utils/native-bridge.d.ts.map +1 -0
- package/lib/typescript/commonjs/utils/param-validation.d.ts +44 -0
- package/lib/typescript/commonjs/utils/param-validation.d.ts.map +1 -0
- package/lib/typescript/commonjs/zixflow.d.ts +14 -0
- package/lib/typescript/commonjs/zixflow.d.ts.map +1 -0
- package/lib/typescript/module/cio-params.d.ts +5 -0
- package/lib/typescript/module/cio-params.d.ts.map +1 -0
- package/lib/typescript/module/components/InlineInAppMessageView.d.ts +41 -0
- package/lib/typescript/module/components/InlineInAppMessageView.d.ts.map +1 -0
- package/lib/typescript/module/components/index.d.ts +3 -0
- package/lib/typescript/module/components/index.d.ts.map +1 -0
- package/lib/typescript/module/customerio-cdp.d.ts +40 -0
- package/lib/typescript/module/customerio-cdp.d.ts.map +1 -0
- package/lib/typescript/module/customerio-inapp.d.ts +48 -0
- package/lib/typescript/module/customerio-inapp.d.ts.map +1 -0
- package/lib/typescript/module/customerio-location.d.ts +31 -0
- package/lib/typescript/module/customerio-location.d.ts.map +1 -0
- package/lib/typescript/module/customerio-push.d.ts +56 -0
- package/lib/typescript/module/customerio-push.d.ts.map +1 -0
- package/lib/typescript/module/index.d.ts +8 -0
- package/lib/typescript/module/index.d.ts.map +1 -0
- package/lib/typescript/module/native-logger-listener.d.ts +8 -0
- package/lib/typescript/module/native-logger-listener.d.ts.map +1 -0
- package/lib/typescript/module/notification-inbox.d.ts +57 -0
- package/lib/typescript/module/notification-inbox.d.ts.map +1 -0
- package/lib/typescript/module/package.json +1 -0
- package/lib/typescript/module/postInstall.d.ts +2 -0
- package/lib/typescript/module/postInstall.d.ts.map +1 -0
- package/lib/typescript/module/specs/components/InlineMessageNativeComponent.d.ts +40 -0
- package/lib/typescript/module/specs/components/InlineMessageNativeComponent.d.ts.map +1 -0
- package/lib/typescript/module/specs/modules/NativeCustomerIO.d.ts +46 -0
- package/lib/typescript/module/specs/modules/NativeCustomerIO.d.ts.map +1 -0
- package/lib/typescript/module/specs/modules/NativeCustomerIOLocation.d.ts +14 -0
- package/lib/typescript/module/specs/modules/NativeCustomerIOLocation.d.ts.map +1 -0
- package/lib/typescript/module/specs/modules/NativeCustomerIOLogging.d.ts +18 -0
- package/lib/typescript/module/specs/modules/NativeCustomerIOLogging.d.ts.map +1 -0
- package/lib/typescript/module/specs/modules/NativeCustomerIOMessagingInApp.d.ts +23 -0
- package/lib/typescript/module/specs/modules/NativeCustomerIOMessagingInApp.d.ts.map +1 -0
- package/lib/typescript/module/specs/modules/NativeCustomerIOMessagingPush.d.ts +20 -0
- package/lib/typescript/module/specs/modules/NativeCustomerIOMessagingPush.d.ts.map +1 -0
- package/lib/typescript/module/types/data-pipelines.d.ts +143 -0
- package/lib/typescript/module/types/data-pipelines.d.ts.map +1 -0
- package/lib/typescript/module/types/in-app.d.ts +67 -0
- package/lib/typescript/module/types/in-app.d.ts.map +1 -0
- package/lib/typescript/module/types/index.d.ts +4 -0
- package/lib/typescript/module/types/index.d.ts.map +1 -0
- package/lib/typescript/module/types/internal.d.ts +20 -0
- package/lib/typescript/module/types/internal.d.ts.map +1 -0
- package/lib/typescript/module/types/push.d.ts +49 -0
- package/lib/typescript/module/types/push.d.ts.map +1 -0
- package/lib/typescript/module/utils/native-bridge.d.ts +9 -0
- package/lib/typescript/module/utils/native-bridge.d.ts.map +1 -0
- package/lib/typescript/module/utils/param-validation.d.ts +44 -0
- package/lib/typescript/module/utils/param-validation.d.ts.map +1 -0
- package/lib/typescript/module/zixflow.d.ts +14 -0
- package/lib/typescript/module/zixflow.d.ts.map +1 -0
- package/package.json +165 -0
- package/src/cio-params.ts +4 -0
- package/src/components/InlineInAppMessageView.tsx +187 -0
- package/src/components/index.ts +3 -0
- package/src/customerio-cdp.ts +190 -0
- package/src/customerio-inapp.ts +127 -0
- package/src/customerio-location.ts +56 -0
- package/src/customerio-push.ts +127 -0
- package/src/index.ts +9 -0
- package/src/native-logger-listener.ts +84 -0
- package/src/notification-inbox.ts +154 -0
- package/src/postInstall.js +10 -0
- package/src/specs/components/InlineMessageNativeComponent.ts +59 -0
- package/src/specs/modules/NativeCustomerIO.ts +55 -0
- package/src/specs/modules/NativeCustomerIOLocation.ts +15 -0
- package/src/specs/modules/NativeCustomerIOLogging.ts +24 -0
- package/src/specs/modules/NativeCustomerIOMessagingInApp.ts +30 -0
- package/src/specs/modules/NativeCustomerIOMessagingPush.ts +27 -0
- package/src/types/data-pipelines.ts +150 -0
- package/src/types/in-app.ts +69 -0
- package/src/types/index.ts +3 -0
- package/src/types/internal.ts +20 -0
- package/src/types/push.ts +50 -0
- package/src/utils/native-bridge.ts +30 -0
- package/src/utils/param-validation.ts +178 -0
- package/src/zixflow.ts +24 -0
- package/zixflow-reactnative-richpush.podspec +42 -0
- package/zixflow-reactnative.podspec +66 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import NativeCustomerIOLogging from "./specs/modules/NativeCustomerIOLogging.js";
|
|
4
|
+
import { CioLogLevel } from "./types/index.js";
|
|
5
|
+
import { callNativeModule, ensureNativeModule } from "./utils/native-bridge.js";
|
|
6
|
+
|
|
7
|
+
// Reference to the native CustomerIO logging module for SDK operations
|
|
8
|
+
const nativeModule = ensureNativeModule(NativeCustomerIOLogging);
|
|
9
|
+
|
|
10
|
+
// Wrapper function that ensures SDK is initialized before calling native methods
|
|
11
|
+
const withNativeModule = fn => {
|
|
12
|
+
return callNativeModule(nativeModule, fn);
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
/* @internal */
|
|
16
|
+
export class NativeLoggerListener {
|
|
17
|
+
static isInitialized = false;
|
|
18
|
+
// Prefix for all CustomerIO log messages
|
|
19
|
+
static loggerPrefix = '[CIO] ';
|
|
20
|
+
static async initialize() {
|
|
21
|
+
// Prevent multiple registrations of the same log listener
|
|
22
|
+
if (this.isInitialized) {
|
|
23
|
+
return Promise.resolve();
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// Using console.log will log to the JavaScript side but prevent
|
|
27
|
+
// React Native's default behavior of redirecting logs to the native side.
|
|
28
|
+
// By doing it asynchronously, we ensure the logs are captured on both
|
|
29
|
+
// the JavaScript and native ends.
|
|
30
|
+
const logEvent = async event => {
|
|
31
|
+
switch (event.logLevel) {
|
|
32
|
+
case CioLogLevel.Debug:
|
|
33
|
+
console.debug(this.loggerPrefix + event.message);
|
|
34
|
+
break;
|
|
35
|
+
case CioLogLevel.Info:
|
|
36
|
+
console.info(this.loggerPrefix + event.message);
|
|
37
|
+
break;
|
|
38
|
+
case CioLogLevel.Error:
|
|
39
|
+
console.error(this.loggerPrefix + event.message);
|
|
40
|
+
break;
|
|
41
|
+
default:
|
|
42
|
+
console.log(this.loggerPrefix + event);
|
|
43
|
+
break;
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
const logHandler = data => {
|
|
47
|
+
const event = data;
|
|
48
|
+
logEvent(event);
|
|
49
|
+
};
|
|
50
|
+
withNativeModule(native => {
|
|
51
|
+
try {
|
|
52
|
+
// Register TurboModule event listener and return subscription.
|
|
53
|
+
// This method is generated by codegen in the native modules.
|
|
54
|
+
// Wrapped in try-catch due to previous reports of crashes on certain Android architectures.
|
|
55
|
+
native.onCioLogEvent(logHandler);
|
|
56
|
+
} catch (error) {
|
|
57
|
+
NativeLoggerListener.warn('Failed to attach log listener:', error);
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
this.isInitialized = true;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// Logs warning messages in development mode only, with CIO prefix
|
|
64
|
+
static warn(message, error) {
|
|
65
|
+
if (__DEV__) {
|
|
66
|
+
console.warn(this.loggerPrefix + message, error);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// Initializes native logger listener with error handling
|
|
71
|
+
static initNativeLogger() {
|
|
72
|
+
try {
|
|
73
|
+
NativeLoggerListener.initialize();
|
|
74
|
+
} catch (error) {
|
|
75
|
+
NativeLoggerListener.warn('Failed to initialize native logger:', error);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=native-logger-listener.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["NativeCustomerIOLogging","CioLogLevel","callNativeModule","ensureNativeModule","nativeModule","withNativeModule","fn","NativeLoggerListener","isInitialized","loggerPrefix","initialize","Promise","resolve","logEvent","event","logLevel","Debug","console","debug","message","Info","info","Error","error","log","logHandler","data","native","onCioLogEvent","warn","__DEV__","initNativeLogger"],"sourceRoot":"../../src","sources":["native-logger-listener.ts"],"mappings":";;AAAA,OAAOA,uBAAuB,MAAM,4CAAyC;AAC7E,SAASC,WAAW,QAAQ,kBAAS;AACrC,SAASC,gBAAgB,EAAEC,kBAAkB,QAAQ,0BAAuB;;AAE5E;AACA,MAAMC,YAAY,GAAGD,kBAAkB,CAACH,uBAAuB,CAAC;;AAEhE;AACA,MAAMK,gBAAgB,GACpBC,EAAiD,IAC3C;EACN,OAAOJ,gBAAgB,CAACE,YAAY,EAAEE,EAAE,CAAC;AAC3C,CAAC;;AAED;AACA,OAAO,MAAMC,oBAAoB,CAAC;EAChC,OAAeC,aAAa,GAAG,KAAK;EACpC;EACA,OAAeC,YAAY,GAAG,QAAQ;EAEtC,aAAaC,UAAUA,CAAA,EAAkB;IACvC;IACA,IAAI,IAAI,CAACF,aAAa,EAAE;MACtB,OAAOG,OAAO,CAACC,OAAO,CAAC,CAAC;IAC1B;;IAEA;IACA;IACA;IACA;IAC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,oBAAoB,CAACsB,IAAI,CAAC,qCAAqC,EAAEN,KAAK,CAAC;IACzE;EACF;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { NativeLoggerListener } from "./native-logger-listener.js";
|
|
4
|
+
import NativeCustomerIOMessagingInApp from "./specs/modules/NativeCustomerIOMessagingInApp.js";
|
|
5
|
+
import { callNativeModule, ensureNativeModule } from "./utils/native-bridge.js";
|
|
6
|
+
|
|
7
|
+
// Reference to the native CustomerIO In-App Messaging module
|
|
8
|
+
const nativeModule = ensureNativeModule(NativeCustomerIOMessagingInApp);
|
|
9
|
+
|
|
10
|
+
// Wrapper function that ensures SDK is initialized before calling native methods
|
|
11
|
+
const withNativeModule = fn => {
|
|
12
|
+
return callNativeModule(nativeModule, fn);
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Public API methods for NotificationInbox.
|
|
17
|
+
* Define the TypeScript API here with proper types (InboxMessage instead of UnsafeObject).
|
|
18
|
+
*
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Native inbox methods from CodegenSpec that should be excluded from CustomerIOInAppMessaging.
|
|
24
|
+
* Includes both public methods (in NotificationInboxPublicSpec) and internal methods.
|
|
25
|
+
*
|
|
26
|
+
* @internal
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Helper function to parse raw inbox message from native layer
|
|
31
|
+
* @internal
|
|
32
|
+
*/
|
|
33
|
+
function parseInboxMessage(raw) {
|
|
34
|
+
return {
|
|
35
|
+
queueId: raw.queueId,
|
|
36
|
+
deliveryId: raw.deliveryId ?? undefined,
|
|
37
|
+
expiry: raw.expiry ?? undefined,
|
|
38
|
+
sentAt: raw.sentAt,
|
|
39
|
+
topics: raw.topics || [],
|
|
40
|
+
type: raw.type,
|
|
41
|
+
opened: raw.opened,
|
|
42
|
+
priority: raw.priority ?? undefined,
|
|
43
|
+
properties: raw.properties || {}
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Manages inbox messages for the current user.
|
|
49
|
+
*
|
|
50
|
+
* @public
|
|
51
|
+
*/
|
|
52
|
+
export class NotificationInbox {
|
|
53
|
+
/**
|
|
54
|
+
* Gets inbox messages.
|
|
55
|
+
*/
|
|
56
|
+
async getMessages(topic) {
|
|
57
|
+
return withNativeModule(async native => {
|
|
58
|
+
const rawMessages = await native.getMessages(topic);
|
|
59
|
+
return rawMessages.map(parseInboxMessage);
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Subscribes to inbox message changes.
|
|
65
|
+
* Optionally filter messages by topic.
|
|
66
|
+
*/
|
|
67
|
+
subscribeToMessages(listener, topic) {
|
|
68
|
+
const emitter = data => {
|
|
69
|
+
let messages = (data.messages || []).map(parseInboxMessage);
|
|
70
|
+
|
|
71
|
+
// Filter by topic if specified (case-insensitive)
|
|
72
|
+
if (topic) {
|
|
73
|
+
const topicLower = topic.toLowerCase();
|
|
74
|
+
messages = messages.filter(msg => msg.topics.some(t => t.toLowerCase() === topicLower));
|
|
75
|
+
}
|
|
76
|
+
listener.onMessagesChanged(messages);
|
|
77
|
+
};
|
|
78
|
+
return withNativeModule(native => {
|
|
79
|
+
try {
|
|
80
|
+
// Set up the native inbox listener before subscribing to events
|
|
81
|
+
// This will automatically trigger onMessagesChanged with current messages
|
|
82
|
+
native.setupInboxListener();
|
|
83
|
+
|
|
84
|
+
// Register TurboModule event listener and return subscription
|
|
85
|
+
return native.subscribeToMessagesChanged(emitter);
|
|
86
|
+
} catch (error) {
|
|
87
|
+
NativeLoggerListener.warn('Failed to attach inbox change listener:', error);
|
|
88
|
+
// Return a no-op subscription to maintain backwards compatibility
|
|
89
|
+
return {
|
|
90
|
+
remove: () => {},
|
|
91
|
+
eventType: '',
|
|
92
|
+
key: 0,
|
|
93
|
+
subscriber: null
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Marks an inbox message as opened/read.
|
|
101
|
+
*/
|
|
102
|
+
markMessageOpened(message) {
|
|
103
|
+
withNativeModule(native => native.markMessageOpened(message));
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Marks an inbox message as unopened/unread.
|
|
108
|
+
*/
|
|
109
|
+
markMessageUnopened(message) {
|
|
110
|
+
withNativeModule(native => native.markMessageUnopened(message));
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Marks an inbox message as deleted.
|
|
115
|
+
*/
|
|
116
|
+
markMessageDeleted(message) {
|
|
117
|
+
withNativeModule(native => native.markMessageDeleted(message));
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Tracks a click event for an inbox message.
|
|
122
|
+
*/
|
|
123
|
+
trackMessageClicked(message, actionName) {
|
|
124
|
+
withNativeModule(native => native.trackMessageClicked(message, actionName));
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
//# sourceMappingURL=notification-inbox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["NativeLoggerListener","NativeCustomerIOMessagingInApp","callNativeModule","ensureNativeModule","nativeModule","withNativeModule","fn","parseInboxMessage","raw","queueId","deliveryId","undefined","expiry","sentAt","topics","type","opened","priority","properties","NotificationInbox","getMessages","topic","native","rawMessages","map","subscribeToMessages","listener","emitter","data","messages","topicLower","toLowerCase","filter","msg","some","t","onMessagesChanged","setupInboxListener","subscribeToMessagesChanged","error","warn","remove","eventType","key","subscriber","markMessageOpened","message","markMessageUnopened","markMessageDeleted","trackMessageClicked","actionName"],"sourceRoot":"../../src","sources":["notification-inbox.ts"],"mappings":";;AACA,SAASA,oBAAoB,QAAQ,6BAA0B;AAE/D,OAAO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KA,MAAM,CAAC0B,kBAAkB,CAACF,OAAO,CAAC,CAAC;EAClE;;EAEA;AACF;AACA;EACEG,mBAAmBA,CAACH,OAAqB,EAAEI,UAAmB,EAAE;IAC9D7C,gBAAgB,CAAEiB,MAAM,IACtBA,MAAM,CAAC2B,mBAAmB,CAACH,OAAO,EAAEI,UAAU,CAChD,CAAC;EACH;AACF","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"module"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
This code block attempts to set expoVersion in package.json.
|
|
5
|
+
If it fails, the assumption is that Expo plugin is not installed,
|
|
6
|
+
therefore we are running on bare React Native project.
|
|
7
|
+
If it succeeds, we use Expo as the user agent instead of React Native.
|
|
8
|
+
*/
|
|
9
|
+
try {
|
|
10
|
+
const ph = require('customerio-expo-plugin/postinstall');
|
|
11
|
+
ph.runPostInstall();
|
|
12
|
+
} catch {}
|
|
13
|
+
//# sourceMappingURL=postInstall.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["ph","require","runPostInstall"],"sourceRoot":"../../src","sources":["postInstall.js"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;EACF,MAAMA,EAAE,GAAGC,OAAO,CAAC,oCAAoC,CAAC;EACxDD,EAAE,CAACE,cAAc,CAAC,CAAC;AACrB,CAAC,CAAC,MAAM,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// React Native docs now recommend Codegen types should be imported from the react-native package
|
|
2
|
+
// But it breaks on Expo and older React Native versions, so we import from react-native/Libraries/Types/CodegenTypes
|
|
3
|
+
// for compatibility with all versions until we can fully migrate to the new import style without breaking older versions
|
|
4
|
+
// https://reactnative.dev/docs/strict-typescript-api#codegen-types-should-now-be-imported-from-the-react-native-package
|
|
5
|
+
|
|
6
|
+
import type { HostComponent, ViewProps } from 'react-native';
|
|
7
|
+
/* eslint-disable @react-native/no-deep-imports */
|
|
8
|
+
import type {
|
|
9
|
+
DirectEventHandler,
|
|
10
|
+
Double,
|
|
11
|
+
} from 'react-native/Libraries/Types/CodegenTypes';
|
|
12
|
+
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
|
|
13
|
+
|
|
14
|
+
/** Event data for inline message size changes. */
|
|
15
|
+
export interface SizeChangeEvent {
|
|
16
|
+
width: Double;
|
|
17
|
+
height: Double;
|
|
18
|
+
duration?: Double;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** States representing the loading and display status of inline messages. */
|
|
22
|
+
export enum InlineMessageState {
|
|
23
|
+
LoadingStarted = 'LoadingStarted',
|
|
24
|
+
LoadingFinished = 'LoadingFinished',
|
|
25
|
+
NoMessageToDisplay = 'NoMessageToDisplay',
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** Event data for inline message state changes. */
|
|
29
|
+
export interface StateChangeEvent {
|
|
30
|
+
state: string;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** Event data for inline message action clicks. */
|
|
34
|
+
export interface ActionClickEvent {
|
|
35
|
+
/** Message data structure - defined inline for codegen compatibility (cannot import types) */
|
|
36
|
+
message: {
|
|
37
|
+
messageId: string;
|
|
38
|
+
deliveryId?: string;
|
|
39
|
+
elementId?: string;
|
|
40
|
+
};
|
|
41
|
+
actionValue: string;
|
|
42
|
+
actionName: string;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/** Props for the native inline message component. */
|
|
46
|
+
export interface NativeProps extends ViewProps {
|
|
47
|
+
/** Required element ID for retrieving inline message content. */
|
|
48
|
+
elementId: string;
|
|
49
|
+
onSizeChange: DirectEventHandler<SizeChangeEvent>;
|
|
50
|
+
onStateChange?: DirectEventHandler<StateChangeEvent>;
|
|
51
|
+
onActionClick?: DirectEventHandler<ActionClickEvent>;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// React Native Codegen automatically generates the native component bridge based on the NativeProps interface
|
|
55
|
+
// This creates the low-level native component that handles communication between JS and native code
|
|
56
|
+
// Used by native iOS/Android components - the public view is InlineInAppMessageView in components directory
|
|
57
|
+
export default codegenNativeComponent<NativeProps>(
|
|
58
|
+
'InlineMessageNative'
|
|
59
|
+
) as HostComponent<NativeProps>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { TurboModuleRegistry } from 'react-native';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Native module specification for CustomerIO React Native SDK
|
|
7
|
+
*
|
|
8
|
+
* This module defines the TurboModule interface for CustomerIO SDK native bridge.
|
|
9
|
+
* Types use basic primitives for React Native Codegen compatibility, while the public
|
|
10
|
+
* API layer provides more specific TypeScript types for better developer experience.
|
|
11
|
+
*
|
|
12
|
+
* The separation allows:
|
|
13
|
+
* - Native bridge compatibility with Codegen constraints
|
|
14
|
+
* - Type-safe public API with proper TypeScript definitions
|
|
15
|
+
* - Alignment between codegen spec and public contract
|
|
16
|
+
*
|
|
17
|
+
* @see https://github.com/facebook/react-native/issues/38769 for Codegen limitations
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Generic object type for native bridge parameter passing.
|
|
22
|
+
*
|
|
23
|
+
* Used for all complex data structures passed to native methods to ensure
|
|
24
|
+
* React Native Codegen compatibility. The public API layer converts these
|
|
25
|
+
* to proper TypeScript types (CustomAttributes, CioConfig, etc.) for
|
|
26
|
+
* better type safety and developer experience.
|
|
27
|
+
*
|
|
28
|
+
* @internal - Not exported to avoid conflicts with public API types
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
// =============================================================================
|
|
32
|
+
// TURBO MODULE SPEC – Defines native bridge interface
|
|
33
|
+
// =============================================================================
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* TurboModule specification for CustomerIO SDK native bridge methods.
|
|
37
|
+
* Uses generic Object types for React Native Codegen compatibility.
|
|
38
|
+
*/
|
|
39
|
+
|
|
40
|
+
export default TurboModuleRegistry.getEnforcing('NativeCustomerIO');
|
|
41
|
+
//# sourceMappingURL=NativeCustomerIO.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../../../src","sources":["specs/modules/NativeCustomerIO.ts"],"mappings":";;AAAA,SAASA,mBAAmB,QAA0B,cAAc;;AAGpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAiBA,eAAeA,mBAAmB,CAACC,YAAY,CAAO,kBAAkB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { TurboModuleRegistry } from 'react-native';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Native module specification for CustomerIO Location React Native SDK
|
|
7
|
+
*
|
|
8
|
+
* @see NativeCustomerIO.ts for detailed documentation on TurboModule patterns,
|
|
9
|
+
* Codegen compatibility, and type safety approach.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
export default TurboModuleRegistry.get('NativeCustomerIOLocation');
|
|
13
|
+
//# sourceMappingURL=NativeCustomerIOLocation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["TurboModuleRegistry","get"],"sourceRoot":"../../../../src","sources":["specs/modules/NativeCustomerIOLocation.ts"],"mappings":";;AAAA,SAASA,mBAAmB,QAA0B,cAAc;;AAEpE;AACA;AACA;AACA;AACA;AACA;;AAOA,eAAeA,mBAAmB,CAACC,GAAG,CAAO,0BAA0B,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { TurboModuleRegistry } from 'react-native';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Native module specification for CustomerIO Logging React Native SDK
|
|
7
|
+
*
|
|
8
|
+
* This module defines the TurboModule interface for CustomerIO logging bridge.
|
|
9
|
+
* Used internally for printing logs to React Native environment instead of native.
|
|
10
|
+
*
|
|
11
|
+
* @see NativeCustomerIO.ts for detailed documentation on TurboModule patterns,
|
|
12
|
+
* Codegen compatibility, and type safety approach.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/** TurboModule interface for CustomerIO logging native operations */
|
|
16
|
+
|
|
17
|
+
export default TurboModuleRegistry.getEnforcing('NativeCustomerIOLogging');
|
|
18
|
+
//# sourceMappingURL=NativeCustomerIOLogging.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../../../src","sources":["specs/modules/NativeCustomerIOLogging.ts"],"mappings":";;AAAA,SAASA,mBAAmB,QAA0B,cAAc;;AAMpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAKA,eAAeA,mBAAmB,CAACC,YAAY,CAC7C,yBACF,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { TurboModuleRegistry } from 'react-native';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Native module specification for CustomerIO In-App Messaging React Native SDK
|
|
7
|
+
*
|
|
8
|
+
* @see NativeCustomerIO.ts for detailed documentation on TurboModule patterns,
|
|
9
|
+
* Codegen compatibility, and type safety approach.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/** TurboModule interface for CustomerIO In-App Messaging native operations */
|
|
13
|
+
|
|
14
|
+
export default TurboModuleRegistry.getEnforcing('NativeCustomerIOMessagingInApp');
|
|
15
|
+
//# sourceMappingURL=NativeCustomerIOMessagingInApp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../../../src","sources":["specs/modules/NativeCustomerIOMessagingInApp.ts"],"mappings":";;AAAA,SAASA,mBAAmB,QAA0B,cAAc;;AAMpE;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAcA,eAAeA,mBAAmB,CAACC,YAAY,CAC7C,gCACF,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { TurboModuleRegistry } from 'react-native';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Native module specification for CustomerIO Push Messaging React Native SDK
|
|
7
|
+
*
|
|
8
|
+
* @see NativeCustomerIO.ts for detailed documentation on TurboModule patterns,
|
|
9
|
+
* Codegen compatibility, and type safety approach.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
export default TurboModuleRegistry.getEnforcing('NativeCustomerIOMessagingPush');
|
|
13
|
+
//# sourceMappingURL=NativeCustomerIOMessagingPush.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../../../src","sources":["specs/modules/NativeCustomerIOMessagingPush.ts"],"mappings":";;AAAA,SAASA,mBAAmB,QAA0B,cAAc;;AAGpE;AACA;AACA;AACA;AACA;AACA;;AAgBA,eAAeA,mBAAmB,CAACC,YAAY,CAC7C,+BACF,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Key-value pairs for custom user attributes and event properties.
|
|
5
|
+
*
|
|
6
|
+
* Provides a type-safe interface for passing custom data to CustomerIO.
|
|
7
|
+
* While the native bridge uses generic Object types for Codegen compatibility,
|
|
8
|
+
* this type gives developers better TypeScript intellisense and validation.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* const attributes: CustomAttributes = {
|
|
13
|
+
* age: 25,
|
|
14
|
+
* email: 'user@example.com',
|
|
15
|
+
* preferences: { theme: 'dark' }
|
|
16
|
+
* };
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* @public
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Parameters for identifying a user in CustomerIO.
|
|
24
|
+
*
|
|
25
|
+
* @param userId - Unique identifier for the user (email, username, etc.)
|
|
26
|
+
* @param traits - Additional user attributes and properties
|
|
27
|
+
*
|
|
28
|
+
* @public
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Configuration options for initializing the CustomerIO SDK.
|
|
33
|
+
*
|
|
34
|
+
* @param cdpApiKey - Customer Data Platform API key from CustomerIO dashboard
|
|
35
|
+
* @param migrationSiteId - Legacy site ID for migrating from tracking API
|
|
36
|
+
* @param region - Data center region (US or EU)
|
|
37
|
+
* @param logLevel - SDK logging verbosity level
|
|
38
|
+
* @param apiHost - Override the CDP API host. Use to route SDK traffic through a first-party proxy.
|
|
39
|
+
* @param cdnHost - Override the CDN host. Use to route SDK traffic through a first-party proxy.
|
|
40
|
+
* @param flushAt - Number of events to batch before sending
|
|
41
|
+
* @param flushInterval - Time interval (seconds) to flush events
|
|
42
|
+
* @param screenViewUse - How to handle screen view tracking
|
|
43
|
+
* @param trackApplicationLifecycleEvents - Auto-track app lifecycle events
|
|
44
|
+
* @param autoTrackDeviceAttributes - Auto-track device information
|
|
45
|
+
* @param inApp - In-app messaging configuration
|
|
46
|
+
* @param push - Push notification configuration
|
|
47
|
+
*
|
|
48
|
+
* @public
|
|
49
|
+
*/
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Log levels for CustomerIO SDK debugging and monitoring.
|
|
53
|
+
*
|
|
54
|
+
* Controls the verbosity of SDK logging output for debugging purposes.
|
|
55
|
+
*
|
|
56
|
+
* @public
|
|
57
|
+
*/
|
|
58
|
+
export let CioLogLevel = /*#__PURE__*/function (CioLogLevel) {
|
|
59
|
+
/** No logging output */
|
|
60
|
+
CioLogLevel["None"] = "none";
|
|
61
|
+
/** Only error messages */
|
|
62
|
+
CioLogLevel["Error"] = "error";
|
|
63
|
+
/** Error and informational messages */
|
|
64
|
+
CioLogLevel["Info"] = "info";
|
|
65
|
+
/** All messages including debug information */
|
|
66
|
+
CioLogLevel["Debug"] = "debug";
|
|
67
|
+
return CioLogLevel;
|
|
68
|
+
}({});
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Data center regions for CustomerIO API endpoints.
|
|
72
|
+
*
|
|
73
|
+
* @public
|
|
74
|
+
*/
|
|
75
|
+
export let CioRegion = /*#__PURE__*/function (CioRegion) {
|
|
76
|
+
CioRegion["US"] = "US";
|
|
77
|
+
CioRegion["EU"] = "EU";
|
|
78
|
+
return CioRegion;
|
|
79
|
+
}({});
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Screen view tracking behavior configuration.
|
|
83
|
+
*
|
|
84
|
+
* Defines how the SDK should handle automatic screen view events
|
|
85
|
+
* for analytics and in-app message targeting.
|
|
86
|
+
*
|
|
87
|
+
* @public
|
|
88
|
+
*/
|
|
89
|
+
export let ScreenView = /*#__PURE__*/function (ScreenView) {
|
|
90
|
+
/** Send screen events to destinations and display in-app messages */
|
|
91
|
+
ScreenView["All"] = "all";
|
|
92
|
+
/** Only display in-app messages, don't send to destinations */
|
|
93
|
+
ScreenView["InApp"] = "inApp";
|
|
94
|
+
return ScreenView;
|
|
95
|
+
}({});
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Location tracking mode for the CustomerIO Location module.
|
|
99
|
+
*
|
|
100
|
+
* @public
|
|
101
|
+
*/
|
|
102
|
+
export let CioLocationTrackingMode = /*#__PURE__*/function (CioLocationTrackingMode) {
|
|
103
|
+
/** Location tracking is disabled. All location operations no-op. */
|
|
104
|
+
CioLocationTrackingMode["Off"] = "OFF";
|
|
105
|
+
/** Host app controls when location is captured (default when location config is provided). */
|
|
106
|
+
CioLocationTrackingMode["Manual"] = "MANUAL";
|
|
107
|
+
/** SDK auto-captures location once per app launch when the app becomes active. */
|
|
108
|
+
CioLocationTrackingMode["OnAppStart"] = "ON_APP_START";
|
|
109
|
+
return CioLocationTrackingMode;
|
|
110
|
+
}({});
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Enum to specify the type of metric for tracking
|
|
114
|
+
*
|
|
115
|
+
* @public
|
|
116
|
+
*/
|
|
117
|
+
export let MetricEvent = /*#__PURE__*/function (MetricEvent) {
|
|
118
|
+
/** Push notification was delivered to the device */
|
|
119
|
+
MetricEvent["Delivered"] = "delivered";
|
|
120
|
+
/** Push notification was opened by the user */
|
|
121
|
+
MetricEvent["Opened"] = "opened";
|
|
122
|
+
/** Push notification resulted in a conversion */
|
|
123
|
+
MetricEvent["Converted"] = "converted";
|
|
124
|
+
return MetricEvent;
|
|
125
|
+
}({});
|
|
126
|
+
//# sourceMappingURL=data-pipelines.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["CioLogLevel","CioRegion","ScreenView","CioLocationTrackingMode","MetricEvent"],"sourceRoot":"../../../src","sources":["types/data-pipelines.ts"],"mappings":";;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA2BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAYA,WAAW,0BAAXA,WAAW;EACrB;EADUA,WAAW;EAGrB;EAHUA,WAAW;EAKrB;EALUA,WAAW;EAOrB;EAPUA,WAAW;EAAA,OAAXA,WAAW;AAAA;;AAWvB;AACA;AACA;AACA;AACA;AACA,WAAYC,SAAS,0BAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAAA,OAATA,SAAS;AAAA;;AAKrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAYC,UAAU,0BAAVA,UAAU;EACpB;EADUA,UAAU;EAGpB;EAHUA,UAAU;EAAA,OAAVA,UAAU;AAAA;;AAOtB;AACA;AACA;AACA;AACA;AACA,WAAYC,uBAAuB,0BAAvBA,uBAAuB;EACjC;EADUA,uBAAuB;EAGjC;EAHUA,uBAAuB;EAKjC;EALUA,uBAAuB;EAAA,OAAvBA,uBAAuB;AAAA;;AASnC;AACA;AACA;AACA;AACA;AACA,WAAYC,WAAW,0BAAXA,WAAW;EACrB;EADUA,WAAW;EAGrB;EAHUA,WAAW;EAKrB;EALUA,WAAW;EAAA,OAAXA,WAAW;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* In-app message data structure for event callbacks.
|
|
5
|
+
*
|
|
6
|
+
* Contains metadata about displayed in-app messages that can be used
|
|
7
|
+
* for tracking user interactions and message performance analytics.
|
|
8
|
+
*
|
|
9
|
+
* @public
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Enum to represent the type of event triggered by in-app event callback.
|
|
14
|
+
*
|
|
15
|
+
* @public
|
|
16
|
+
*/
|
|
17
|
+
export let InAppMessageEventType = /*#__PURE__*/function (InAppMessageEventType) {
|
|
18
|
+
InAppMessageEventType["errorWithMessage"] = "errorWithMessage";
|
|
19
|
+
InAppMessageEventType["messageActionTaken"] = "messageActionTaken";
|
|
20
|
+
InAppMessageEventType["messageDismissed"] = "messageDismissed";
|
|
21
|
+
InAppMessageEventType["messageShown"] = "messageShown";
|
|
22
|
+
return InAppMessageEventType;
|
|
23
|
+
}({});
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Represents an inbox message for a user.
|
|
27
|
+
*
|
|
28
|
+
* Inbox messages are persistent messages that can be displayed in a message center or inbox UI.
|
|
29
|
+
* They support read/unread states, expiration, and custom properties.
|
|
30
|
+
*
|
|
31
|
+
* @public
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Listener for notification inbox message changes.
|
|
36
|
+
*
|
|
37
|
+
* Receives real-time notifications when inbox messages are added, updated, or removed.
|
|
38
|
+
* Callbacks are invoked on the main thread for safe UI updates.
|
|
39
|
+
*
|
|
40
|
+
* @public
|
|
41
|
+
*/
|
|
42
|
+
//# sourceMappingURL=in-app.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["InAppMessageEventType"],"sourceRoot":"../../../src","sources":["types/in-app.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAUA;AACA;AACA;AACA;AACA;AACA,WAAYA,qBAAqB,0BAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAAA,OAArBA,qBAAqB;AAAA;;AAOjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAsBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/index.ts"],"mappings":";;AAAA,cAAc,qBAAkB;AAChC,cAAc,aAAU;AACxB,cAAc,WAAQ","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/internal.ts"],"mappings":"","ignoreList":[]}
|