我指的是quickblox中的示例iOS应用程序,以便在我的应用程序中集成聊天/呼叫功能。但是我看到了SDK和Q-municate应用程序在框架上的不同。
视频/音频调用与SDK一起提供的示例应用程序运行良好,但当我试图查找用户的在线/离线状态时,我必须包括来自Q-多一的框架。在包括我无法在模拟器上运行之后,它会产生错误。
“建筑x86_64的未定义符号”
但它运行在真正的设备上。
视频调用挂在设备上,其框架来自Q-municate,但在SDK中的框架工作得很好。
知道有什么区别吗??
发布于 2015-07-28 10:25:39
更新:下面的方法应该仍然有效。也有一种新的方法来做到这一点,这是不可用的时候,这个答案被张贴。请参见下面的更新-2节.
为了查找用户的状态(在线/离线),Quickblox建议如下:
每个用户都有lastRequestAt字段,该字段显示最后一个用户活动时间。您可以使用它来确定用户现在是在线还是脱机。
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
}更新-2
若要查找在线用户列表,请使用以下内容:
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
}];取自这里。
https://stackoverflow.com/questions/31646951
复制相似问题