找到應用程序的描述鏈接,比如:http://itunes.apple.com/gb/app/yi-dong-cai-bian/id391945719?mt=8
然後將
http:// 替換為
itms:// 或者
itms-apps://:
itms://itunes.apple.com/gb/app/yi-dong-cai-bian/id391945719?mt=8
itms-apps:// itunes.apple.com/gb/app/yi-dong-cai-bian/id391945719?mt=8
然後打開這個鏈接地址:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"itms://itunes.apple.com/gb/app/yi-dong-cai-bian/id391945719?mt=8"]];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"itms-apps ://itunes.apple.com/gb/app/yi-dong-cai-bian/id391945719?mt=8"]];
跳轉到應用評價頁
NSString *urlStr = [NSString stringWithFormat:@"itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=%@&pageNumber=0&sortOrdering=2&mt=8", APPID];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:urlStr]];
跳轉到應用詳情頁
NSString *urlStr = [NSString stringWithFormat:@"itms-apps://itunes.apple.com/app/id%@", APPID];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:urlStr]];
這個最好在真機上面測試,在模擬器上測試,會沒有效果。