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]];
    }
}
相關文章
相關標籤/搜索