Moak
Moak

Reputation: 12885

How do you redirect an iPhone to iTunes?

When opening http://example.com/app I want all iPhones to open the app in iTunes.

right the html header has

    <meta name="apple-itunes-app" content="app-id=XXX" >

which renders a bar prompting for install

further this JS from another stackoverflow question

var platform  = navigator.platform;
        if (/mac/i.test(platform))
            window.location = iuntes_url;
        else if (/linux/i.test(platform))
            window.location = play_url; 

works for android, but not for iPhone.

This link however http://authy.com/install does open in iTunes on an iPhone can't find out this is done?

how can I open the app store for an iOS user when they go to example.com/app?

Upvotes: 0

Views: 137

Answers (2)

penguinmaster
penguinmaster

Reputation: 151

What is the URL you are sending them to? It should lead with itms-apps:// not http://

Upvotes: 1

Moak
Moak

Reputation: 12885

The issue was the fact I was using the variable window.location which on devices should just be location

var platform  = navigator.platform;
    if (/mac/i.test(platform))
        location = iuntes_url;
    else if (/linux/i.test(platform))
        location = play_url; 

Upvotes: 0

Related Questions