45

I have an app that exists in Android and iPhone stores. So I have two URLs for them (Market and AppStore), but I do not want to add two different QR codes to the homepage. Is there a way (online service I'd expect) to have a single URL that will detect the user's mobile device and will forward immediately to suitable stores? Programmatically looks really trivial, but perhaps someone has already solved the issue.

Karthikeyan VK
  • 5,310
  • 3
  • 37
  • 50
JaakL
  • 4,107
  • 5
  • 24
  • 37
  • 1
    every url has its own unique qrcode, so i guess it wont be possible to add two urls in same qrcode. – Hasandroid Jun 30 '11 at 08:26
  • 1
    @Hasandroid, you can add any text in QRCode. So you can add 10 urls, but this won't help that much, as receiving party will not correctly understand/parse them. – inazaruk Jun 30 '11 at 08:32
  • @inazaruk He's saying he wants 1 URL in his QR then this site will detect the browser device and redirect to amazon or android – Blundell Jun 30 '11 at 08:57
  • but @JaakL , won't it always detect it's an Android device and therefore always redirect to the Android market? What would be the criteria to go to the Amazon market? – Blundell Jun 30 '11 at 08:58
  • In qrappdownload solution you can select just one destination for Android devices - always Market or Amazon, or something else from all the other alternative Android markets. Btw, what would be reason to have more options from end-user prospective? – JaakL Jul 05 '11 at 08:26
  • 1
    a couple of the answers below that have qr code services work fantastically. unfortunately, on Android at least, qrappdownload as mentioned in the answer above... does not redirect me to the market. – StackExchange What The Heck May 13 '14 at 09:23

7 Answers7

29

A QR code is just a link / URL, soo point to a URL on your site and use PHP to determines if the user is using Android or iPhone. Then do a PHP header location to the iPhone app URL if it is iPhone, or Android app if it is Android.

Here is the PHP code:

<?php

/* Handy Code Provided by STEPHENCARR.NET */

$iPod = stripos($_SERVER['HTTP_USER_AGENT'],"iPod");
$iPhone = stripos($_SERVER['HTTP_USER_AGENT'],"iPhone");
$iPad = stripos($_SERVER['HTTP_USER_AGENT'],"iPad");
$Android= stripos($_SERVER['HTTP_USER_AGENT'],"Android");

//check if user is using ipod, iphone or ipad...
if( $iPod || $iPhone || $iPad ){
        //we send these people to Apple Store
        header('Location: http://www.example.com/'); // <-apple store link here
}else if($Android){
        //we send these people to Android Store
        header('Location: http://www.example.com/'); // <-android store link here
}
/* Handy Code Provided by STEPHENCARR.NET */

?> 
DBX12
  • 2,041
  • 1
  • 15
  • 25
user2225638
  • 291
  • 3
  • 2
  • I'm surprised that this isn't the accepted answer. This solution also makes it way easier to support additional platforms without having to change the QR code. – Ryan J. McDonough Sep 19 '16 at 13:14
22

QR codes can contain any text. The convention for their use as a link to the Web is to contain one URL. Most QR reader apps will then load the webpage referenced by the URL embedded in the QR code.

There is no way to embed information in a QR code that directly links to two different URLs when read by any QR code reader. A custom QR code reader could parse a QR code with two URLs and decide which URL to follow, but you'll have to figure out a way to get your custom QR reader to your customers.

The functionality you're looking for can reside at the URL in the QR code. The embedded URL could link to a webpage that checks user agents and redirects appropriately. If the Safari on iOS user agent is detected, redirect to Apple's App Store. An Android user agent would be redirected to an appropriate app store. I would set all other user agents to go to a product page with links to both stores.

If I was doing this, I would investigate sending all users to a product page. The opportunity to engage in further marketing of the product, sharing more information with the potential customer may result in better sales. I'd set up some A-B testing to see which is better.

Mr. Berna
  • 10,525
  • 1
  • 39
  • 42
  • I know there can't be direct link, but it is possible with URL resolver (proxy) like given in updated question. Thank you! – JaakL Jul 04 '11 at 15:13
12

Yet another option is to use http://onelink.to which is an easy to use service for the same purpose.

Erik S
  • 502
  • 3
  • 11
  • Not working for me.. it says "too many redirections" – VoT Oct 07 '13 at 15:35
  • just happened upon this myself, used it to share a popular application in a group chat (recipients on multiple mobile OS), seems to have worked as intended. – MichaelChirico Jan 11 '16 at 16:20
  • Its works very well. But is it possible that someone else might update the code that I generated and mine stops working. Is it possible? – Tina Dec 21 '18 at 07:08
2

Another option would be to use OmniQRCode.com. It's a service that lets you use a single QR Code. When a smartphone scans the QR Code the service detects and redirects the smartphone to the relevant app market. It also groks variations like Android 1.6 vs Android 2.2.

Sethish
  • 364
  • 2
  • 12
  • THANKS! I was looking for a service like this--was almost ready to write my own solution...it's perfect (if a little unpolished looking) – Ralph B Mar 24 '12 at 07:21
1

Maybe its a bit late, but I found those guys http://www.visualead.com/ And I loved it!

RCB
  • 2,253
  • 2
  • 25
  • 49
1

You can also use visual QR Code from QrDesign.net They support all mobile platforms such iTunes, Google play, windows phone and blackberry appworld. and wondering is that they are visuals and fancy. enter image description here enter image description here

Osiris
  • 131
  • 3
  • 16
-1

You can take a look at this project:

http://m.appqr.mobi/

It lets you generate a single QRCode for Android, IOS, Windows Phone, Symbian and Blackberry. I've used it and it works - when you scan on a specific device, it directs you to their corresponding store, provided that you did put the link accurately and in the corresponding field.

Roman Jaquez
  • 2,499
  • 1
  • 14
  • 7