1
votes

I am able to send Message to specific Person selected through XMPPframework IOS. I am receiving messages from others sent to me and I can see using NSLog in following method.

- (void)xmppStream:(XMPPStream *)sender didReceiveMessage:(XMPPMessage *)message

I have gone through What I want to know is, if any method available in XMPP to directly decode received chat message ? i.e. like If

- [message getChatMessage]; 

Or we need to implement on our own ? i.e decoding received XML and get requirement element string.

Please share if any one knows.

1

1 Answers

3
votes

Well, you can get, for example, the body of the message by doing this:

NSString *body = [[message elementForName:@"body"] stringValue];

The values for other tags can be found like this. XMPP uses XML to structure its data, so the elementForName: and attributeForName: methods should give you the data you need.