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

iOS开发中打开其他应用

2015-11-05 17:48 344 查看
iOS开发中打开其他应用

1.要有应用程序的url(scheme 和 identifier)
MJProduct *p = self.products[indexPath.item];
NSURL *customUrl = [NSURL URLWithString:[NSString stringWithFormat:@"%@://%@", p.scheme, p.identifier]];
UIApplication *app = [UIApplication sharedApplication];

if ([app canOpenURL:customUrl]) { // 有安装应用
// 打开应用
[app openURL:customUrl];
} else { // 没有安装应用
// 打开appStore
[app openURL:[NSURL URLWithString:p.url]];
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: