1

Is it possible to have a fallback href?

I put an URL Scheme in a website, code below:

<a href="tweetbot:///post?text=test">Tweet!</a>

This sends out a Tweet with the app Tweetbot containing "test". If people haven't installed Tweetbot, nothing will happen clicking the link. Is there a way to do a fallback to the web version of twitter and/or different apps?

Thanks

Óscar López
  • 232,561
  • 37
  • 312
  • 386
Bob Wassermann
  • 349
  • 2
  • 7
  • 19

1 Answers1

0

I remember seeing similar questions regarding the tel:// URL scheme a while ago. Unfortunately, I don't think this is possible directly from a webpage, but check out this question as it may offer some useful hacks (such as using a setTimeout for if the scheme isn't present - I can't confirm that they work). My personal favorite answer there is from mrahman, who uses the Date().getTime() method so that users who do have the App won't get the message / be redirected.

I guess if your users are going to be using the functionality frequently then you could save their choice of whether to use the app or the web version.

Community
  • 1
  • 1
Ian Clark
  • 9,237
  • 4
  • 32
  • 49