File tree Expand file tree Collapse file tree 2 files changed +20
-16
lines changed
plugins/opener/ios/Sources Expand file tree Collapse file tree 2 files changed +20
-16
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " opener " : patch
3
+ " opener-js " : patch
4
+ ---
5
+
6
+ Fix usage on iOS.
Original file line number Diff line number Diff line change 3
3
// SPDX-License-Identifier: MIT
4
4
5
5
import Foundation
6
-
7
6
import SwiftRs
8
7
import Tauri
9
8
import UIKit
10
9
import WebKit
11
10
12
11
class OpenerPlugin : Plugin {
13
-
14
- @objc public func open( _ invoke: Invoke ) throws {
15
- do {
16
- let urlString = try invoke. parseArgs ( String . self)
17
- if let url = URL ( string: urlString) {
18
- if #available( iOS 10 , * ) {
19
- UIApplication . shared. open ( url, options: [ : ] )
20
- } else {
21
- UIApplication . shared. openURL ( url)
22
- }
23
- }
24
- invoke. resolve ( )
25
- } catch {
26
- invoke. reject ( error. localizedDescription)
12
+ @objc public func open( _ invoke: Invoke ) throws {
13
+ do {
14
+ let urlString = try invoke. parseArgs ( String . self)
15
+ if let url = URL ( string: urlString) {
16
+ if #available( iOS 10 , * ) {
17
+ UIApplication . shared. open ( url, options: [ : ] )
18
+ } else {
19
+ UIApplication . shared. openURL ( url)
27
20
}
21
+ }
22
+ invoke. resolve ( )
23
+ } catch {
24
+ invoke. reject ( error. localizedDescription)
28
25
}
26
+ }
29
27
}
30
28
31
- @_cdecl ( " init_plugin_shell " )
29
+ @_cdecl ( " init_plugin_opener " )
32
30
func initPlugin( ) -> Plugin {
33
31
return OpenerPlugin ( )
34
32
}
You can’t perform that action at this time.
0 commit comments