How to link to Update page for our app How to link to Update page for our app ios ios

How to link to Update page for our app

I would recommend you to try SKStoreProductViewController class. iTunes item identifier can be found in -> My Apps -> Apple ID.


func openStoreProductWithiTunesItemIdentifier(identifier: String) {    let storeViewController = SKStoreProductViewController()    storeViewController.delegate = self    let parameters = [ SKStoreProductParameterITunesItemIdentifier : identifier]    storeViewController.loadProductWithParameters(parameters) { [weak self] (loaded, error) -> Void in        if loaded {            // Parent class of self is UIViewContorller            self?.presentViewController(storeViewController, animated: true, completion: nil)        }    }}func productViewControllerDidFinish(viewController: SKStoreProductViewController) {    viewController.dismissViewControllerAnimated(true, completion: nil)}// UsageopenStoreProductWithiTunesItemIdentifier("2321354")


- (void)openStoreProductViewControllerWithITunesItemIdentifier:(NSInteger)iTunesItemIdentifier {    SKStoreProductViewController *storeViewController = [[SKStoreProductViewController alloc] init];    storeViewController.delegate = self;    NSNumber *identifier = [NSNumber numberWithInteger:iTunesItemIdentifier];    NSDictionary *parameters = @{ SKStoreProductParameterITunesItemIdentifier:identifier };    UIViewController *viewController = [self topViewController];    [storeViewController loadProductWithParameters:parameters                                   completionBlock:^(BOOL result, NSError *error) {                                       if (!result) {                                           NSLog(@"SKStoreProductViewController: %@", error);                                       }                                   }];    [viewController presentViewController:storeViewController animated:YES completion:nil];    [storeViewController release];}

From News and Announcement For Apple Developers.

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:

To send customers to a list of apps you have on the App Store:

To send customers to a specific app with your company name included in the URL:

Additional notes:

You can replace http:// with itms:// or itms-apps:// to avoid redirects.

For info on naming, see Apple QA1633:

Edit (as of January 2015): links should be updated to See QA1633 above, which has been updated. A new QA1629 suggests these steps and code for launching the store from an app:

  1. Launch iTunes on your computer.
  2. Search for the item you want to link to.
  3. Right-click or control-click on the item's name in iTunes, thenchoose "Copy iTunes Store URL" from the pop-up menu.
  4. In your application, create an NSURL object with the copied iTunesURL, then pass this object to UIApplication' s openURL: method toopen your item in the App Store.

Sample code:

NSString *iTunesLink = @"itms://";[[UIApplication sharedApplication] openURL:[NSURL URLWithString:iTunesLink]];

Copied from here.

I would like to provide an answer for the Xamarin user. The following would bring up an alert offering to update and then take the user to the store.

async void PromptForVersionUpgrade(){        var alertController = UIAlertController.Create(Messages.NewVersionTitle, Messages.NewVersionText, UIAlertControllerStyle.Alert);        alertController.AddAction(UIAlertAction.Create("Cancel", UIAlertActionStyle.Cancel, null));        alertController.AddAction(UIAlertAction.Create(Messages.NewVersionGoToAppStore, UIAlertActionStyle.Default, (obj) =>        {            var storeViewController = new SKStoreProductViewController();            storeViewController.Delegate = this;            storeViewController.LoadProduct(new StoreProductParameters { ITunesItemIdentifier = 999999999 }, (isLoaded, error) =>            {                if (isLoaded)                    PresentViewController(storeViewController, true, null);            });        }));        PresentViewController(alertController, true, null);}

Then the controller you are calling this code from would need to implement the interface 'ISKStoreProductViewControllerDelegate' to make the 'Cancel' button work. Then 'this' assignable to the 'Delegate' property.

public partial class MyCurrentController : ISKStoreProductViewControllerDelegate {        async void PromptForVersionUpgrade() { ... }        [Export("productViewControllerDidFinish:")]        public void Finished(SKStoreProductViewController controller)        {            controller.DismissViewController(true, null);        }        ...}