I have been using quickblox sdk for IOS and i have one query regarding user's online status.
Below is the code which is recommended.
QBUUser *user = ...;
NSInteger currentTimeInterval = [[NSDate date] timeIntervalSince1970];
NSInteger userLastRequestAtTimeInterval = [[user lastRequestAt] timeIntervalSince1970];
// if user didn't do anything last 1 minute (60 seconds)
if((currentTimeInterval - userLastRequestAtTimeInterval) > 60)
{
// user is offline now
}
But my query is that do i need to check this in a timer event because every 5-10 seconds i would want to know if user is online or there is any other better approach?