标签:blog http io ar os 使用 sp strong on
转自:http://www.cnblogs.com/dyingbleed/archive/2013/05/13/3071544.html
好友状态
获取好友状态,通过实现
- (void)xmppStream:(XMPPStream *)sender didReceivePresence:(XMPPPresence *)presence
方法
当接收到 <presence /> 标签的内容时,XMPPFramework 框架回调该方法
一个 <presence /> 标签的格式一般如下:
<presence from="">
<show>这里是显示的内容<show />
<status>这里是显示的状态<status />
<presence />
presence 的状态:
available 上线
away 离开
do not disturb 忙碌
unavailable 下线
- (void)xmppStream:(XMPPStream *)sender didReceivePresence:(XMPPPresence *)presence { NSString *presenceType = [presence type]; NSString *presenceFromUser = [[presence from] user]; if (![presenceFromUser isEqualToString:[[sender myJID] user]]) { if ([presenceType isEqualToString:@"available"]) { // } else if ([presenceType isEqualToString:@"unavailable"]) { // } } }
【iOS XMPP】使用XMPPFramewok(三):好友状态
标签:blog http io ar os 使用 sp strong on
原文地址:http://www.cnblogs.com/wangpei/p/4126547.html