Skip to content

Commit

Permalink
fix: add correct return type and resolve call (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
tafelnl authored Jun 6, 2024
1 parent 41228c5 commit 36d9cfe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class SafeAreaPlugin : Plugin() {
}
}

@PluginMethod
@PluginMethod(returnType = PluginMethod.RETURN_NONE)
fun enable(call: PluginCall) {
val jsonObject = call.getObject("config")

Expand All @@ -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()
}
}
4 changes: 2 additions & 2 deletions ios/Plugin/SafeAreaPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -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);
)

0 comments on commit 36d9cfe

Please sign in to comment.