NSLog(@"%@",self.vcard);
// <iq from='stpeter@jabber.org/roundabout'
// id='v3'
// to='jer@jabber.org'
// type='get'>
// <vCard xmlns='vcard-temp'/>
// </iq>
NSXMLElement *presenceElement=[NSXMLElement elementWithName:@"iq"];
//[presenceElement addAttributeWithName:@"from" stringValue:@"appledemacbook-pro.local/roundabout"];
[presenceElement addAttributeWithName:@"id" stringValue:@"990"];
[presenceElement addAttributeWithName:@"to" stringValue:jidStr];
[presenceElement addAttributeWithName:@"type" stringValue:@"get"];
NSXMLElement *xElement=[NSXMLElement elementWithName:@"vCard" xmlns:@"vcard-temp"];
[presenceElement addChild:xElement];
[[[self appDelegate] xmppStream] sendElement:presenceElement];
之后在appdelegate 的did received 收到 vCard
iOS xmpp获取好友详情
最新推荐文章于 2015-11-04 21:06:10 发布