app 评分的两种方法
2014-06-09 14:22 PingKang 阅读(2112) 评论(0) 编辑 收藏 举报给app进行评分有两种方法:都是直接跳到app store 给app进行评分的,具体请看下文:
1.App Store 上评论的链接地址是 ://(1)itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id = appID 替换成:
itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=appID在iOS7上就行了!
(2)itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?mt=8&onlyLatestVersion=true&pageNumber=0&sortOrdering=1&type=Purple+Software&id=appID 替换成 :
itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?mt=8&onlyLatestVersion=true&pageNumber=0&sortOrdering=1&type=Purple+Software&id=appID
具体代码如下:
[[UIApplication sharedApplication]openURL:[NSURL URLWithString:@"itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?mt=8&onlyLatestVersion=true&pageNumber=0&sortOrdering=1&type=Purple+Software&id=appID"]];
2.在用户给我们的app评分的时候,一般情况下我们都需要跳转到app store,很不方便。在iOS6以后,引入了
SKStoreProductViewController类,可以在应用内展示App Store,用户可以不用离开应用,直接给我们的应用评分或者展示其他的app信息。
在应用内展示AppStore,需要给项目添加StoreKit.frame. SKStoreProductViewController存在StoreKit框架内。代码如下:
#pragma mark - 应用内评论
- (void)openAppStore
{
SKStoreProductViewController * storeProductViewController = [[SKStoreProductViewController alloc] init];
[storeProductViewController setDelegate:self];
[storeProductViewController loadProductWithParameters:@{SKStoreProductParameterITunesItemIdentifier:@"appID"} completionBlock:^(BOOL result, NSError *error) {
if(error) {
NSLog(@"Error %@ with user info %@",error,[error userInfo]);
} else {
[self presentViewController:storeProductViewController animated:YES completion:nil];
}
}];
[storeProductViewController release];
}
#pragma mark - SKStoreProductViewControllerDelegate
-(void)productViewControllerDidFinish:(SKStoreProductViewController *)viewController
{
[self dismissViewControllerAnimated:YES completion:nil];
}