Pergunta

How do I send a message through the XMPPFramework for objc and ios?

Its really bugging me now. I need to build a custom method with some custom XML and send it to a specific JID.

Any ideas?

Thank you.

Foi útil?

Solução

NSXMLElement *body = [NSXMLElement elementWithName:@"body"];
[body setStringValue:textvalue];

NSXMLElement *message = [NSXMLElement elementWithName:@"message"];
[message addAttributeWithName:@"type" stringValue:@"chat"];
[message addAttributeWithName:@"to" stringValue:[jid full]];
[message addChild:body];

[[self xmppStream] sendElement:message];

try this

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top