1

I'd like to build a mobile Web app that:

  • If my iPhone app is already installed, launches it by redirecting to a URL handled by the app
  • If my iPhone app is not installed, displays a web page encouraging users to download it from the App Store

The problem is, I don't know how to detect whether the app is installed before redirecting. Does anyone know a trick for doing this? Maybe a JavaScript hack of some sort, leveraging the App registered URL in an iframe or similar?

  • Look at this answer http://stackoverflow.com/questions/1108693/is-it-possible-to-register-a-httpdomain-based-url-scheme-for-iphone-apps-like-y/1109200#1109200 – Sharjeel Aziz Jun 16 '10 at 20:00

1 Answers1

0

You very likely can't do this. Even in a native app, all you can call is UIApplication's canOpenURL: method, which just tells you if some app will open the URL, not which one. I have no idea if this function is exposed in JavaScript; very likely not (I wouldn't want malicious javascript probing my phone for which URLs it can open).

Marq
  • 111
  • 1
  • 3