htmlfacebookdeep-linkingfacebook-page

How to Open Facebook page links in website in the Facebook App


Good day

I having a simple wordpress site where I am linking to facebook pages

for example

<a href="https://www.facebook.com/FacebookIndia" target="_blank">Open my Page</a>

This works works normally in desktop it open a new tab.

When I am in mobile it still opens the same way in browser but I need the links to open in facebook native app.

How do I handle it ?


Solution

  • Here is the solution to create a fallback link if the app is not installed.

    reference link from google Google Deep Links with Intents

    Also here is my complete final version of code Gist of complete JS code to handle facebook links