4

I am building a HTML5 based mobile web app for iPhone. I need to check whether user has specific application that I suggest. I heard that each iPhone application has unique URL scheme to detect their app indentity.

Therefore, I've read this article to get an idea.

Is it possible to register a http+domain-based URL Scheme for iPhone apps, like YouTube and Maps?

However, this is not perfect answer to make what I am trying to make.

here is what might happen

  1. User clicks a recommendation app on mobile web browser.
  2. Check with application iTunes URL and URL scheme.
  3. If the user has the installed application, it returns 'installed' ==> In this case, the screen returns back to mobile browser.

  4. If the user does not have the installed application, it returns 'uninstalled' ==> In this case, the screen moves to App Store.

I am running mobile web app with PHP language.

Thank you.

Community
  • 1
  • 1
Jake
  • 1,175
  • 3
  • 16
  • 23

2 Answers2

2

this is not possible I'm afraid. To be honest I'm glad, as there are real privacy concerns if any old web page can detect which apps I have installed.

That's definitely not a good thing!

UPDATE: If you're happy to go native, this library will do what you want.. http://www.cocoacontrols.com/platforms/ios/controls/ihasapp

Ben Clayton
  • 80,996
  • 26
  • 120
  • 129
1

If you know that a url scheme for the app exists then you can open it via a web link like this, "myapp://". With this there are some round about ways you can effectively check if a certain app exists.

See this related stackoverflow post

Community
  • 1
  • 1
alockwood05
  • 1,066
  • 11
  • 18
  • Wow, that's actually quite worrying. Good to know this technique exists though! – Ben Clayton Sep 14 '12 at 08:52
  • .. there's now a library to detect installed apps available on Cocoacontrols. I presume it uses the technique you've listed here. http://www.cocoacontrols.com/platforms/ios/controls/ihasapp – Ben Clayton Nov 21 '12 at 20:27
  • haven't tried it, but couldn't you just fire off an XHR request (AJAX) to the registered url scheme (myapp://) and check the results. It may not work, but then again... – macguru2000 May 03 '13 at 22:40
  • 1
    So it seems that XHR requests to an app url scheme always return nothing, guess I shouldn't be surprised. – macguru2000 May 03 '13 at 22:55