objective c - How to send message using XMPP Framework -
i creating chat application using xmpp framework in iphone. received messages not able send message. can 1 give me solution this??
- (void)sendmessage:(nsstring *)msgcontent { nsstring *messagestr = textfield.text; if([messagestr length] > 0) { nsxmlelement *body = [nsxmlelement elementwithname:@"body"]; [body setstringvalue:messagestr]; nsxmlelement *message = [nsxmlelement elementwithname:@"message"]; [message addattributewithname:@"type" stringvalue:@"chat"]; [message addattributewithname:@"to" stringvalue:[jid full]]; [message addchild:body]; [xmppstream sendelement:message]; } }
use above code in chatviewcontroller ..it working fine me.
Comments
Post a Comment