首页 > 代码库 > app 评分
app 评分
#pragma mark -- 去 app store
- (void)jumpToAppStore{
NSString *evaluateString = [NSString stringWithFormat:@"http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?id=517198355&pageNumber=0&sortOrdering=2&type=Purple+Software&mt=8" ];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:evaluateString]];
}
#pragma mark -- 应用内
//苹果提供了一个框架StoreKit.framework,
//导入StoreKit.framework,在需要跳转的控制器里面添加头文件 #import,
//实现代理方法:< SKStorePRoductViewControllerDelegate >
- (void)loadAppStoreController
{
//初始化控制器
SKStoreProductViewController *storeProductViewContorller = [[SKStoreProductViewController alloc] init];
//设置代理请求为当前控制器本身
storeProductViewContorller.delegate = self;
//加载一个新的视图展示
[storeProductViewContorller loadProductWithParameters:
//appId唯一的
@{SKStoreProductParameterITunesItemIdentifier : @"517198355"} completionBlock:^(BOOL result, NSError *error) {
//block回调
if(error){
NSLog(@"error %@ with userInfo %@",error,[error userInfo]);
}else{
//模态弹出appstore
[self presentViewController:storeProductViewContorller animated:YES completion:^{
}
];
}
}];
}
- (void)productViewControllerDidFinish:(SKStoreProductViewController *)viewController{
[self dismissViewControllerAnimated:YES completion:^{
}];
}
app 评分