App 应用通过网页打开 App Store

    NSURL *url = nil;
    if ([[[UIDevice currentDevice] systemVersion] intValue] >= 7.0) {
    //iOS7 使用旧的网址跳转到 App Store 是一个 blank 页,所以判断下设备系统版本,如果是iOS7之后的,则跳转到 App 的详情页
        url = [NSURL URLWithString:[NSString stringWithFormat:@"https://itunes.apple.com/cn/app/id%@?mt=8", appId]];

    }else{
        url = [NSURL URLWithString:[NSString  stringWithFormat: @"itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=%@", appId]];
    }
    if ([[UIApplication sharedApplication] canOpenURL:url]) {
        [[UIApplication sharedApplication] openURL:url];
    }

 

posted @ 2013-11-15 14:25  有妄想症的猫zz  阅读(3127)  评论(0编辑  收藏  举报