Send a message via XMPPFramework for iOS

前端 未结 1 1049
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-06 08:16

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 spec

相关标签:
1条回答
  • 2021-02-06 08:48
    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

    0 讨论(0)
提交回复
热议问题