我正在使用XMPPFramework for iOS并将ejabberd作为XMPP Server。我希望收到我发送给服务器的消息的确认。
XMPPStream *xmppS = [[XMPPStream alloc] init];
[xmppS addDelegate:self delegateQueue:dispatch_get_main_queue()];
XMPPStreamManagement *xsm = [[XMPPStreamManagement alloc] init];
[xsm addDelegate:self delegateQueue:dispatch_get_main_queue()];
[xsm activate:xmppS];
NSXMLElement *a = [NSXMLElement elementWithName:@"request" xmlns:@"urn:xmpp:receipts"];
XMPPElement *e = [[XMPPElement alloc] initWithName:@"message"];
[e addAttributeWithName:@"id" stringValue:@"123456"];
[e addAttributeWithName:@"type" stringValue:@"chat"];
[e addAttributeWithName:@"to" stringValue:@"testuser@myxmppserver.com"];
[e addAttributeWithName:@"from" stringValue:@"testuser2@myxmppserver.com"];
[e addChild:a];
[xsm.xmppStream sendElement:e];
收件人已成功收到邮件,但我怎么知道服务器是否收到了邮件?