Skip to content

Commit bb2a8cc

Browse files
authored
fix(ios): use correct class to call plugin command with throws (#6830)
1 parent edb16d1 commit bb2a8cc

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"tauri": patch
3+
---
4+
5+
Use actual iOS plugin instance to run command with `throws`.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public class PluginManager {
6464
var error: NSError? = nil
6565
withUnsafeMutablePointer(to: &error) {
6666
let methodIMP: IMP! = plugin.instance.method(for: selectorWithThrows)
67-
unsafeBitCast(methodIMP, to: (@convention(c)(Any?, Selector, Invoke, OpaquePointer) -> Void).self)(plugin, selectorWithThrows, invoke, OpaquePointer($0))
67+
unsafeBitCast(methodIMP, to: (@convention(c)(Any?, Selector, Invoke, OpaquePointer) -> Void).self)(plugin.instance, selectorWithThrows, invoke, OpaquePointer($0))
6868
}
6969
if let error = error {
7070
invoke.reject("\(error)")

0 commit comments

Comments
 (0)