From e67eba34655a8f1313115d57092e1e6a4c8fe836 Mon Sep 17 00:00:00 2001 From: David Date: Fri, 3 Jan 2025 19:43:11 -0800 Subject: [PATCH 1/2] Remove duplicate flutter track interaction call --- .../kotlin/com/airship/flutter/AirshipPlugin.kt | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/android/src/main/kotlin/com/airship/flutter/AirshipPlugin.kt b/android/src/main/kotlin/com/airship/flutter/AirshipPlugin.kt index f565e1c7..050f40e7 100644 --- a/android/src/main/kotlin/com/airship/flutter/AirshipPlugin.kt +++ b/android/src/main/kotlin/com/airship/flutter/AirshipPlugin.kt @@ -277,22 +277,7 @@ class AirshipPlugin : FlutterPlugin, MethodCallHandler, ActivityAware { } // Live Activities - "featureFlagManager#trackInteraction" -> { - result.resolveDeferred(call) { callback -> - scope.launch { - try { - val args = call.jsonArgs() - val wrapped = JsonValue.wrap(args) - val featureFlagProxy = FeatureFlagProxy(wrapped) - proxy.featureFlagManager.trackInteraction(flag = featureFlagProxy) - callback(null, null) - } catch (e: Exception) { - callback(null, e) - } - } - } - } "liveUpdate#start" -> result.resolveResult(call) { try { From 3521b931f8b2eaef416a549aa15697ab1896836a Mon Sep 17 00:00:00 2001 From: David Date: Sun, 5 Jan 2025 08:54:04 -0800 Subject: [PATCH 2/2] Use resolveDeferred instead of resolveResult --- .../src/main/kotlin/com/airship/flutter/AirshipPlugin.kt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/android/src/main/kotlin/com/airship/flutter/AirshipPlugin.kt b/android/src/main/kotlin/com/airship/flutter/AirshipPlugin.kt index 050f40e7..58510899 100644 --- a/android/src/main/kotlin/com/airship/flutter/AirshipPlugin.kt +++ b/android/src/main/kotlin/com/airship/flutter/AirshipPlugin.kt @@ -176,9 +176,14 @@ class AirshipPlugin : FlutterPlugin, MethodCallHandler, ActivityAware { } } "push#isUserNotificationsEnabled" -> result.resolveResult(call) { proxy.push.isUserNotificationsEnabled() } - "push#getNotificationStatus" -> result.resolveResult(call) { + "push#getNotificationStatus" -> result.resolveDeferred(call) { callback -> coroutineScope.launch { - proxy.push.getNotificationStatus() + try { + val status = proxy.push.getNotificationStatus() + callback(status, null) + } catch (e: Exception) { + callback(null, e) + } } } "push#getActiveNotifications" -> result.resolveResult(call) {