mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-04-01 10:01:07 +02:00
fix(ios): use correct class to call plugin command with throws (#6830)
This commit is contained in:
committed by
GitHub
parent
edb16d13a5
commit
bb2a8ccf13
5
.changes/fix-ios-plugin-throws-command.md
Normal file
5
.changes/fix-ios-plugin-throws-command.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"tauri": patch
|
||||
---
|
||||
|
||||
Use actual iOS plugin instance to run command with `throws`.
|
||||
@@ -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)")
|
||||
|
||||
Reference in New Issue
Block a user