美文网首页深入浅出iOSIOS
应用程序调用QQ聊天

应用程序调用QQ聊天

作者: 雪精灵是我 | 来源:发表于2016-10-26 21:47 被阅读59次

需要在Info中添加 LSApplicationQueriesSchemes,并添加itme  值为 mqq

-(void)connectButton:(UIButton *)button{

//联系客服

//是否安装QQ

if([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"mqq://"]])

{

//用来接收临时消息的客服QQ号码(注意此QQ号需开通QQ推广功能,否则陌生人向他发送消息会失败)

NSString *QQ = qqNum;

//调用QQ客户端,发起QQ临时会话

NSString *url = [NSString stringWithFormat:@"mqq://im/chat?chat_type=wpa&uin=%@&version=1&src_type=web",QQ];

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]];

}

}

相关文章

网友评论

    本文标题:应用程序调用QQ聊天

    本文链接:https://www.haomeiwen.com/subject/axkvyttx.html