原始地址: XMPPFrameWork IOS 开发(五)获取好友信息和添加删除好友
好友列表和好友名片
- [_xmppRoster fetchRoster];
-
-
- - (void)xmppRoster:(XMPPRoster *)sender didRecieveRosterItem:(NSXMLElement *)item
-
-
- - (void)xmppRosterDidEndPopulating:(XMPPRoster *)sender
-
-
- - (void)fetchvCardTempForJID:(XMPPJID *)jid;
-
-
- - (void)fetchvCardTempForJID:(XMPPJID *)jid ignoreStorage:(BOOL)ignoreStorage;
-
-
- - (XMPPvCardTemp *)vCardTempForJID:(XMPPJID *)jid shouldFetch:(BOOL)shouldFetch;
-
-
- - (void)updateMyvCardTemp:(XMPPvCardTemp *)vCardTemp;
-
-
- - (void)xmppvCardTempModule:(XMPPvCardTempModule *)vCardTempModule
- didReceivevCardTemp:(XMPPvCardTemp *)vCardTemp
- forJID:(XMPPJID *)jid
添加好友
-
- - (void)XMPPAddFriendSubscribe:(NSString *)name
- {
-
- XMPPJID *jid = [XMPPJID jidWithString:[NSString stringWithFormat:@"%@@%@",name,XMPPHOST]];
-
- [xmppRoster subscribePresenceToUser:jid];
-
- }
-
- - (void)xmppRoster:(XMPPRoster *)sender didReceivePresenceSubscriptionRequest:(XMPPPresence *)presence
- {
-
- NSString *presenceType = [NSString stringWithFormat:@"%@", [presence type]];
-
- NSString *presenceFromUser =[NSString stringWithFormat:@"%@", [[presence from] user]];
- NSLog(@"presenceType:%@",presenceType);
-
- NSLog(@"presence2:%@ sender2:%@",presence,sender);
-
- XMPPJID *jid = [XMPPJID jidWithString:presenceFromUser];
-
- [xmppRoster acceptPresenceSubscriptionRequestFrom:jid andAddToRoster:YES];
-
- }
删除好友
-
- - (void)removeBuddy:(NSString *)name
- {
- XMPPJID *jid = [XMPPJID jidWithString:[NSString stringWithFormat:@"%@@%@",name,XMPPHOST]];
-
- [self xmppRoster] removeUser:jid];
- }
xmpp获取好友信息和添加删除好友(4),布布扣,bubuko.com
xmpp获取好友信息和添加删除好友(4)
原文:http://www.cnblogs.com/yulang314/p/3705600.html