两句话跳转QQ聊天界面 通过web方式

NSString *qq=[NSString stringWithFormat:@"mqq://im/chat?chat_type=wpa&uin=%@&version=1&src_type=web",@"11027037153"];
    NSURL *url2 = [NSURL URLWithString:qq];
    if ([[UIApplication sharedApplication] canOpenURL:url2]) {
        [[UIApplication sharedApplication] openURL:url2];
    }else{
        UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"提示" message:@"对不起,您还没安装QQ" preferredStyle:UIAlertControllerStyleAlert];
        
        UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
            return ;
        }];
        [alertController addAction:cancelAction];
        [self presentViewController:alertController animated:YES completion:nil];
    }
原文地址:https://www.cnblogs.com/dujiahong/p/7591177.html