How to send message using XMPP Framework

后端 未结 4 1308
死守一世寂寞
死守一世寂寞 2020-12-30 10:27

I am creating a chat application using XMPP Framework in iphone. i could get received messages but i am not able to send a message. can any one give me solution for this?? <

4条回答
  •  醉酒成梦
    2020-12-30 11:15

    Swift 3 answer:

    let user = XMPPJID(string: "user@example.com")
    let msg = XMPPMessage(type: "chat", to: user)
    msg?.addBody("test message")
    self.xmppStream.send(msg)
    

提交回复
热议问题