forked from trustwallet/trust-wallet-ios
-
Notifications
You must be signed in to change notification settings - Fork 0
/
InCoordinator+Navigable.swift
31 lines (25 loc) · 1.04 KB
/
InCoordinator+Navigable.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Copyright DApps Platform Inc. All rights reserved.
import Foundation
import URLNavigator
import TrustWalletSDK
extension InCoordinator: URLNavigable {
func register(with navigator: Navigator) {
navigator.handle(URLSchemes.browser) { url, _, _ in
guard let target = url.queryParameters["target"],
let targetUrl = URL(string: target) else {
return false
}
self.showTab(.browser(openURL: targetUrl))
return true
}
navigator.handle("app://sign-transaction") { url, _, _ in
return self.localSchemeCoordinator?.trustWalletSDK.handleOpen(url: url as! URL) ?? false
}
navigator.handle("app://sign-message") { url, _, _ in
return self.localSchemeCoordinator?.trustWalletSDK.handleOpen(url: url as! URL) ?? false
}
navigator.handle("app://sign-personal-message") { url, _, _ in
return self.localSchemeCoordinator?.trustWalletSDK.handleOpen(url: url as! URL) ?? false
}
}
}