Handling hyperlinks inside WebView of IOS?

ios

#1

I would like to get url address of the Hyper link when user clicks on it inside WebView of IOS device. I am able to get it from Android device. Please help me …

var webview = args.object;
    if (isAndroid) {
        var TNSWebViewClient =
           android.webkit.WebViewClient.extend({
                shouldOverrideUrlLoading: function(view, url) {
                    console.log(url);
                    
                }

            });
    
        webview.android.getSettings().setDisplayZoomControls(false);
        webview.android.getSettings().setBuiltInZoomControls(false);
        webview.android.setWebViewClient(new TNSWebViewClient());
    }

    if(platform.isIOS){
        webview.ios.scrollView.scrollEnabled = true; 
        webview.ios.scrollView.bounces = true;
    } 

#2

Did you find a way to achieve this on both platforms ?

When I run you code, having platforms declarations installed, I have this error thrown from the typescript compiler :
Property 'extend' does not exist on type 'typeof WebViewClient'.

Can you help me about this ?


#3

Hi Anand569, can you please show example how did you implement this in Android. I am facing problem with this. Is there any library to include? I guess I’m missing something. If you could add snippet of example that would be great. Thanks