PDA

View Full Version : Detecting installed apps from browser




ryushe
Dec 22, 2008, 01:28 PM
Hi there,

I've been asked to create an iPhone specific version of a site, but with a twist. This site offers information in (for instance) an RSS feed which can be used by other applications/sites to provision that information. Now there is already an iPhone based app in existence that also shows this info in a very nice interface. This app is not developed or maintained by us, but we're pretty friendly with the guys that made it and we figure we can both benefit from using each others tools instead of us having to 'remake' their app in a webbased version (why invent the wheel twice idea).
What we want to do is described below, and I would like input to see if this is possible or not.

User browses to the website on iPhone. We detect the user is using an iPhone and return a custom page targeted for iPhone (all very simple and basic so far).
Now, we would very much like to be able to detect via the browser if the native app mentioned above is installed or not. If the application is installed, we'll simply refresh the page and call the app launch command, thus automatically starting the native app. In this case that's easy as the app can be launched using a custom URL in the form of myProtocol://localhost/?itemID=<itemID>&<more parameters>. If there's another method to call a specific application from the browser that'll work as well. This is still easy.
Now if the app isn't installed we'll provide some basic info along with a link to the location of the app in the AppStore. Again, piece of cake; the separate pages are by far the easy part.

The crux of our problem is the detection of an install of the application. We've been thinking about calling the custom protocol link and seeing if we get a result which would indicate an install, but the problem with that is that as soon as the URL is called, the application launches. We can't see another way to detect this, and the documentation on MobileSafari isn't helping much at this point.

In other words:
App detection page --> yes --> launch app
.......................... --> no --> show page with link to AppStore

If anyone has any ideas or suggestions regarding this, it would be much appreciated.

Thanks for your time reading this.



a5sk4s
Dec 22, 2008, 04:01 PM
What don't you like about:

Try to launch (via URL) --> launched (you're done)
Try to launch --> doesn't launch -> provide link

I believe, if it works - I haven't tried, it's your only option. Everything else would probably be a privacy concern.