So, you ever wondered how to get your iPhone “Lite” app to trigger the App Store to load the full version’s page? And you didn’t stumble across QA1629? Well, here’s the quick notes version for you.
Step 1: Copy the URL of your full app from the App Store by right-clicking its name, which will be something like
http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=306469222&mt=8
Step 2: Replace “itunes” with “phobos”. This is so it doesn’t start Safari.
http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=306469222&mt=8
Step 3: Have the system load it.
NSString *iTunesLink = @"http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=306469222&mt=8";
[[UIApplication sharedApplication]
openURL:[NSURL URLWithString:iTunesLink]
];
Ah, but what if you want to use your iTunes affiliate account? After all, no point leaving 5% off the table! Well, that’s a trifle more complicated, since there’s redirects involved. So take your big long LinkShare string, change “itunes” to “phobos” as above, and create a NSURLConnection to sort out the URL that actually needs to be loaded. Like this:
- (IBAction)buyFullVersion
{
NSString *referralLink = @"http://click.linksynergy.com/yadayadayada";
self.iTunesURL = [NSURL URLWithString:referralLink];
NSURLRequest *referralRequest = [NSURLRequest
requestWithURL:self.iTunesURL
];
NSURLConnection *referralConnection = [[NSURLConnection alloc]
initWithRequest:referralRequest
delegate:self
startImmediately:YES
];
[referralConnection release];
}
// Save the most recent URL in case multiple redirects occur
- (NSURLRequest *)connection:(NSURLConnection *)connection
willSendRequest:(NSURLRequest *)request
redirectResponse:(NSURLResponse *)response
{
self.iTunesURL = [response URL];
return request;
}
// No more redirects; use the last URL saved
- (void)connectionDidFinishLoading:(NSURLConnection *)connection
{
[[UIApplication sharedApplication] openURL:self.iTunesURL];
}
And that, dear friends, is how you get 75% instead of 70% on your in-app referrals. You’re welcome.
UPDATES:
And check out this followup post on how to get individually tracked analytics into your Linkshare links!]
GeoRiot promises to internationalize all your links.
User Friendly iTunes Affiliate Links
Implementing Smart App Banners
Continue Reading →MAR

