From cb9b53b3b1704113e93819029a8ac2d0f783a423 Mon Sep 17 00:00:00 2001 From: ami-aman <91549653+ami-aman@users.noreply.github.com> Date: Tue, 3 Sep 2024 00:49:23 +0530 Subject: [PATCH] identify method fixed --- .../sdk/CustomerIOReactNativeModule.kt | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/android/src/main/java/io/customer/reactnative/sdk/CustomerIOReactNativeModule.kt b/android/src/main/java/io/customer/reactnative/sdk/CustomerIOReactNativeModule.kt index 98083875..22069731 100644 --- a/android/src/main/java/io/customer/reactnative/sdk/CustomerIOReactNativeModule.kt +++ b/android/src/main/java/io/customer/reactnative/sdk/CustomerIOReactNativeModule.kt @@ -47,28 +47,27 @@ class NativeCustomerIOModule( logLevel: String) { val packageConfig = configJson.toMap() val cdpApiKey = packageConfig[Keys.Config.CDP_API_KEY] - try { val builder = CustomerIOBuilder( applicationContext = reactApplicationContext.applicationContext as Application, cdpApiKey = cdpApiKey.toString() ).apply { - packageConfig[Keys.Config.AUTO_TRACK_DEVICE_ATTRIBUTES] as? Boolean + (packageConfig[Keys.Config.AUTO_TRACK_DEVICE_ATTRIBUTES] as? Boolean) ?.let { autoTrackDeviceAttributes(it) } - packageConfig[Keys.Config.MIGRATION_SITE_ID] as? String + (packageConfig[Keys.Config.MIGRATION_SITE_ID] as? String) ?.let { migrationSiteId(it) } - packageConfig[Keys.Config.REGION] as? String + (packageConfig[Keys.Config.REGION] as? String) ?.let { region(Region.getRegion(it)) } - logLevel(CioLogLevel.getLogLevel(logLevel)) - packageConfig[Keys.Config.FLUSH_AT] as? Int + logLevel(CioLogLevel.getLogLevel(logLevel)) + (packageConfig[Keys.Config.FLUSH_AT] as? Int) ?.let { flushAt(it) } - packageConfig[Keys.Config.FLUSH_INTERVAL] as? Int + (packageConfig[Keys.Config.FLUSH_INTERVAL] as? Int) ?.let { flushInterval(it) } - packageConfig[Keys.Config.TRACK_APP_LIFECYCLE_EVENTS] as? Boolean + (packageConfig[Keys.Config.TRACK_APP_LIFECYCLE_EVENTS] as? Boolean) ?.let { trackApplicationLifecycleEvents(it) } // TODO: Implement pushClickBehaviorAndroid when initializing messagingModule - } + }.build() logger.info("Customer.io instance initialized successfully from app") }