1.当关闭app后,获取的会话未读数量为空,但是并没有设置会员为已读,就是说,关闭app断开连接后会自动清除当前用户的未读消息数量
AVIMConversationQuery * query = [[LCIMClient ShareClient] conversationQuery];
query.limit = 10000;
/* 指定返回对话的最后一条消息 */
// query.cachePolicy = kAVCachePolicyNetworkElseCache;
query.option = AVIMConversationQueryOptionWithMessage;
__weak typeof(self)weakself = self;
[query findConversationsWithCallback:^(NSArray * _Nullable objects, NSError * _Nullable error) {
[weakself.recentchatview passconversations:objects];
}];未读书是通过查询列表累加的。
2.关于离线推送角标数量的控制,设置@"badge" : @"Increment"自增长时,角标数量会一直累加,请问不是设置会话已读会清空对应数量吗,怎么处理角标一直累加问题。
AVIMMessageOption *option = [[AVIMMessageOption alloc] init];
NSMutableDictionary * pushdata = [NSMutableDictionary dictionaryWithDictionary:@{@"alert" : @"[圖片]", @"sound" : @"default", @"badge" : @"Increment", @"nickname":[AFNetworkingQuest GetLoginUserInfo][@"nickName"],@"mutable-content":@(1)}];
if ([AFNetworkingQuest GetLoginUserInfo][@"picture"]) {
[pushdata setObject:[AFNetworkingQuest GetLoginUserInfo][@"picture"] forKey:@"imageAbsoluteString"];
}
option.pushData = pushdata;
[conversation sendMessage:message option:option callback:^(BOOL succeeded, NSError *error) {//带option发送推送。。。。。
}