Przeglądaj źródła

fix(ios): use correct class to call plugin command with `throws` (#6830)

Lucas Fernandes Nogueira 2 lat temu
rodzic
commit
bb2a8ccf13

+ 5 - 0
.changes/fix-ios-plugin-throws-command.md

@@ -0,0 +1,5 @@
+---
+"tauri": patch
+---
+
+Use actual iOS plugin instance to run command with `throws`.

+ 1 - 1
core/tauri/mobile/ios-api/Sources/Tauri/Tauri.swift

@@ -64,7 +64,7 @@ public class PluginManager {
 					var error: NSError? = nil
 					withUnsafeMutablePointer(to: &error) {
 						let methodIMP: IMP! = plugin.instance.method(for: selectorWithThrows)
-						unsafeBitCast(methodIMP, to: (@convention(c)(Any?, Selector, Invoke, OpaquePointer) -> Void).self)(plugin, selectorWithThrows, invoke, OpaquePointer($0))
+						unsafeBitCast(methodIMP, to: (@convention(c)(Any?, Selector, Invoke, OpaquePointer) -> Void).self)(plugin.instance, selectorWithThrows, invoke, OpaquePointer($0))
 					}
 					if let error = error {
 						invoke.reject("\(error)")