How to get information about an XMPP user
I need to get user information stored on openfire server.
XMPPvCardCoreDataStorage* xmppvCardStorage = [XMPPvCardCoreDataStorage sharedInstance];
XMPPvCardTempModule* m = [[XMPPvCardTempModule alloc] initWithvCardStorage:xmppvCardStorage];
[m fetchvCardTempForJID:[sender myJID]];
How / where can I read the query result? Correct way to "query" the openfire server?
I've also tried:
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];
If the sender is the XMPPJID of the user you were looking for.
The XMPPIQ was sent successfully and the debugger enters the method:
- (XMPPIQ *)xmppStream:(XMPPStream *)sender willReceiveIQ:(XMPPIQ *)iq;
If I print iq, I:
<iq xmlns="jabber:client" type="result" id="v1" to=<MYJID> >
<vCard xmlns="vcard-temp"/>
</iq>
+3
source to share
No one has answered this question yet
Check out similar questions: