Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ejabberd How to use MUC/SUB with xmppframework

We are using ejabberd 17.01 for an iOS and Android application.

We need to create a persistent room where user shall be able to receive messages while they are not connected / joined in the room.

We think ejabberd has the solution for that.

How to configure that in XMPPFramework in iOS and smack in Android SMACK library?

like image 425
For Guru Avatar asked Oct 29 '22 12:10

For Guru


1 Answers

We implemented an XMPPMUCSub module in a fork of XMPPFramework at https://github.com/Digithurst/XMPPFramework/blob/master/Extensions/MUC-Sub/XMPPMUCSub.h

You setup this module like any other in XMPPFramework and then subscribe users to rooms with the subscribe method.

- (nullable NSString *)subscribe:(nonnull XMPPJID *)user to:(nonnull XMPPJID *)room 
                        nick:(nullable NSString *)nick password:(nullable NSString *)pass;

Events will then start flowing through the XMPPMUCSubDelegate.

like image 76
Robert Lohr Avatar answered Nov 15 '22 05:11

Robert Lohr