0

I know that <a href="twitter://">Twitter Link</a> will open the Twitter app on iOS from a webpage in Safari.

However if the app is not installed we get an error popup...

Edit: (I've seen the other answers where a setTimeout checks is there has been a popup or not. I'm hoping for something much cleaner)

Is there a way to avoid the error. Hopefully by knowing if the app is installed and redirecting the page within Safari.

Ben Racicot
  • 5,332
  • 12
  • 66
  • 130
  • 5
    http://stackoverflow.com/questions/13044805/how-to-check-if-an-app-is-installed-from-a-web-page-on-an-iphone Checkout this answer. – prabodhprakash Sep 28 '16 at 21:50
  • @prabodhprakash yes thank you. I've seen that page. However I was hoping something a lot cleaner existed in Q4 2016 than a setTimeout check. Kind of ridiculous isn't it? – Ben Racicot Sep 29 '16 at 13:31
  • 1
    The problem here is that, Safari can never know, if user has installed an app. This is privacy issue and Apple will never allow it :) That's the cleanest of all that we can do with :) – prabodhprakash Sep 29 '16 at 13:32
  • The correct answer for this depends entirely on whether you control the app you're trying to open. Was Twitter just an example, or is that actual (and only) app you need to launch? – Alex Bauer Sep 30 '16 at 04:35
  • @AlexBauer typically I was looking to check to see if (any) app is installed and open them instead of a Safari page. It is unbelievable to me that a universal link attribute does not exist to enable this type of UX. – Ben Racicot Sep 30 '16 at 18:01
  • Actually, the kind of behavior you're describing _does_ exist. It's just up to the destination app to enable it. Messy as that seems at first glance, Apple's reasoning (valid, in my opinion) is the owner of each app is best equipped to determine if the app or the website should handle a given link. Allowing other parties to discover which apps are installed on a device would be a privacy nightmare. – Alex Bauer Oct 01 '16 at 04:28

0 Answers0