I am implementing XMPP in my ios app. I am aware of XMPPMessage+XEP_0085
category which has a few simple methods like addActiveChatState
, addComposingChatState
and a few others. I want to show chat notifications e.g. when user is typing a message or paused. I am using following code to send message:
NSXMLElement *message = [NSXMLElement elementWithName:@"message"];
[message addAttributeWithName:@"type" stringValue:@"chat"];
[message addAttributeWithName:@"to" stringValue:user];
[message addAttributeWithName:@"id" stringValue:messageID];
[message addChild:body];
[message addChild:setting];
// chat notifications
XMPPMessage *xmppMessage = [XMPPMessage messageFromElement:message];
[xmppMessage addActiveChatState];
[xmppMessage addComposingChatState];
[xmppMessage addPausedChatState];
[xmppMessage addInactiveChatState];
[xmppMessage addGoneChatState];
[_appDelegate.xmppStream sendElement:xmppMessage];
In which xmpp delegate I should receive these notifications. I am not receiving chat notifications in
- (XMPPMessage *)xmppStream:(XMPPStream *)sender willReceiveMessage:(XMPPMessage *)message
delegate.