Starting an App from a link in an email (on iPhone)

I was playing around with Amazon’s iPhone App and found a little (possibly useful) trick that I cannot figure out. Specifically, how Amazon was able to create a ‘link’ to their iphone app from an email I had received. Let me explain…

Using the Amazon app, I used the Amazon Remembers feature. I took a picture of something, then sent it to Amazon, a few minutes later I received an email on the iPhone that said they had found the product on Amazon. The email contains a link that, when ‘clicked’, opens the Amazon app and displays the product that was found. Some how they have constructed a link in the email that the iPhone recognizes and relates to the Amazon app (and it even passes parameters).

How it this being done!?

When I inspect the email (using my Mac) I see this bit of HTML in the email…

You may view the result from your iPhone here:
[url="amazon:///remembers?ASIN=B000A0SEVM"]Amazon Remembers B000A0SEVM[/url]

… but how does that know how to open the Amazon app? Is this some feature in the iPhone that any of us can take advantage of?

:?:

iPhone applications can register a new URL type to allow other iPhone applications to interact with them. Apple has an example project in the Dev center… “Launch Me” is the name, if I recall.

That’s a custom URL handler. Your app can register itself as a handler for a URL type. You put the new URL type itself in your Info.plist file.

You will need to modify the app delegate to add application:handleOpenURL: and you’ll have to figure out what to do with the information that gets passed in, probably write it to prefs and let your Unity code read it back.