我需要检索保存在openfire服务器上的用户信息。
XMPPvCardCoreDataStorage* xmppvCardStorage = [XMPPvCardCoreDataStorage sharedInstance];
XMPPvCardTempModule* m = [[XMPPvCardTempModule alloc] initWithvCardStorage:xmppvCardStorage];
[m fetchvCardTempForJID:[sender myJID]];
我如何/在哪里可以阅读请求结果?是“查询”openfire服务器的正确方法吗?
我也尝试过:
XMPPIQ *iq = [[XMPPIQ alloc] initWithType:@"get"];
[iq addAttributeWithName:@"id" stringValue:@"v1"];
[iq addAttributeWithName:@"from" stringValue:[NSString stringWithFormat:@"%@", sender]];
[iq addAttributeWithName:@"type" stringValue:@"get"];
DDXMLElement *query = [DDXMLElement elementWithName:@"vCard" xmlns:@"vcard-temp"];
[iq addChild:query];
[_xmppStream sendElement:iq];
发件人是搜索到的用户的XMPPJID。
XMPPIQ成功发出,调试器输入方法:
- (XMPPIQ *)xmppStream:(XMPPStream *)sender willReceiveIQ:(XMPPIQ *)iq;
如果我打印iq:
<iq xmlns="jabber:client" type="result" id="v1" to=<MYJID> >
<vCard xmlns="vcard-temp"/>
</iq>