顶部定义:
#define IOS7 ([[UIDevice currentDevice].systemVersion intValue] >= 7 ? YES : NO)
方法
- (void)openAppaleShop
{
NSString *appleID = @"949346638";
if (IOS7) {
NSString *str = [NSString stringWithFormat:@"itms-apps://itunes.apple.com/app/id%@",appleID];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]];
} else {
NSString *str = [NSString stringWithFormat:@"itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=%@", appleID];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]];
}
}
本文介绍了一种根据iOS版本动态调整应用商店链接的方法。通过判断设备是否为iOS7及以上版本来改变链接格式,实现不同版本下应用商店页面的正确跳转。


1109

被折叠的 条评论
为什么被折叠?



