美文网首页
[IOS] Swift跳QQ聊天

[IOS] Swift跳QQ聊天

作者: 很老的老头 | 来源:发表于2018-09-18 13:22 被阅读0次

Swift跳QQ聊天

1.在项目info.plist添加LSApplicationQueriesSchemes字段 类型Array
2.在此Array中添加一个 item 值设为:mqq

 if(UIApplication.shared.canOpenURL(URL(string: "mqq://")!)){
            let str =  String(format: "mqq://im/chat?chat_type=wpa&uin=%@&version=1&src_type=web", qqNumber)
            UIApplication.shared.openURL(URL(string: str)!)
        }else{
            addHint(_msg: "没有发现QQ")
        }

相关文章

网友评论

      本文标题:[IOS] Swift跳QQ聊天

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