iOS 检测有没有安装其它应用 和ios9下要注意的地方
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>