Ios ------ app jumps to appStore rating, ios jumps to appstore rating

Source: Internet
Author: User

Ios ------ app jumps to appStore rating, ios jumps to appstore rating

There are two ways to score a jump to the AppStore:

One is to jump out of the application, jump to the AppStore, and score;

The other is built-in AppStore for scoring within the application.

PS: appID in the https://itunesconnect.apple.com to create an application in the application interface to obtain

1. jump out of the application, jump to the AppStore, and score

[[UIApplicationsharedApplication] openURL: [NSURLURLWithString: @ "http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews? Id = APPID & pageNumber = 0 & sortOrdering = 2 & type = Purple + Software & mt = 8 "]; (APPID can be found in itunce)

2. built-in AppStore for rating within the application

 

Apple provides a framework StoreKit. framework that imports StoreKit. framework and adds the header file # import <StoreKit/StoreKit. h> to the Controller to be redirected. The proxy method is as follows: <SKStorePRoductViewControllerDelegate>

// Custom Method

-(Void) loadAppStoreController

{

// Initialize the Controller

SKStoreProductViewController * storeProductViewContorller = [[SKStoreProductViewControlleralloc] init];

// Set the proxy request to the current controller itself

StoreProductViewContorller. delegate = self;

[StoreProductViewContorllerloadProductWithParameters: @ {SKStoreProductParameterITunesItemIdentifier: kAppId} completionBlock: ^ (BOOLresult, NSError * error ){

If (error ){

NSLog (@ "error % @ with userInfo % @", error, [erroruserInfo]);

} Else {

// Modal pop-up appstore

[SelfpresentViewController: storeProductViewContorlleranimated: YEScompletion: nil];

}

}];

}

// AppStore cancel button listening

-(Void) productViewControllerDidFinish :( SKStoreProductViewController *) viewController

{

[SelfdismissViewControllerAnimated: YEScompletion: nil];

}

Related Article

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.