2

Each platform has its own way of opening installed apps via URL.

Android has a URL pattern that can be registered, iOS you can set the URL scheme.

How do I send a single URL via mail and make that link open my app on iOS and Android based on the platform the URL was clicked?

1
  • I don't know how BlackBerry does it, but both Android and iOS can recognize a custom scheme though it's not really recommended in Android. You can register to handle that custom scheme with your app. Keep in mind that your email can be read in a variety of places though. It would break on a desktop if you used a custom scheme which is not what you want. Commented May 9, 2012 at 17:06

1 Answer 1

3

You could write a simple web page to detect what browser the request came from and then redirect to the appropriate link. For instance, here is an explanation of redirecting in PHP.

Edit:

Below is a code example. On Android it does bring up a popup and ask for user input because the you Android knows it can open either the Google Play web page or the Google Play app. This is the expected behavior on Android. I haven't tried it on the IPhone, but it shouldn't cause a popup on a desktop computer.

<?php if(preg_match ( "/.*Android.*/" , $_SERVER['HTTP_USER_AGENT'])){ header( 'Location: https://play.google.com/store' ) ; } else if (preg_match ( "/.*iPhone.*/" , $_SERVER['HTTP_USER_AGENT'])){ header( 'location: http://www.apple.com/itunes/whats-on/'); } ?> <html> <body> Show for web page for desktop </body> </html> 

Here is a related question with some other solutions

Edit:

I just noticed, you want to open the app itself not the download page for the app. The code above would still work. You just need to fix the url's. These two questions apply

Sign up to request clarification or add additional context in comments.

4 Comments

But a popup windows is opened and asks for a user input. I don't feel this is a good approach. But if nothing is available this is the only option i have.
What platform does the popup open on? What user input is it asking for?
Thanks Jay for your answer. The popup comes on the iPhone.
I finally tried this on my wife's IPhone. I don't get a popup. Seems to work fine: jay.askren.net/mobile_redirect.php

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.