robbiehanson / XMPPFramework

An XMPP Framework in Objective-C for Mac and iOS
Other
5.91k stars 2.09k forks source link

Fetching MUC Message History using MucSub in IOS #1151

Open Spaculus opened 4 years ago

Spaculus commented 4 years ago

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 below snippet:

**## mod_mam: {} mod_mam:

default: always

db_type: sql user_mucsub_from_muc_archive:true mod_muc:

host: "conference.@HOST@"

access:
     - allow
access_admin:
     - allow: admin
access_create: muc_create
access_persistent: muc_create
max_user_conferences: 500
max_rooms_discoitems: 500
db_type: sql
history_size: 10
default_room_options: {allow_subscription: true, mam: true, members_only: true, persistent: false}**

I have kept a 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.