func conversation(_ conversation: AVIMConversation, didReceiveUnread unread: Int)

这是接受未读消息的回调函数,我想在这个回调中执行

    conversation.setValue(unread, forKey: "attributes.unread")

将未读消息数写到会话的自定义属性中,但是报错:

'NSUnknownKeyException', reason: '[<AVIMConversation 0x1700b4e80> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key attributes.unread.'

下面这句直接编译不过,提示 read-only

    conversation.attributes?.updateValue(unread, forKey: "unread")

你好,我们不期望应用直接修改 unread 数量,请在其他地方关联这个未读数。

不是修改 unread 是修改 conversation.attributes

不应该修改 attributes,因为 attributes 是对话成员共享的属性。请用其他方式关联 unread。