This commit is contained in:
Andrey Blinov
2020-08-15 01:39:32 +07:00
parent a34a674a29
commit 69c32ea241

View File

@@ -73,8 +73,8 @@ open class ChatController: UIViewController, WKNavigationDelegate, WKScriptMessa
return return
} }
} }
UIApplication.shared.openURL(navigationAction.request.url!)
decisionHandler(.cancel) decisionHandler(.cancel)
self.onLinkPressed(url: navigationAction.request.url!)
} }
private func getCallJsMethod(_ name: String, params: Array<Any>) -> String { private func getCallJsMethod(_ name: String, params: Array<Any>) -> String {
@@ -229,6 +229,10 @@ open class ChatController: UIViewController, WKNavigationDelegate, WKScriptMessa
onEvent(name, data!) onEvent(name, data!)
} }
open func onLinkPressed(url: URL) {
UIApplication.shared.openURL(url)
}
open func playSound(_ systemSoundId: SystemSoundID) { open func playSound(_ systemSoundId: SystemSoundID) {
AudioServicesPlaySystemSound(systemSoundId) AudioServicesPlaySystemSound(systemSoundId)
} }