Skip to content

Commit

Permalink
added config
Browse files Browse the repository at this point in the history
  • Loading branch information
Shahroz16 committed Jan 2, 2025
1 parent f44f157 commit 13be69c
Show file tree
Hide file tree
Showing 9 changed files with 66 additions and 50 deletions.
88 changes: 44 additions & 44 deletions Apps/APN/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,44 +3,44 @@ PODS:
- JSONSafeEncoding (= 2.0.0)
- Sovran (= 1.1.1)
- boost (1.83.0)
- customerio-reactnative (4.1.0):
- customerio-reactnative/nopush (= 4.1.0)
- CustomerIO/DataPipelines (= 3.6.0)
- CustomerIO/MessagingInApp (= 3.6.0)
- customerio-reactnative (4.1.1):
- customerio-reactnative/nopush (= 4.1.1)
- CustomerIO/DataPipelines (= 3.7.0)
- CustomerIO/MessagingInApp (= 3.7.0)
- React-Core
- customerio-reactnative-richpush/apn (4.1.0):
- CustomerIO/MessagingPushAPN (= 3.6.0)
- customerio-reactnative/apn (4.1.0):
- CustomerIO/DataPipelines (= 3.6.0)
- CustomerIO/MessagingInApp (= 3.6.0)
- CustomerIO/MessagingPushAPN (= 3.6.0)
- customerio-reactnative-richpush/apn (4.1.1):
- CustomerIO/MessagingPushAPN (= 3.7.0)
- customerio-reactnative/apn (4.1.1):
- CustomerIO/DataPipelines (= 3.7.0)
- CustomerIO/MessagingInApp (= 3.7.0)
- CustomerIO/MessagingPushAPN (= 3.7.0)
- React-Core
- customerio-reactnative/nopush (4.1.0):
- CustomerIO/DataPipelines (= 3.6.0)
- CustomerIO/MessagingInApp (= 3.6.0)
- CustomerIO/MessagingPush (= 3.6.0)
- customerio-reactnative/nopush (4.1.1):
- CustomerIO/DataPipelines (= 3.7.0)
- CustomerIO/MessagingInApp (= 3.7.0)
- CustomerIO/MessagingPush (= 3.7.0)
- React-Core
- CustomerIO/DataPipelines (3.6.0):
- CustomerIODataPipelines (= 3.6.0)
- CustomerIO/MessagingInApp (3.6.0):
- CustomerIOMessagingInApp (= 3.6.0)
- CustomerIO/MessagingPush (3.6.0):
- CustomerIOMessagingPush (= 3.6.0)
- CustomerIO/MessagingPushAPN (3.6.0):
- CustomerIOMessagingPushAPN (= 3.6.0)
- CustomerIOCommon (3.6.0)
- CustomerIODataPipelines (3.6.0):
- CustomerIO/DataPipelines (3.7.0):
- CustomerIODataPipelines (= 3.7.0)
- CustomerIO/MessagingInApp (3.7.0):
- CustomerIOMessagingInApp (= 3.7.0)
- CustomerIO/MessagingPush (3.7.0):
- CustomerIOMessagingPush (= 3.7.0)
- CustomerIO/MessagingPushAPN (3.7.0):
- CustomerIOMessagingPushAPN (= 3.7.0)
- CustomerIOCommon (3.7.0)
- CustomerIODataPipelines (3.7.0):
- "AnalyticsSwiftCIO (= 1.5.14+cio.1)"
- CustomerIOCommon (= 3.6.0)
- CustomerIOTrackingMigration (= 3.6.0)
- CustomerIOMessagingInApp (3.6.0):
- CustomerIOCommon (= 3.6.0)
- CustomerIOMessagingPush (3.6.0):
- CustomerIOCommon (= 3.6.0)
- CustomerIOMessagingPushAPN (3.6.0):
- CustomerIOMessagingPush (= 3.6.0)
- CustomerIOTrackingMigration (3.6.0):
- CustomerIOCommon (= 3.6.0)
- CustomerIOCommon (= 3.7.0)
- CustomerIOTrackingMigration (= 3.7.0)
- CustomerIOMessagingInApp (3.7.0):
- CustomerIOCommon (= 3.7.0)
- CustomerIOMessagingPush (3.7.0):
- CustomerIOCommon (= 3.7.0)
- CustomerIOMessagingPushAPN (3.7.0):
- CustomerIOMessagingPush (= 3.7.0)
- CustomerIOTrackingMigration (3.7.0):
- CustomerIOCommon (= 3.7.0)
- DoubleConversion (1.1.6)
- FBLazyVector (0.73.6)
- FBReactNativeSpec (0.73.6):
Expand Down Expand Up @@ -1327,15 +1327,15 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
AnalyticsSwiftCIO: d03712b33e85baecc86f0d38a6d53c97f7bc5bd1
boost: d3f49c53809116a5d38da093a8aa78bf551aed09
CustomerIO: 6b1af81928a0302d884f116295b7e8610636e809
customerio-reactnative: dce3adb93dea0dfb775e1c6682b141e02fefcb77
customerio-reactnative-richpush: e55473741f992fb56f42d41128b26f82c4ec4f91
CustomerIOCommon: b33c69e670c2a9295750e20fe1c70282fc0a223f
CustomerIODataPipelines: 2de3237d302176d282d0d9dbc208410921bda351
CustomerIOMessagingInApp: d53ad8cc06551cc1a4e65be038470c061597c22a
CustomerIOMessagingPush: 2eb6db3a2edcbb679f314fd0431f86c5fe2fefbf
CustomerIOMessagingPushAPN: 00d4593f6a0b740c4841cdebe4cbfce3e8a718a2
CustomerIOTrackingMigration: 5b0dbdf3d5f3eaa6bb15e4827a7557e1e0ba826f
CustomerIO: affbf1835ac52f036b29c48a4812059c3cd43bbd
customerio-reactnative: 8a3ecd910d0c5360b2a21592bdde9672d1da9ae0
customerio-reactnative-richpush: 4baa03763d4005ca7417db9c69071751cf0ce9a6
CustomerIOCommon: 1ce257dc98cb8eba90ecb2451e830841a923f36e
CustomerIODataPipelines: 5e98637280bc446ff186a2fab4568b10cf6caeb6
CustomerIOMessagingInApp: 0a46fc42c7bb27a494334b2642f179d594cf7c0b
CustomerIOMessagingPush: 4c7fcc0fbf3d9071d049864176325542df47b438
CustomerIOMessagingPushAPN: 33aba5e79cac89509e2ee8baa1dc8fc83c0970aa
CustomerIOTrackingMigration: ba11fbe57c2b9e64800b66c6bd7c9728eb4f483e
DoubleConversion: fea03f2699887d960129cc54bba7e52542b6f953
FBLazyVector: f64d1e2ea739b4d8f7e4740cde18089cd97fe864
FBReactNativeSpec: 9f2b8b243131565335437dba74923a8d3015e780
Expand Down Expand Up @@ -1400,4 +1400,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: 4fd33e739b5364991c8ac49c0c56e7b4a80e4c02

