ios 在代码中打开app store应用的页面

顶部定义:app

#define IOS7 ([[UIDevice currentDevice].systemVersion intValue] >= 7 ? YES : NO)

方法code

- (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]];
    }
}
相关文章
相关标签/搜索