我可以连接到本地服务器,也可以连接到 google talk 并在 iphone 聊天客户端上显示好友和聊天,但是当我尝试获取本地服务器的好友列表时,它返回 0。
- (void)xmppStream:(XMPPStream *)sender didReceivePresence:(XMPPPresence *)presence {
// a buddy went offline/online
NSString *presenceType = [presence type]; // online/offline
NSString *myUsername = [[sender myJID] user];
NSString *presenceFromUser = [[presence from] user];
if (![presenceFromUser isEqualToString:myUsername])
{
if ([presenceType isEqualToString:@"available"]) {
[_chatDelegate newBuddyOnline:[NSString stringWithFormat:@"%@@%@", presenceFromUser, @"ip address"]];
} else if ([presenceType isEqualToString:@"unavailable"]) {
[_chatDelegate buddyWentOffline:[NSString stringWithFormat:@"%@@%@", presenceFromUser, @"ip address"]];
}
}
}
这里的ip地址是我的服务器名请帮忙!
请帮我!!!