您的位置:首页 > 移动开发

AppStore应用评分

2016-04-15 12:23 302 查看
1、首先设置网络访问http



2、进行AppStore应用评分需要设置地址格式:

itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=APP_ID


APP_ID为itunesConnect里面应用程序的Apple ID。

第一种方式:

跳转AppStore进行应用评分代码如下:

NSString *evaluateString = [NSString stringWithFormat:@"itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=%@",APP_ID];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:evaluateString]];


注意:使用真机测试,模拟器会报错误:

LaunchServices: ERROR: There is no registered handler for URL scheme itms-apps


第二种方法:

添加StoreKit.framework



导入#import

//方法二
//初始化控制器
SKStoreProductViewController *storeProductViewContorller = [[SKStoreProductViewController alloc] init];
//设置代理请求为当前控制器本身
storeProductViewContorller.delegate = self;
//加载一个新的视图展示
[storeProductViewContorller loadProductWithParameters:
//appId唯一的
@{SKStoreProductParameterITunesItemIdentifier : APP_ID} completionBlock:^(BOOL result, NSError *error) {
//block回调
if(error){
NSLog(@"error %@ with userInfo %@",error,[error userInfo]);
}else{
//模态弹出appstore
[self presentViewController:storeProductViewContorller animated:YES completion:^{

}
];
}
}];


代理事件

#pragma mark-SKStoreProductViewControllerDelegate
- (void)productViewControllerDidFinish:(SKStoreProductViewController *)viewController{
[self dismissViewControllerAnimated:YES completion:^{

}];
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: