0

Every time when I’m signing into the app or reinstalling app I didn’t receive group message history. I have searched a lot for message archiving in MUC for iOS. Ejabberd doesn’t provide me old messages of the group although I configured setting into the YML file as mentioned in the attached image.enter image description here I have kept history size of 10. It means at least 10 messages must be fetched every time when I login into the app or reinstall the app but I could not receive 10 messages every-time after reinstalling the app. I’m using Robbiehanson/XMPPFramework for iOS to implement XMPP based chat. I also performed MucSub based MUC to send/receive messages.

The scenario which I have performed: I’m part of one MUC group. The member of the associated group sent 15 Messages into the group. I have received all those messages when I’m online. Now I am logged out from the group. Deleted the app from the device and reinstalled it into the device with the same login credentials. At this time I could not see the 15 messages which I received earlier. Here I would like to get all 15 Messages even after reinstalling the app into the iOS device.

I have searched on various Stack overflow questions but none of them are helpful to me. Your help will be appreciated.

Jekil Patel
  • 403
  • 4
  • 18

1 Answers1

0

Maybe you can try joining the room by specifying the history element with the maxstanzas specified.

We have similar case like we need last 3 months history while joining the room, So we mentioned that in history tag, Like below code sample

let historyElement = DDXMLElement(name: "history")
historyElement.addAttribute(withName: "since", stringValue: ((lastDate as NSDate).addingTimeInterval(1).xmppDateTimeString())!)
room.join(usingNickname: userJidString, history: historyElement)
Rahul R
  • 184
  • 1
  • 7
  • Rahul Ramchandra, thanks for the reply. I have already tried it while sending the user's Presence into the group. I am sending the user's presence into the group only for the one time when a user gets an invitation for the group and the rest of the group management functionality is being managed by MusSub provided by the ejabberd where in I don't have to wait for getting presence to send/receive messages. – Jekil Patel Jan 08 '20 at 04:14
  • Rahul Ramchandra, The problem is, I could not get old messages which are being received by using presence. If I send presence for the group every time at the app launch or re-login I have to wait to get the Presence for all group and then after I can send/receive messages. MucSub allows me to send/receive a presence without sending a presence for the group every time. – Jekil Patel Jan 08 '20 at 04:16