From 36d9cfeb3b99c6a4d2a08ac1b3ef7ed49707cad3 Mon Sep 17 00:00:00 2001 From: Tafel <35837839+tafelnl@users.noreply.github.com> Date: Thu, 6 Jun 2024 12:39:16 +0200 Subject: [PATCH] fix: add correct return type and resolve call (#15) --- .../com/getcapacitor/community/safearea/SafeAreaPlugin.kt | 8 ++++++-- ios/Plugin/SafeAreaPlugin.m | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/android/src/main/java/com/getcapacitor/community/safearea/SafeAreaPlugin.kt b/android/src/main/java/com/getcapacitor/community/safearea/SafeAreaPlugin.kt index 5b621191..86a8eb85 100644 --- a/android/src/main/java/com/getcapacitor/community/safearea/SafeAreaPlugin.kt +++ b/android/src/main/java/com/getcapacitor/community/safearea/SafeAreaPlugin.kt @@ -20,7 +20,7 @@ class SafeAreaPlugin : Plugin() { } } - @PluginMethod + @PluginMethod(returnType = PluginMethod.RETURN_NONE) fun enable(call: PluginCall) { val jsonObject = call.getObject("config") @@ -30,11 +30,15 @@ class SafeAreaPlugin : Plugin() { val appearanceConfig = AppearanceConfig(jsonObject) implementation?.enable(true, appearanceConfig) + + call.resolve() } - @PluginMethod + @PluginMethod(returnType = PluginMethod.RETURN_NONE) fun disable(call: PluginCall) { val appearanceConfig = AppearanceConfig(call.getObject("config")) implementation?.disable(appearanceConfig) + + call.resolve() } } diff --git a/ios/Plugin/SafeAreaPlugin.m b/ios/Plugin/SafeAreaPlugin.m index 1d1b9053..860009c2 100644 --- a/ios/Plugin/SafeAreaPlugin.m +++ b/ios/Plugin/SafeAreaPlugin.m @@ -4,6 +4,6 @@ // Define the plugin using the CAP_PLUGIN Macro, and // each method the plugin supports using the CAP_PLUGIN_METHOD macro. CAP_PLUGIN(SafeAreaPlugin, "SafeArea", - CAP_PLUGIN_METHOD(enable, CAPPluginReturnPromise); - CAP_PLUGIN_METHOD(disable, CAPPluginReturnPromise); + CAP_PLUGIN_METHOD(enable, CAPPluginReturnNone); + CAP_PLUGIN_METHOD(disable, CAPPluginReturnNone); )