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