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

Posted 宁静暖风

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了两句话跳转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];
    }

 

以上是关于两句话跳转QQ聊天界面 通过web方式的主要内容,如果未能解决你的问题,请参考以下文章