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

iOS跳转App Store应用评论页

2016-10-15 00:00 281 查看
static NSString *templateReviewURL = @"itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=YourAppID";

static NSString *templateReviewURLiOS7 = @"itms-apps://itunes.apple.com/app/idYourAppID";

static NSString *templateReviewURLiOS8 = @"itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?id=YourAppID&onlyLatestVersion=true&pageNumber=0&sortOrdering=1&type=Purple+Software";

NSString * appID = @"YourAppID";
NSString *reviewURL = [templateReviewURL stringByReplacingOccurrencesOfString:@"appID" withString:[NSString stringWithFormat:@"%@", appID]];

if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0 && [[[UIDevice currentDevice] systemVersion] floatValue] < 7.1) {

reviewURL = [templateReviewURLiOS7 stringByReplacingOccurrencesOfString:@"appID" withString:[NSString stringWithFormat:@"%@", appID]];

}

else if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0) {

reviewURL = [templateReviewURLiOS8 stringByReplacingOccurrencesOfString:@"appID" withString:[NSString stringWithFormat:@"%@", appID]];

}

if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:reviewURL]]) {

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:reviewURL]];

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