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
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 Customer IO
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,451 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://zixflow.com">
|
|
3
|
+
<img src="https://zixflow.com/logo.svg" height="60">
|
|
4
|
+
</a>
|
|
5
|
+
</p>
|
|
6
|
+
|
|
7
|
+
[](https://www.npmjs.com/package/zixflow-reactnative)
|
|
8
|
+
[](https://www.npmjs.com/package/zixflow-reactnative)
|
|
9
|
+

|
|
10
|
+

|
|
11
|
+

|
|
12
|
+
[](CODE_OF_CONDUCT.md)
|
|
13
|
+
|
|
14
|
+
# Zixflow React Native SDK
|
|
15
|
+
|
|
16
|
+
The official Zixflow SDK for React Native enables you to integrate customer engagement features—like in-app messaging and push notifications—into your app. Track customer behavior, send targeted messages, and create personalized experiences.
|
|
17
|
+
|
|
18
|
+
> 📖 Full documentation: [zixflow.com/docs/sdk/react-native](https://zixflow.com/docs/sdk/react-native/)
|
|
19
|
+
> 🧪 Example apps: [see the `/example` directory](/example)
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## About Zixflow
|
|
24
|
+
|
|
25
|
+
Zixflow is a customer engagement platform built on proven Customer.io technology. This SDK is a customized fork of the Customer.io React Native SDK, optimized for use with the Zixflow platform.
|
|
26
|
+
|
|
27
|
+
### Key Features
|
|
28
|
+
|
|
29
|
+
- 📊 Customer identification and event tracking
|
|
30
|
+
- 📲 Push notifications (iOS APN and Android FCM)
|
|
31
|
+
- 💬 In-app messaging
|
|
32
|
+
- 📍 Location tracking (optional)
|
|
33
|
+
- 🎯 Personalized customer experiences
|
|
34
|
+
- 📈 Analytics and customer data pipelines
|
|
35
|
+
- 🔧 TypeScript support
|
|
36
|
+
- ⚡ React Native New Architecture (TurboModules) support
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Installation
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
npm install zixflow-reactnative
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
or
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
yarn add zixflow-reactnative
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## Quick Start
|
|
55
|
+
|
|
56
|
+
### SDK Initialization
|
|
57
|
+
|
|
58
|
+
Here's a simplified example showing how to initialize the SDK to enable mobile features:
|
|
59
|
+
|
|
60
|
+
```ts
|
|
61
|
+
import {
|
|
62
|
+
Zixflow,
|
|
63
|
+
ZixflowConfig,
|
|
64
|
+
CioLogLevel,
|
|
65
|
+
CioRegion,
|
|
66
|
+
} from 'zixflow-reactnative';
|
|
67
|
+
|
|
68
|
+
useEffect(() => {
|
|
69
|
+
const config: ZixflowConfig = {
|
|
70
|
+
cdpApiKey: 'your-api-key', // Required
|
|
71
|
+
migrationSiteId: 'your-site-id', // Optional, for migrating from older SDKs
|
|
72
|
+
region: CioRegion.US, // Or CioRegion.EU
|
|
73
|
+
logLevel: CioLogLevel.debug,
|
|
74
|
+
trackApplicationLifecycleEvents: true,
|
|
75
|
+
inApp: {
|
|
76
|
+
siteId: 'your-site-id', // Required for in-app messaging
|
|
77
|
+
},
|
|
78
|
+
push: {
|
|
79
|
+
android: {
|
|
80
|
+
pushClickBehavior: 'ActivityPreventRestart', // Optional
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
Zixflow.initialize(config);
|
|
86
|
+
}, []);
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
> 🔑 For help finding your credentials, check out the [Quick Start Guide](https://zixflow.com/docs/sdk/react-native/quick-start-guide/).
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## Core Features
|
|
94
|
+
|
|
95
|
+
### 👤 Identify Users
|
|
96
|
+
|
|
97
|
+
Associate events and devices with customer profiles:
|
|
98
|
+
|
|
99
|
+
```ts
|
|
100
|
+
Zixflow.identify({
|
|
101
|
+
userId: 'user123',
|
|
102
|
+
traits: {
|
|
103
|
+
email: 'user@example.com',
|
|
104
|
+
firstName: 'John',
|
|
105
|
+
lastName: 'Doe',
|
|
106
|
+
plan: 'premium',
|
|
107
|
+
},
|
|
108
|
+
});
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### 📊 Track Events
|
|
112
|
+
|
|
113
|
+
Track custom events to trigger messaging based on user behavior:
|
|
114
|
+
|
|
115
|
+
```ts
|
|
116
|
+
Zixflow.track('Product Viewed', {
|
|
117
|
+
productId: '12345',
|
|
118
|
+
productName: 'Awesome Product',
|
|
119
|
+
price: 49.99,
|
|
120
|
+
category: 'Electronics',
|
|
121
|
+
});
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### 📺 Screen Tracking
|
|
125
|
+
|
|
126
|
+
Track screen views in your app:
|
|
127
|
+
|
|
128
|
+
```ts
|
|
129
|
+
Zixflow.screen('Product Details', {
|
|
130
|
+
productId: '12345',
|
|
131
|
+
category: 'Electronics',
|
|
132
|
+
});
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### 🏷️ Set Profile Attributes
|
|
136
|
+
|
|
137
|
+
Update customer profile attributes:
|
|
138
|
+
|
|
139
|
+
```ts
|
|
140
|
+
Zixflow.setProfileAttributes({
|
|
141
|
+
plan: 'enterprise',
|
|
142
|
+
lastSeenAt: Date.now(),
|
|
143
|
+
preferences: {
|
|
144
|
+
notifications: true,
|
|
145
|
+
newsletter: true,
|
|
146
|
+
},
|
|
147
|
+
});
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## 📲 Push Notifications
|
|
153
|
+
|
|
154
|
+
This SDK supports rich push notifications using Firebase (for Android) and either Firebase or APNs (for iOS).
|
|
155
|
+
|
|
156
|
+
### Request Permission (iOS)
|
|
157
|
+
|
|
158
|
+
```ts
|
|
159
|
+
const status = await Zixflow.pushMessaging.showPromptForPushNotifications();
|
|
160
|
+
console.log('Push permission status:', status);
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### Handle Push Notifications
|
|
164
|
+
|
|
165
|
+
```ts
|
|
166
|
+
// Track when user receives a notification
|
|
167
|
+
Zixflow.pushMessaging.onMessageReceived((message) => {
|
|
168
|
+
console.log('Notification received:', message);
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
// Track when user clicks on a notification
|
|
172
|
+
Zixflow.pushMessaging.onBackgroundMessageReceived((message) => {
|
|
173
|
+
console.log('Notification clicked:', message);
|
|
174
|
+
});
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
Follow our [push setup guide](https://zixflow.com/docs/sdk/react-native/push/) to configure your project for push.
|
|
178
|
+
|
|
179
|
+
---
|
|
180
|
+
|
|
181
|
+
## 💬 In-App Messaging
|
|
182
|
+
|
|
183
|
+
Display in-app messages to your users:
|
|
184
|
+
|
|
185
|
+
```ts
|
|
186
|
+
import { InAppMessageEvent, InAppMessageEventType } from 'zixflow-reactnative';
|
|
187
|
+
|
|
188
|
+
// Register event listener
|
|
189
|
+
Zixflow.inAppMessaging.registerEventsListener((event: InAppMessageEvent) => {
|
|
190
|
+
switch (event.eventType) {
|
|
191
|
+
case InAppMessageEventType.MessageShown:
|
|
192
|
+
console.log('In-app message shown:', event.message);
|
|
193
|
+
break;
|
|
194
|
+
case InAppMessageEventType.MessageClicked:
|
|
195
|
+
console.log('In-app message clicked:', event.message);
|
|
196
|
+
break;
|
|
197
|
+
case InAppMessageEventType.MessageDismissed:
|
|
198
|
+
console.log('In-app message dismissed:', event.message);
|
|
199
|
+
break;
|
|
200
|
+
}
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
// Dismiss message programmatically
|
|
204
|
+
Zixflow.inAppMessaging.dismissMessage();
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
### Inbox Messages
|
|
208
|
+
|
|
209
|
+
Manage inbox messages:
|
|
210
|
+
|
|
211
|
+
```ts
|
|
212
|
+
const inbox = Zixflow.inAppMessaging.inbox();
|
|
213
|
+
|
|
214
|
+
// Get all messages
|
|
215
|
+
const messages = await inbox.getMessages();
|
|
216
|
+
|
|
217
|
+
// Mark message as read
|
|
218
|
+
await inbox.markMessageOpened(messageId);
|
|
219
|
+
|
|
220
|
+
// Delete message
|
|
221
|
+
await inbox.markMessageDeleted(messageId);
|
|
222
|
+
|
|
223
|
+
// Subscribe to inbox updates
|
|
224
|
+
inbox.subscribeToMessages((messages) => {
|
|
225
|
+
console.log('Inbox updated:', messages);
|
|
226
|
+
});
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
---
|
|
230
|
+
|
|
231
|
+
## 📍 Location Tracking
|
|
232
|
+
|
|
233
|
+
Track user location (optional feature):
|
|
234
|
+
|
|
235
|
+
```ts
|
|
236
|
+
Zixflow.location.setLastKnownLocation(latitude, longitude);
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
---
|
|
240
|
+
|
|
241
|
+
## Advanced Features
|
|
242
|
+
|
|
243
|
+
### Device Attributes
|
|
244
|
+
|
|
245
|
+
Set custom device attributes:
|
|
246
|
+
|
|
247
|
+
```ts
|
|
248
|
+
Zixflow.setDeviceAttributes({
|
|
249
|
+
deviceModel: 'iPhone 14 Pro',
|
|
250
|
+
appVersion: '2.1.0',
|
|
251
|
+
customAttribute: 'value',
|
|
252
|
+
});
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
### Register Device Token
|
|
256
|
+
|
|
257
|
+
Register a device token for push notifications:
|
|
258
|
+
|
|
259
|
+
```ts
|
|
260
|
+
Zixflow.registerDeviceToken('your-device-token');
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
### Clear Identification
|
|
264
|
+
|
|
265
|
+
Clear the current user identification:
|
|
266
|
+
|
|
267
|
+
```ts
|
|
268
|
+
Zixflow.clearIdentify();
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
---
|
|
272
|
+
|
|
273
|
+
## Platform-Specific Setup
|
|
274
|
+
|
|
275
|
+
### iOS Setup
|
|
276
|
+
|
|
277
|
+
1. Add pods to your `ios/Podfile`:
|
|
278
|
+
|
|
279
|
+
```ruby
|
|
280
|
+
pod 'zixflow-reactnative', :path => '../node_modules/zixflow-reactnative'
|
|
281
|
+
|
|
282
|
+
# For FCM push:
|
|
283
|
+
pod 'zixflow-reactnative/fcm', :path => '../node_modules/zixflow-reactnative'
|
|
284
|
+
|
|
285
|
+
# For APN push:
|
|
286
|
+
pod 'zixflow-reactnative/apn', :path => '../node_modules/zixflow-reactnative'
|
|
287
|
+
|
|
288
|
+
# For location tracking:
|
|
289
|
+
pod 'zixflow-reactnative/location', :path => '../node_modules/zixflow-reactnative'
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
2. Run `pod install` in the `ios` directory
|
|
293
|
+
|
|
294
|
+
3. Follow the [iOS push setup guide](https://zixflow.com/docs/sdk/react-native/push/ios)
|
|
295
|
+
|
|
296
|
+
### Android Setup
|
|
297
|
+
|
|
298
|
+
1. The SDK is automatically linked via autolinking
|
|
299
|
+
|
|
300
|
+
2. (Optional) Enable location tracking in `android/gradle.properties`:
|
|
301
|
+
|
|
302
|
+
```properties
|
|
303
|
+
zixflow_location_enabled=true
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
3. Follow the [Android push setup guide](https://zixflow.com/docs/sdk/react-native/push/android)
|
|
307
|
+
|
|
308
|
+
---
|
|
309
|
+
|
|
310
|
+
## Configuration Options
|
|
311
|
+
|
|
312
|
+
| Option | Type | Required | Description |
|
|
313
|
+
|--------|------|----------|-------------|
|
|
314
|
+
| `cdpApiKey` | `string` | ✅ | Your Zixflow API key |
|
|
315
|
+
| `migrationSiteId` | `string` | ❌ | Site ID for migration from older SDKs |
|
|
316
|
+
| `region` | `CioRegion` | ❌ | US or EU region (default: US) |
|
|
317
|
+
| `logLevel` | `CioLogLevel` | ❌ | Logging verbosity (default: error) |
|
|
318
|
+
| `trackApplicationLifecycleEvents` | `boolean` | ❌ | Auto-track app lifecycle events |
|
|
319
|
+
| `inApp` | `object` | ❌ | In-app messaging configuration |
|
|
320
|
+
| `push` | `object` | ❌ | Push notification configuration |
|
|
321
|
+
|
|
322
|
+
---
|
|
323
|
+
|
|
324
|
+
## TypeScript Support
|
|
325
|
+
|
|
326
|
+
This SDK is written in TypeScript and includes full type definitions:
|
|
327
|
+
|
|
328
|
+
```ts
|
|
329
|
+
import type {
|
|
330
|
+
Zixflow,
|
|
331
|
+
ZixflowConfig,
|
|
332
|
+
ZixflowInAppMessaging,
|
|
333
|
+
ZixflowPushMessaging,
|
|
334
|
+
ZixflowLocation,
|
|
335
|
+
CustomAttributes,
|
|
336
|
+
IdentifyParams,
|
|
337
|
+
InAppMessage,
|
|
338
|
+
InboxMessage,
|
|
339
|
+
} from 'zixflow-reactnative';
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
---
|
|
343
|
+
|
|
344
|
+
## Module APIs
|
|
345
|
+
|
|
346
|
+
Access specific SDK modules:
|
|
347
|
+
|
|
348
|
+
```ts
|
|
349
|
+
// In-app messaging
|
|
350
|
+
Zixflow.inAppMessaging.registerEventsListener(listener);
|
|
351
|
+
|
|
352
|
+
// Push messaging
|
|
353
|
+
Zixflow.pushMessaging.showPromptForPushNotifications();
|
|
354
|
+
|
|
355
|
+
// Location tracking
|
|
356
|
+
Zixflow.location.setLastKnownLocation(lat, lng);
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
Note: Due to JavaScript limitations, module properties return the internal implementation instances, but all functionality works as expected.
|
|
360
|
+
|
|
361
|
+
---
|
|
362
|
+
|
|
363
|
+
## Example App
|
|
364
|
+
|
|
365
|
+
Check out our comprehensive [example app](/example) that demonstrates:
|
|
366
|
+
|
|
367
|
+
- SDK initialization
|
|
368
|
+
- User identification
|
|
369
|
+
- Event tracking
|
|
370
|
+
- Push notifications
|
|
371
|
+
- In-app messaging
|
|
372
|
+
- Location tracking
|
|
373
|
+
- Inbox management
|
|
374
|
+
|
|
375
|
+
To run the example app:
|
|
376
|
+
|
|
377
|
+
```bash
|
|
378
|
+
cd example
|
|
379
|
+
npm install
|
|
380
|
+
|
|
381
|
+
# iOS
|
|
382
|
+
cd ios && pod install && cd ..
|
|
383
|
+
npx react-native run-ios
|
|
384
|
+
|
|
385
|
+
# Android
|
|
386
|
+
npx react-native run-android
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
---
|
|
390
|
+
|
|
391
|
+
## Troubleshooting
|
|
392
|
+
|
|
393
|
+
### Common Issues
|
|
394
|
+
|
|
395
|
+
**Issue: Build fails with "Zixflow pod not found"**
|
|
396
|
+
- Run `pod install` in your iOS directory
|
|
397
|
+
- Make sure you're using the correct pod name: `zixflow-reactnative`
|
|
398
|
+
|
|
399
|
+
**Issue: Push notifications not working**
|
|
400
|
+
- Verify your Firebase configuration (Android) or APNs certificates (iOS)
|
|
401
|
+
- Check that you've requested push permissions
|
|
402
|
+
- Ensure you've registered the device token
|
|
403
|
+
|
|
404
|
+
**Issue: In-app messages not showing**
|
|
405
|
+
- Verify you've configured `inApp.siteId` in the config
|
|
406
|
+
- Check that you've registered an events listener
|
|
407
|
+
- Ensure messages are targeted correctly in your Zixflow dashboard
|
|
408
|
+
|
|
409
|
+
For more help, see our [troubleshooting guide](https://zixflow.com/docs/sdk/react-native/troubleshooting/) or [open an issue](https://github.com/zixflow/zixflow-reactnative/issues).
|
|
410
|
+
|
|
411
|
+
---
|
|
412
|
+
|
|
413
|
+
## Requirements
|
|
414
|
+
|
|
415
|
+
- React Native 0.70+
|
|
416
|
+
- iOS 13+
|
|
417
|
+
- Android API 21+ (Android 5.0 Lollipop)
|
|
418
|
+
- Swift 5.3+
|
|
419
|
+
- Kotlin 1.8+
|
|
420
|
+
|
|
421
|
+
---
|
|
422
|
+
|
|
423
|
+
## Contributing
|
|
424
|
+
|
|
425
|
+
We welcome contributions! To get started:
|
|
426
|
+
|
|
427
|
+
1. Review our [example app](/example) to help with local development
|
|
428
|
+
2. Follow our [Code of Conduct](CODE_OF_CONDUCT.md)
|
|
429
|
+
3. Check out [DEVELOPMENT.md](DEVELOPMENT.md) for development guidelines
|
|
430
|
+
4. Open issues or pull requests on [GitHub](https://github.com/zixflow/zixflow-reactnative)
|
|
431
|
+
|
|
432
|
+
---
|
|
433
|
+
|
|
434
|
+
## Support
|
|
435
|
+
|
|
436
|
+
- 📚 [Documentation](https://zixflow.com/docs/sdk/react-native/)
|
|
437
|
+
- 💬 [Community Forum](https://community.zixflow.com)
|
|
438
|
+
- 🐛 [Issue Tracker](https://github.com/zixflow/zixflow-reactnative/issues)
|
|
439
|
+
- 📧 Email: apps@zixflow.com
|
|
440
|
+
|
|
441
|
+
---
|
|
442
|
+
|
|
443
|
+
## License
|
|
444
|
+
|
|
445
|
+
[MIT](LICENSE)
|
|
446
|
+
|
|
447
|
+
---
|
|
448
|
+
|
|
449
|
+
## Acknowledgments
|
|
450
|
+
|
|
451
|
+
This SDK is based on the Customer.io React Native SDK and maintains compatibility with the Customer.io platform while providing Zixflow-specific optimizations and branding.
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
buildscript {
|
|
2
|
+
// Buildscript is evaluated before everything else so we can't use getExtOrDefault
|
|
3
|
+
def kotlin_version = rootProject.ext.has('kotlinVersion') ? rootProject.ext.get('kotlinVersion') : project.properties['zixflow.reactnative.kotlinVersion']
|
|
4
|
+
|
|
5
|
+
repositories {
|
|
6
|
+
google()
|
|
7
|
+
mavenCentral()
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
dependencies {
|
|
11
|
+
// noinspection DifferentKotlinGradleVersion
|
|
12
|
+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
apply plugin: 'com.android.library'
|
|
17
|
+
apply plugin: 'kotlin-android'
|
|
18
|
+
apply plugin: "com.facebook.react"
|
|
19
|
+
|
|
20
|
+
def getExtOrDefault(name) {
|
|
21
|
+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['zixflow.reactnative.' + name]
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
def getExtOrIntegerDefault(name) {
|
|
25
|
+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties['zixflow.reactnative.' + name]).toInteger()
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
ext.zixflowLocationEnabled = rootProject.findProperty("zixflow_location_enabled")?.toBoolean() ?: false
|
|
29
|
+
|
|
30
|
+
android {
|
|
31
|
+
namespace = 'io.customer.reactnative.sdk'
|
|
32
|
+
compileSdkVersion getExtOrIntegerDefault('compileSdkVersion')
|
|
33
|
+
defaultConfig {
|
|
34
|
+
minSdkVersion getExtOrIntegerDefault('minSdkVersion')
|
|
35
|
+
targetSdkVersion getExtOrIntegerDefault('targetSdkVersion')
|
|
36
|
+
buildConfigField "boolean", "CIO_LOCATION_ENABLED", "${project.zixflowLocationEnabled}"
|
|
37
|
+
consumerProguardFiles 'consumer-rules.pro'
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
buildFeatures {
|
|
41
|
+
buildConfig true
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
buildTypes {
|
|
45
|
+
release {
|
|
46
|
+
minifyEnabled false
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
lintOptions {
|
|
50
|
+
disable 'GradleCompatible'
|
|
51
|
+
}
|
|
52
|
+
compileOptions {
|
|
53
|
+
sourceCompatibility JavaVersion.VERSION_17
|
|
54
|
+
targetCompatibility JavaVersion.VERSION_17
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
repositories {
|
|
59
|
+
mavenCentral()
|
|
60
|
+
google()
|
|
61
|
+
|
|
62
|
+
def found = false
|
|
63
|
+
def defaultDir = null
|
|
64
|
+
def androidSourcesName = 'React Native sources'
|
|
65
|
+
|
|
66
|
+
if (rootProject.ext.has('reactNativeAndroidRoot')) {
|
|
67
|
+
defaultDir = rootProject.ext.get('reactNativeAndroidRoot')
|
|
68
|
+
} else {
|
|
69
|
+
defaultDir = new File(
|
|
70
|
+
projectDir,
|
|
71
|
+
'/../../../node_modules/react-native/android'
|
|
72
|
+
)
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
if (defaultDir.exists()) {
|
|
76
|
+
maven {
|
|
77
|
+
url defaultDir.toString()
|
|
78
|
+
name androidSourcesName
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
logger.info(":${project.name}:reactNativeAndroidRoot ${defaultDir.canonicalPath}")
|
|
82
|
+
found = true
|
|
83
|
+
} else {
|
|
84
|
+
def parentDir = rootProject.projectDir
|
|
85
|
+
|
|
86
|
+
1.upto(5, {
|
|
87
|
+
if (found) return true
|
|
88
|
+
parentDir = parentDir.parentFile
|
|
89
|
+
|
|
90
|
+
def androidSourcesDir = new File(
|
|
91
|
+
parentDir,
|
|
92
|
+
'node_modules/react-native'
|
|
93
|
+
)
|
|
94
|
+
|
|
95
|
+
def androidPrebuiltBinaryDir = new File(
|
|
96
|
+
parentDir,
|
|
97
|
+
'node_modules/react-native/android'
|
|
98
|
+
)
|
|
99
|
+
|
|
100
|
+
if (androidPrebuiltBinaryDir.exists()) {
|
|
101
|
+
maven {
|
|
102
|
+
url = androidPrebuiltBinaryDir.toString()
|
|
103
|
+
name = androidSourcesName
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
logger.info(":${project.name}:reactNativeAndroidRoot ${androidPrebuiltBinaryDir.canonicalPath}")
|
|
107
|
+
found = true
|
|
108
|
+
} else if (androidSourcesDir.exists()) {
|
|
109
|
+
maven {
|
|
110
|
+
url = androidSourcesDir.toString()
|
|
111
|
+
name = androidSourcesName
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
logger.info(":${project.name}:reactNativeAndroidRoot ${androidSourcesDir.canonicalPath}")
|
|
115
|
+
found = true
|
|
116
|
+
}
|
|
117
|
+
})
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
if (!found) {
|
|
121
|
+
throw new GradleException(
|
|
122
|
+
"${project.name}: unable to locate React Native android sources. " +
|
|
123
|
+
"Ensure you have you installed React Native as a dependency in your project and try again."
|
|
124
|
+
)
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
def kotlin_version = getExtOrDefault('kotlinVersion')
|
|
129
|
+
ext.zixflowAndroidSDKVersion = getExtOrDefault('sdkVersionAndroid')
|
|
130
|
+
|
|
131
|
+
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
|
|
132
|
+
kotlinOptions {
|
|
133
|
+
freeCompilerArgs += [
|
|
134
|
+
'-Xopt-in=kotlin.RequiresOptIn',
|
|
135
|
+
'-Xopt-in=io.customer.base.internal.InternalCustomerIOApi',
|
|
136
|
+
]
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
|
|
141
|
+
kotlinOptions {
|
|
142
|
+
freeCompilerArgs += [
|
|
143
|
+
'-Xopt-in=kotlin.RequiresOptIn',
|
|
144
|
+
'-Xopt-in=io.customer.base.internal.InternalCustomerIOApi',
|
|
145
|
+
]
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
apply from: "./cio-core.gradle"
|
|
150
|
+
|
|
151
|
+
dependencies {
|
|
152
|
+
// noinspection GradleDynamicVersion
|
|
153
|
+
api 'com.facebook.react:react-native:+'
|
|
154
|
+
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
155
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
dependencies {
|
|
2
|
+
api "com.zixflow.com.android:datapipelines:$zixflowAndroidSDKVersion"
|
|
3
|
+
api "com.zixflow.com.android:messaging-push-fcm:$zixflowAndroidSDKVersion"
|
|
4
|
+
api "com.zixflow.com.android:messaging-in-app:$zixflowAndroidSDKVersion"
|
|
5
|
+
// Location module is optional - customers enable it by adding
|
|
6
|
+
// zixflow_location_enabled=true in their gradle.properties
|
|
7
|
+
if (project.zixflowLocationEnabled) {
|
|
8
|
+
api "com.zixflow.com.android:location:$zixflowAndroidSDKVersion"
|
|
9
|
+
} else {
|
|
10
|
+
compileOnly "com.zixflow.com.android:location:$zixflowAndroidSDKVersion"
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
|
3
|
+
|
|
4
|
+
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
|
5
|
+
|
|
6
|
+
<application>
|
|
7
|
+
<!--
|
|
8
|
+
Provide source and version of Customer.io React Native SDK so user agent can be
|
|
9
|
+
generated based on this information.
|
|
10
|
+
-->
|
|
11
|
+
<meta-data
|
|
12
|
+
android:name="io.customer.sdk.android.core.SDK_SOURCE"
|
|
13
|
+
android:value="@string/customer_io_react_native_sdk_client_source" />
|
|
14
|
+
<meta-data
|
|
15
|
+
android:name="io.customer.sdk.android.core.SDK_VERSION"
|
|
16
|
+
android:value="@string/customer_io_react_native_sdk_client_version" />
|
|
17
|
+
</application>
|
|
18
|
+
|
|
19
|
+
</manifest>
|