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