1

I have a WebViewwhich has a WebViewClient set with shouldOverrideUrlLoading method in it returning false.

public class myWebClient extends WebViewClient
{
    @Override
    public boolean shouldOverrideUrlLoading(WebView view, String url) {
                return false;
    }
}

I need to open facebook app when a facebook page link is clicked inside WebView. The main restriction is i don't want to update the app just to achieve this.So i am looking for a server side solution.

What i tried: I went through the manifest xml file of facebook app to identify that facebook app has deep link with facebook urls having pathPrefix /n/.

<data
    android:scheme="https"
    android:host="www.facebook.com"
    android:pathPrefix="/n/"/>

So instead of loading a normal facebook page url i loaded the deep link version of the url , something like

https://www.facebook.com/n/?pagename

When the WebViewClient is not set in WebView , the above url opnes the fb page in fb app. That is working fine. But as i mentioned, in my existing version of app the WebViewClient is set and i can't update the app just to achieve this thing.

My Question: Is there a way to ignore the WebViewClient even though it is set in code? Any deep link or any other hack from server side which will enable the facebook deep link version of url to open in facebook app instead of the WebView itself?

Sash_KP
  • 5,551
  • 2
  • 25
  • 34

0 Answers0