iOS 调起外部浏览器打开指定网址(QQ浏览器,UC)

-(IBAction)UC:(id)sender{

if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"ucbrowser://"]]) {
    [[UIApplication sharedApplication ] openURL:[NSURL URLWithString:@"ucbrowser://https://www.baidu.com"]];
    NSLog(@"open uc...");
}

}

-(IBAction)LB:(id)sender{
//猎豹没实现,如果有知道,请回一下。谢谢。
if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"lb://"]]) {
[[UIApplication sharedApplication ] openURL:[NSURL URLWithString:@"lb://https://www.baidu.com"]];
NSLog(@"open lb...");
}
}

-(IBAction)QQ:(id)sender{

if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"mttbrowser://"]]) {
    [[UIApplication sharedApplication ] openURL:[NSURL URLWithString:@"mttbrowser://url=https://www.baidu.com"]];
    NSLog(@"open.qq..");
}

}

记得添加对应的Schema

你可能感兴趣的:(iOS 调起外部浏览器打开指定网址(QQ浏览器,UC))