ios - Stop deep link navigation from webview -
i showing instagram user profile in uiwebview. so, in uiwebview there button provided instagram page "open in app". there way somehow can rid of button. or can stop navigation app? main purpose make profile view only. not allowing users chat. else prefer hooking app itself.
i think button request url in uiwebviewdelegate
method
1), set uiwebviewdelegate
in class.
2), assign delegate uiwebview reference webview.delegate = self
3), implement bellow uiwebviewdelegate
method in class.
func webview(_ webview: uiwebview, shouldstartloadwith request: urlrequest, navigationtype: uiwebviewnavigationtype) -> bool { if request.url?.absolutestring == "open application url" // or can compare url { return false } else { return true } }
hope work you
Comments
Post a Comment