From d4c3a64d8b8a4538f4ca8587e029aa8a0857b4d2 Mon Sep 17 00:00:00 2001 From: Rehan Date: Fri, 30 Aug 2024 17:08:57 +0500 Subject: [PATCH] chore: wrap unit calls with boolean --- .../kotlin/io/customer/customer_io/CustomerIOExtensions.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/android/src/main/kotlin/io/customer/customer_io/CustomerIOExtensions.kt b/android/src/main/kotlin/io/customer/customer_io/CustomerIOExtensions.kt index 9f2dbff..138a65a 100644 --- a/android/src/main/kotlin/io/customer/customer_io/CustomerIOExtensions.kt +++ b/android/src/main/kotlin/io/customer/customer_io/CustomerIOExtensions.kt @@ -26,7 +26,12 @@ internal fun MethodCall.invokeNative( try { @Suppress("UNCHECKED_CAST") val params = this.arguments as? Map ?: emptyMap() - result.success(performAction(params)) + val actionResult = performAction(params) + if (actionResult is Unit) { + result.success(true) + } else { + result.success(actionResult) + } } catch (ex: Exception) { result.error(this.method, ex.localizedMessage, ex) }