diff --git a/.changes/fix-ios-plugin-throws-command.md b/.changes/fix-ios-plugin-throws-command.md new file mode 100644 index 00000000000..97c74bf53a0 --- /dev/null +++ b/.changes/fix-ios-plugin-throws-command.md @@ -0,0 +1,5 @@ +--- +"tauri": patch +--- + +Use actual iOS plugin instance to run command with `throws`. diff --git a/core/tauri/mobile/ios-api/Sources/Tauri/Tauri.swift b/core/tauri/mobile/ios-api/Sources/Tauri/Tauri.swift index a9e3a9928b7..330a3974105 100644 --- a/core/tauri/mobile/ios-api/Sources/Tauri/Tauri.swift +++ b/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)")