Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Download iOS app without redirecting to App Store

Is there a way to allow a user to download & install an iOS app while using another app without redirecting them to the App Store?

The scenario that I'm working on is one where the user is presented with a list of apps that they may choose to download but I do not want them to leave the app.

I tried to search for an iTunes API to do this but I did not find anything.

like image 376
Jenson Avatar asked Mar 28 '14 10:03

Jenson


1 Answers

SKStoreProductViewController will allow you to do that. You just set up the itunes ID of the app that you want to download and then you present it as a modal view and the user can take it from there.

You can have a table view with the list of apps that you want the user to download, each with their itunes ID and on selecting one of the items, you can present the view controller.

It looks something like this (iOS 6 screenshot) enter image description here

Example use:

SKStoreProductViewController *storeViewController = 
              [[SKStoreProductViewController alloc] init];

        storeViewController.delegate = self;

        NSDictionary *parameters =
             @{SKStoreProductParameterITunesItemIdentifier: 
                  [NSNumber numberWithInteger:333700869]};

        [storeViewController loadProductWithParameters:parameters 
             completionBlock:^(BOOL result, NSError *error) {
            if (result) {
                [self presentViewController:storeViewController
                                   animated:YES
                                 completion:nil];
            }
        }];
like image 151
Andrew Avatar answered Sep 30 '22 04:09

Andrew