简体   繁体   中英

XMPP multi device sync with xmpp chat message

XMPP multi device sync : I am trying to develop a messaging application using XMPP. I am trying to implement chat sync on multiple devices per user. But I am able to get the messages only on the logged devices or the first offline device which logs in. Different devices use different resource so that full jabber id is different.

If you are using XMPPFramework in iOS, you can add XMPPMessageCarbons extension

var xmppMessageCarbon = XMPPMessageCarbons()
xmppMessageCarbon?.autoEnableMessageCarbons = true
xmppMessageCarbon?.addDelegate(self, delegateQueue: xmppQueue)
xmppMessageCarbon?.activate(xmppStream)

and implement its delegates

func xmppMessageCarbons(_ xmppMessageCarbons: XMPPMessageCarbons!, willReceive message: XMPPMessage!, outgoing isOutgoing: Bool) {

}

func xmppMessageCarbons(_ xmppMessageCarbons: XMPPMessageCarbons!, didReceive message: XMPPMessage!, outgoing isOutgoing: Bool) {

}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM