how to open Facebook app from url only if installed

后端 未结 1 489
感动是毒
感动是毒 2021-01-04 09:29

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 open

相关标签:
1条回答
  • 2021-01-04 10:08

    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.

    0 讨论(0)
提交回复
热议问题