COCOAPODS: 1.16.2
COCOAPODS: 1.15.2
4 changes: 2 additions & 2 deletions Apps/APN/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ customerio.reactnative.kotlinVersion=1.7.21
customerio.reactnative.compileSdkVersion=33
customerio.reactnative.targetSdkVersion=33
customerio.reactnative.minSdkVersion=21
customerio.reactnative.cioSDKVersionAndroid=4.4.0
customerio.reactnative.cioSDKVersionAndroid=4.5.0
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import io.customer.reactnative.sdk.extension.getTypedValue
import io.customer.reactnative.sdk.extension.toMap
import io.customer.reactnative.sdk.messaginginapp.RNCIOInAppMessaging
import io.customer.reactnative.sdk.messagingpush.RNCIOPushMessaging
import io.customer.datapipelines.config.ScreenView
import io.customer.sdk.CustomerIO
import io.customer.sdk.CustomerIOBuilder
import io.customer.sdk.core.di.SDKComponent
Expand Down Expand Up @@ -44,13 +45,15 @@ class CustomerIOReactNativeModule(
val logLevelRawValue = packageConfig.getTypedValue<String>(Keys.Config.LOG_LEVEL)
val regionRawValue = packageConfig.getTypedValue<String>(Keys.Config.REGION)
val region = regionRawValue.let { Region.getRegion(it) }
val screenViewRawValue = packageConfig.getTypedValue<String>(Keys.Config.SCREEN_VIEW_USE)

CustomerIOBuilder(
applicationContext = reactApplicationContext.applicationContext as Application,
cdpApiKey = cdpApiKey
).apply {
logLevelRawValue?.let { logLevel(CioLogLevel.getLogLevel(it)) }
regionRawValue?.let { region(region) }
screenViewRawValue?.let { screenViewUse(ScreenView.getScreenView(it)) }

packageConfig.getTypedValue<Boolean>(Keys.Config.AUTO_TRACK_DEVICE_ATTRIBUTES)
?.let { autoTrackDeviceAttributes(it) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ internal object Keys {
const val TRACK_APP_LIFECYCLE_EVENTS = "trackApplicationLifecycleEvents"
const val FLUSH_AT = "flushAt"
const val FLUSH_INTERVAL = "flushInterval"
const val SCREEN_VIEW_USE = "screenViewUse"
// Push messaging
const val PUSH_CLICK_BEHAVIOR = "pushClickBehavior"
}
Expand Down
1 change: 1 addition & 0 deletions ios/wrappers/utils/CioConfigUtils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ extension SDKConfigBuilder {
case cdnHost
case flushAt
case flushInterval
case screenViewUse
case trackApplicationLifecycleEvents
case autoTrackDeviceAttributes
}
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"react-native": "src/index",
"source": "src/index",
"expoVersion": "",
"cioNativeiOSSdkVersion": "= 3.6.0",
"cioNativeiOSSdkVersion": "= 3.7.0",
"files": [
"src",
"lib",
Expand Down
11 changes: 11 additions & 0 deletions src/cio-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@ export enum CioRegion {
EU = 'EU',
}

/**
* Enum to define how CustomerIO SDK should handle screen view events.
* - all: Send screen events to destinations for analytics purposes and to display in-app messages
* - inApp: Only display in-app messages and not send screen events to destinations
*/
export enum ScreenView {
All = 'all',
InApp = 'inApp'
}

export enum CioLogLevel {
None = 'none',
Error = 'error',
Expand All @@ -23,6 +33,7 @@ export type CioConfig = {
logLevel?: CioLogLevel;
flushAt?: number;
flushInterval?: number;
screenViewUse?: ScreenView;
trackApplicationLifecycleEvents?: boolean;
autoTrackDeviceAttributes?: boolean;
inApp?: {
Expand Down

0 comments on commit 13be69c

Please sign in to comment.