diff --git a/android/gradle.properties b/android/gradle.properties index ea94999e..12593945 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -2,4 +2,4 @@ customerio.reactnative.kotlinVersion=1.7.21 customerio.reactnative.compileSdkVersion=30 customerio.reactnative.targetSdkVersion=30 customerio.reactnative.minSdkVersion=21 -customerio.reactnative.cioSDKVersionAndroid=3.6.5 \ No newline at end of file +customerio.reactnative.cioSDKVersionAndroid=rehan-push-click-behavior-SNAPSHOT \ No newline at end of file diff --git a/android/src/main/java/io/customer/reactnative/sdk/CustomerIOReactNativeInstance.kt b/android/src/main/java/io/customer/reactnative/sdk/CustomerIOReactNativeInstance.kt index d77dde9f..9f51967d 100644 --- a/android/src/main/java/io/customer/reactnative/sdk/CustomerIOReactNativeInstance.kt +++ b/android/src/main/java/io/customer/reactnative/sdk/CustomerIOReactNativeInstance.kt @@ -7,6 +7,7 @@ import io.customer.messaginginapp.ModuleMessagingInApp import io.customer.messaginginapp.type.InAppEventListener import io.customer.messagingpush.MessagingPushModuleConfig import io.customer.messagingpush.ModuleMessagingPushFCM +import io.customer.messagingpush.config.NotificationClickBehavior import io.customer.reactnative.sdk.constant.Keys import io.customer.reactnative.sdk.extension.* import io.customer.sdk.CustomerIO @@ -64,6 +65,7 @@ object CustomerIOReactNativeInstance { sourceSDK?.equals( other = "expo", ignoreCase = true, ) == true -> Client.Expo(sdkVersion = sourceSDKVersion) + else -> Client.ReactNative(sdkVersion = sourceSDKVersion) } } @@ -94,6 +96,16 @@ object CustomerIOReactNativeInstance { config?.getProperty(Keys.Config.AUTO_TRACK_PUSH_EVENTS)?.let { value -> setAutoTrackPushEvents(autoTrackPushEvents = value) } + config?.getProperty(Keys.Config.PUSH_CLICK_BEHAVIOR) + ?.takeIfNotBlank() + ?.let { value -> + val behavior = kotlin.runCatching { + enumValueOf(value) + }.getOrNull() + if (behavior != null) { + setNotificationClickBehavior(notificationOnClickBehavior = behavior) + } + } }.build(), ) } diff --git a/android/src/main/java/io/customer/reactnative/sdk/constant/Keys.kt b/android/src/main/java/io/customer/reactnative/sdk/constant/Keys.kt index b229bae6..f7e38b31 100644 --- a/android/src/main/java/io/customer/reactnative/sdk/constant/Keys.kt +++ b/android/src/main/java/io/customer/reactnative/sdk/constant/Keys.kt @@ -15,6 +15,7 @@ internal object Keys { const val AUTO_TRACK_PUSH_EVENTS = "autoTrackPushEvents" const val BACKGROUND_QUEUE_MIN_NUMBER_OF_TASKS = "backgroundQueueMinNumberOfTasks" const val BACKGROUND_QUEUE_SECONDS_DELAY = "backgroundQueueSecondsDelay" + const val PUSH_CLICK_BEHAVIOR = "androidPushClickBehavior" } object PackageConfig { diff --git a/src/CustomerioConfig.tsx b/src/CustomerioConfig.tsx index 420fb582..8e139ae7 100644 --- a/src/CustomerioConfig.tsx +++ b/src/CustomerioConfig.tsx @@ -41,4 +41,4 @@ class PackageConfig { source: string = ''; } -export { CustomerioConfig, CustomerIOEnv, PackageConfig }; +export { CustomerIOEnv, CustomerioConfig, PackageConfig };