您的位置:首页 > 移动开发

ios 应用中直接跳转到指定app页面 或者 app 评价页面 的方法

xyt243135803 2014-10-05 14:14 45 查看
from:/article/1423813.html

1.跳转到app页面

找到应用程序的描述链接,比如: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

然后打开这个链接地址:

[objc] view
plaincopy





[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"itms://itunes.apple.com/gb/app/yi-dong-cai-bian/id391945719?mt=8"]];

[objc] view
plaincopy





[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"itms-apps ://itunes.apple.com/gb/app/yi-dong-cai-bian/id391945719?mt=8"]];

2. 跳转到app的评价页面

找到应用程序的ID ,比如 131456789

[cpp] view
plaincopy

//去app页面评价

-(void) gotoAppStorePageRaisal:(NSString *) nsAppId

{

NSString * nsStringToOpen = [NSString stringWithFormat: @"itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=%@",nsAppId ];

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:nsStringToOpen]];

}

比如调用 [self gotoAppStorePageRaisal:@"131456789"];
标签: