So I am creating a free version of my iPhone game. I want to have a button inside the free version that takes people to the paid version in the app store. If I use a standard link
http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=300136119&mt=8
the iphone opens safari first, and then the app store. I have used other apps that open the app store directly, so I know it is possible.
Any ideas? What is the URL Scheme for the app store?
Source: Tips4all
From http://developer.apple.com/iphone/news/archives/2010/january/
ReplyDeleteDrive Customers Directly to Your App
on the App Store with iTunes Links
With iTunes links you can provide your
customers with an easy way to access
your apps on the App Store directly
from your website or marketing
campaigns. Creating an iTunes link is
simple and can be made to direct
customers to either a single app, all
your apps, or to a specific app with
your company name specified.
To send customers to a specific
application:
http://itunes.com/apps/appname
To send
customers to a list of apps you have
on the App Store:
http://itunes.com/apps/developername
To send customers to a specific app
with your company name included in the
URL:
http://itunes.com/apps/developername/appname
Additional notes:
You can replace http:// with itms:// or itms-apps:// to avoid redirects.
For info on naming, see QA1633: https://developer.apple.com/library/ios/#qa/qa1633/_index.html
If you want to open an app directly to the App Store, you should use:
ReplyDeleteitms-apps://...
This way it will directly open the App Store app in the device, instead of going to iTunes first, then only open the App Store (when using just itms://)
Hope that helps.
To be extreamly concise:
ReplyDelete[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"itms://itunes.com/apps/appname"]];
If you want to send to all the apps for a developer, use
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"itms://itunes.com/apps/developername"]];
These work for iOS 4.1
Simply change 'itunes' to 'phobos' in the app link.
ReplyDeletehttp://phobos.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=300136119&mt=8
Now it will open the App Store directly
The official Apple way of doing this is covered in this tech QA note
ReplyDeleteIf you want to link to a developer's apps and the developer's name has punctuation or spaces (e.g. Development Company, LLC) form your URL like this:
ReplyDeleteitms-apps://itunes.com/apps/DevelopmentCompanyLLC
Otherwise it returns "This request cannot be processed" on iOS 4.3.3
This is working and directly linking in ios5
ReplyDeleteNSString *iTunesLink = @"http://itunes.apple.com/app/baseball-stats-tracker-touch/id490256272?mt=8";
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:iTunesLink]];
This code generates the App Store link on iOS
ReplyDeleteNSString *appName = [NSString stringWithString:[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleName"]];
NSURL *appStoreURL = [NSURL URLWithString:[NSString stringWithFormat:@"itms-apps://itunes.com/app/%@",[appName stringByReplacingOccurrencesOfString:@" " withString:@""]]];
Replace itms-apps with http on Mac:
NSURL *appStoreURL = [NSURL URLWithString:[NSString stringWithFormat:@"http:/itunes.com/app/%@",[appName stringByReplacingOccurrencesOfString:@" " withString:@""]]];
Open URL on iOS:
[[UIApplication sharedApplication] openURL:appStoreURL];
Mac:
[[NSWorkspace sharedWorkspace] openURL:appStoreURL];
To have a direct link without redirection :
ReplyDeleteUse iTunes link maker http://itunes.apple.com/linkmaker/ to get the real direct link
Replace the http:// with itms-apps://
Open the link with [[UIApplication sharedApplication] openURL:url];
Source : https://developer.apple.com/library/ios/#qa/qa2008/qa1629.html
You can solve it easily with a remote redirection page.
ReplyDeleteSee at my blog: http://gotoandplay.freeblog.hu/archives/2010/11/03/Tangram_098_-_App_Store_link_to_the_full_versionreviews_before_even_submit_the_application/