I am storing user contact in arrContactList
NSArray *arrContactList = [QBChat instance].contactList.contacts;
From arrContactList, how the presence status can be derived.
Also after getting presence status, if user goes online or offline, how it can be found.
// contact has userId and presence status
for(QBContactListItem *contact in arrContactList) {
BOOL isOnline = contact.isOnline;
NSInteger userIdValue = contact.userID;
if(isOnline) {
NSLog(@"User %ld is online",(long)userIdValue);
}
else {
NSLog(@"User %ld is offline",(long)userIdValue);
}
}
// When a contact user goes online or offline, this method gets called
- (void)chatDidReceiveContactItemActivity:(NSUInteger)userID isOnline:(BOOL)isOnline status:(NSString *)status{
// here you can check presence status using isOnline and also we get userID
// so list of user IDs who are online can be maintained in an array
}