2017-08-17 124 views

回答

0

//聯繫人有帳戶及存在狀態

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); 
    } 
} 

//當接觸用戶上線或離線,該方法被調用

- (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 
} 
相關問題