Wednesday, May 30, 2012

How to link to apps on the app store


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

10 comments:

  1. From http://developer.apple.com/iphone/news/archives/2010/january/


    Drive 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

    ReplyDelete
  2. If you want to open an app directly to the App Store, you should use:

    itms-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.

    ReplyDelete
  3. To be extreamly concise:

    [[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

    ReplyDelete
  4. Simply change 'itunes' to 'phobos' in the app link.

    http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=300136119&mt=8

    Now it will open the App Store directly

    ReplyDelete
  5. The official Apple way of doing this is covered in this tech QA note

    ReplyDelete
  6. If 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:

    itms-apps://itunes.com/apps/DevelopmentCompanyLLC


    Otherwise it returns "This request cannot be processed" on iOS 4.3.3

    ReplyDelete
  7. This is working and directly linking in ios5

    NSString *iTunesLink = @"http://itunes.apple.com/app/baseball-stats-tracker-touch/id490256272?mt=8";
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:iTunesLink]];

    ReplyDelete
  8. This code generates the App Store link on iOS

    NSString *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];

    ReplyDelete
  9. To have a direct link without redirection :


    Use 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

    ReplyDelete
  10. You can solve it easily with a remote redirection page.
    See 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/

    ReplyDelete