Show App Store in app

Source: Internet
Author: User

IOS6 SDK has added the Storekit toolkit, "Storekit" as the name implies "store Toolkit" meaning, then it is mainly Apple to facilitate the developer of the App Store operation and Development. For example, commenting on the app, we usually jump directly to the App Store, so now we can pop the App Store in the form of a modal view directly within the app, is that more convenient?

To use the features in the Storekit Toolkit:

1, first have to importstorekit.frameworkThis framework, (step:Target---> Build Phase ---> Link Binary with Libraries---> select the + sign in the lower left corner -- , enter Storekit in the pop -up box, and then select Add as well. )

2. Import #import <StoreKit/StoreKit.h> header files in the App store that needs to be displayed



With these two steps ready to work well, you'll be able to use its features

Steps:

1. Instantiate a Skstoreproductviewcontroller class

2. Set its delegate

3. Put the Sotre product view Controller Display to User

The code is as follows

-(void) openappstore{skstoreproductviewcontroller *storeproductviewcontroller = [[Skstoreproductviewcontroller    ALLOC] init];    [Storeproductviewcontroller setdelegate:self]; [Storeproductviewcontroller loadproductwithparameters:@{skstoreproductparameteritunesitemidentifier: @ "                                              The application you developed AppID "} completionblock:^ (BOOL result, Nserror *error) { if (Error) {NSLog (@ "error%@ with User Info                                              %@. ", error, [error userInfo]);                                                  } else {//Present Store Product View Controller                                               [Self Presentviewcontroller:storeproductviewcontroller animated:yes completion:nil];//can only pop up in modal form }                                          }];} This method is called when the user wants to exit the App store by clicking the Cancel button in the upper-left corner of the modal View-(void) ProductViewControllerdidfinish: (Skstoreproductviewcontroller *) viewcontroller{[Viewcontroller dismissViewControllerAnimated : YES Completion:nil];}



Show App Store in app

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.