I am referring to the sample iOS app in quickblox to integrate the chat / call feature in my app. But I see there is a difference in framework in the SDK and Q-municate app.
Video / audio call works fine with the sample app given along with SDK but when I tried to find online / offline status of the user i had to include framework from Q-municate. After including that i am not able to run on simulator , it gives error
"Undefined symbols for architecture x86_64"
but it runs on real device.
The video call hangs on device with framework from Q-municate but works fine with the framework in SDK.
Any idea what is the difference ??
Update: Following method should still work. There is also a new way to do this, which was not available at the time this answer was posted. See Update-2 section below.
To find the status of the user (online/offline), Quickblox suggests the following:
Each user has the lastRequestAt
field - that shows last user activity time. You can use it to determine if user online or offline now.
NSInteger currentTimeInterval = [[NSDate date] timeIntervalSince1970];
NSInteger userLastRequestAtTimeInterval = [[user lastRequestAt] timeIntervalSince1970];
// if user didn't do anything last 5 minutes (5*60 seconds)
if((currentTimeInterval - userLastRequestAtTimeInterval) > 5*60){
// user is offline now
}
Update-2
To find the list of online users use the following:
NSMutableDictionary *filters = [NSMutableDictionary dictionary];
filters[@"filter[]"] = @"date last_request_at gt 2012-03-20T08:47:34Z";
[QBRequest usersWithExtendedRequest:filters page:[QBGeneralResponsePage responsePageWithCurrentPage:1 perPage:100] successBlock:^(QBResponse *response, QBGeneralResponsePage *page, NSArray *users) {
// Request succeeded
} errorBlock:^(QBResponse *response) {
// Handle error
}];
Taken from here.