I would like to know how to open up a url link from my website in the facebook and twitter app only if it is installed on the device, if not I would like the page to be opened in the browser.
Currently I am using the following links:
fb://profile/fbID
twitter://user?screen_name=username
Currently it works fine if the app is installed but the link fails if the app isn't installed, further to this the twitter link fails completely if you try to open it in a desktop browser.
Would anyone know how I go about this?
Yes I know there are similar questions but none have been answered so I thought I'd try this, cheers.
You can try redirecting the phone to opening the app, and if nothing happens, redirect it to the web page you want.
setTimeout(function () { window.location = "https://itunes.apple.com/appdir"; }, 25);
window.location = "appname://";
If the second line of code works, then the first won't be executed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With