1
votes

We are implementing a chatting system that allow users to receive messages/notification when they are not connected to a MUC group, and I know that Ejabberd supported it from 16.08, via this document: https://docs.ejabberd.im/developer/xmpp-clients-bots/proposed-extensions/muc-sub/#list-of-subscriptions However I can't find any example for iOS implementation I wonder if any one has implemented this feature on iOS, or any guidelines to implement this

1
any update for this? im looking for way to implement this too, any help would be appreciatetitan

1 Answers

0
votes

Include XMPPMUCSub.h and .m file into your project.

Now after connecting xmppstream activate XMPPMUCSub service for activation use below code.

xmppMucSub = [[XMPPMUCSub alloc] initWithDispatchQueue:dispatch_get_main_queue()];
[xmppMucSub activate:xmppStream];
[xmppMucSub addDelegate:self delegateQueue:dispatch_get_main_queue()];

Now you have to implement delegate methods of XMPPMUCSub for method check class and implement it.

Now when every you create new xmpproom you need to call below method.

[xmppMucSub supportedBy:<Your xmpproom>]; 

if service support then below delegate method call and you need to subscribe it.

- (void)xmppMUCSub:(nonnull XMPPMUCSub *)sender serviceSupportedBy:(nonnull XMPPJID *)room{
    NSLog(@"serviceSupportedBy:-%@", room);
    [xmppMucSub subscribeTo:room nick:[xmppStream.myJID user] password:nil];
}

For more information refer below link.

https://github.com/Digithurst/XMPPFramework/tree/master/Extensions/MUC-Sub