I want to make a button on my website, that will allow user to open native facebook app (if it is installed), or open facebook website otherwise. As i understood, i have to
AppLinks are a protocol that only Facebook native supports. This means that only the Facebook native apps for Android and iOS will properly parse the metatags and take action. All other browsers and platforms ignore them.
In order to properly handle linking in other browsers, you use the client side JS redirection code in addition to AppLinks to support redirection in other browsers. If you don't want to build this all out, I built a free tool called branch.io that will host your links with this client side JS plus auto-configure your AppLinks.
If you'd rather build it yourself, here's the code you can use for iOS safari:
And for Android, you can use this client side JS code snippet: