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>