跳转到app应用评价页面
NSString *urlStr = [NSString stringWithFormat:@"itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=%@&pageNumber=0&sortOrdering=2&mt=8", APPID];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:urlStr]];
跳转到app在App Store中的应用下载页面
NSString *urlStr = [NSString stringWithFormat:@"itms-apps://itunes.apple.com/app/id%@", appId];
// 跳转
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:urlStr]];
在应用内,内置AppStore进行评分
- (void)loadAppStoreController
{
// 初始化控制器
SKStoreProductViewController *storeProductViewContorller = [[SKStoreProductViewController alloc] init];
// 设置代理请求为当前控制器本身
storeProductViewContorller.delegate = self;
[storeProductViewContorller loadProductWithParameters:@{SKStoreProductParameterITunesItemIdentifier:kAppId} completionBlock:^(BOOL result, NSError *error) {
if(error)
{
NSLog(@"error %@ with userInfo %@",error,[error userInfo]);
} else
{
// 模态弹出appstore
[self presentViewController:storeProductViewContorller animated:YES completion:^{
}];
}
//AppStore取消按钮监听
- (void)productViewControllerDidFinish:(SKStoreProductViewController *)viewController
{
[self dismissViewControllerAnimated:YES completion:^{
}];
}