Send message using XMPP openfire in swift 3.0

I want to send a message using xmpp in openFire, everything works fine, even I can get the message. but I can’t send, I don’t know why? I tried this code:

@IBAction func SendMessageClicked(_ sender: AnyObject) {

       let message = messageTextField.text
        var clientJid: XMPPJID!
        clientJid = XMPPJID.init(string: "Bure@ip-772-99-99-99.ec3.internal")
        let senderJID = clientJid
          let msg = XMPPMessage(type: "chat", to: senderJID)
        msg?.addBody(message)
        stream?.send(msg)
}

Since it does not throw any errors, but the message is not sent. Help Plesha.

+4
source share

Source: https://habr.com/ru/post/1666995/


All Articles