0
我在我的应用程序中使用XMPP。每当我尝试将消息发送到任何特定的ID(例如,我的代码中的'[email protected]')时,我的消息都不会被发送。 我的代码如下。提前致谢。未通过XMPP发送的消息
- (IBAction)sendMsg:(id)sender
{
NSXMLElement *body = [NSXMLElement elementWithName:@"body"];
[body setStringValue:msgField.text];
NSXMLElement *message = [NSXMLElement elementWithName:@"message"];
[message addAttributeWithName:@"type" stringValue:@"chat"];
[message addAttributeWithName:@"to" stringValue:@"[email protected]"];
[message addChild:body];
iPhoneXMPPAppDelegate *share = [iPhoneXMPPAppDelegate sharedInstance];
[[share xmppStream] sendElement:message];
}
是的,用户在我的联系人列表中。 – John
然后请将xml日志添加到您的问题 – Alex