判断客户端是否安装QQ,并发起会话
func sendQQSession(by QQNum: String) {
if UIApplication.shared.canOpenURL(URL(string: "mqq://")!) {
let url = "mqq://im/chat?chat_type=wpa&uin=\(QQNum)&version=1&src_type=web"
if #available(iOS 10.0, *) {
UIApplication.shared.open(URL(string: url)!, options: [:]) { (fn) in}
} else {UIApplication.shared.openURL(URL(string: url)!)}
}else {print("没有安装QQ客户端")}}