iOS Learning note 6-Jump AppStore ratings

Source: Internet
Author: User

Today Bo Master has a jump AppStore scoring needs, encountered some difficulties, here and we share, hope to progress together.

Jump to AppStore allows users to rate our applications in two ways, one is to jump out of the app, go to AppStore, and score. The other is to score within the app, built-in AppStore.

Ps:appleid Create an app in https://itunesconnect.apple.com to get it in the app interface

1. Jump out of the app, go to AppStore, and score

If it's a 7.0-old system,

NSString *str = [NSString stringwithformat:@ "itms-apps://ax.itunes.apple.com/webobjects/mzstore.woa/wa/  Viewcontentsuserreviews?type=purple+software&id=xxxxxx "];

[[UIApplication sharedapplication] openurl:[nsurl Urlwithstring:str]];

If it's a system after 7.0,

NSString *str = [NSString stringwithformat:@ "Itms-apps://itunes.apple.com/app/idxxxxxxx"];

[[UIApplication sharedapplication] openurl:[nsurl Urlwithstring:str]];

2. Within the application, the built-in AppStore is rated

Apple provides a framework storekit.framework, import storekit.framework, Add a header file to the controller that needs to jump #import <storekit/ Storekit.h> Implement proxy methods:< skstoreproductviewcontrollerdelegate >

Custom Methods

-(void) Loadappstorecontroller

{

Initializing the Controller

Skstoreproductviewcontroller *storeproductviewcontorller = [[Skstoreproductviewcontroller alloc] init];

Sets the proxy request for the current controller itself

Storeproductviewcontorller. Delegate = self ;

[Storeproductviewcontorller Loadproductwithparameters:@{skstoreproductparameteritunesitemidentifier:kappid} completionblock:^ (BOOL result, nserror *error) {

if (Error)

{

NSLog (@ "error%@ with UserInfo%@", Error,[error UserInfo]);

} Else

{

Modal Eject AppStore

[self presentviewcontroller:storeproductviewcontorller animated:YES completion:^{

}];

}

}];

}

AppStore Cancel button Monitoring

-(void) Productviewcontrollerdidfinish: (skstoreproductviewcontroller *) Viewcontroller

{

[self dismissviewcontrolleranimated:YES completion:^{

}];

}

iOS Learning note 6-Jump AppStore ratings

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.