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

iOS 检测有没有安装其它应用 和ios9下要注意的地方

2015-10-03 22:15 477 查看
UIApplication *app = [UIApplication sharedApplication];

NSURL *url = [NSURL URLWithString:@"Trip://com.trip.tripmobile"];
if ([app canOpenURL:url]) {

NSLog(@"can  launch B app!");
[app openURL:url];

}else {

NSLog(@"can not launch B app!");

}


Trip: 为URL Schemes

com.trip.tripmobile : 为Bundle identifier

在项目中添加URL types

URL identifier 设为 com.trip.tripmobile

URL Schemes 设置为 Trip

iOS9 要设置白名单


<key>LSApplicationQueriesSchemes</key>

<array>

<string>Trip8080</string>

</array>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: