search

Home  >  Q&A  >  body text

ios - 如何在应用内打开 App Store,并进行下载?

不是跳转到 App Store,而是直接打开应用界面,像「网易应用中心」2.0 那样。

巴扎黑巴扎黑2773 days ago792

reply all(1)I'll reply

  • 黄舟

    黄舟2017-04-17 11:23:02

    For example, the webpage URL of an app is: https://itunes.apple.com/cn/app/xue-qiu-gu-piao-tou-zi-she-qu/id492180369?mt=8&uo=4
    Then the native url is to change the protocol https to itms-apps. Open the replaced url in your app to jump to the app store. You can find the app url here: http://itunes. apple.com/linkmaker

    Open app store modally
    You can use SKStoreProductViewController:

    NSDictionary *appParameters = [NSDictionary dictionaryWithObject:@"533886215"
                                                              forKey:SKStoreProductParameterITunesItemIdentifier];
    
    SKStoreProductViewController *productViewController = [[SKStoreProductViewController alloc] init];
    [productViewController setDelegate:self];
    [productViewController loadProductWithParameters:appParameters
                                     completionBlock:^(BOOL result, NSError *error)
    {
    
    }];
    [self presentViewController:productViewController
                       animated:YES
                     completion:^{
    
                     }];

    reply
    0
  • Cancelreply