forceSetChatRoomEntry static method

Future<void> forceSetChatRoomEntry(
  1. String chatRoomId,
  2. String key,
  3. String value,
  4. bool sendNotification,
  5. bool autoDelete,
  6. String notificationExtra,
  7. dynamic finished(
    1. int? code
    )?,
)

强制设置聊天室自定义属性

chatroomId 聊天室 Id

key 聊天室属性名称,Key 支持大小写英文字母、数字、部分特殊符号 + = - _ 的组合方式,最大长度 128 个字符

value 聊天室属性对应的值,最大长度 4096 个字符

sendNotification 是否需要发送通知,如果发送通知,聊天室中的其他用户会接收到 RCChatroomKVNotificationMessage 通知消息,消息内容中包含操作类型(type)、属性名称(key)、属性名称对应的值(value)和自定义字段(extra)

autoDelete 用户掉线或退出时,是否自动删除该 Key、Value 值;自动删除时不会发送通知

notificationExtra 通知的自定义字段,RC:chrmKVNotiMsg 通知消息中会包含此字段,最大长度 2 kb

finished 回调结果,code 为 0 代表操作成功,其他值代表失败 此接口只支持聊天室,必须先开通聊天室属性自定义功能

Implementation

static Future<void> forceSetChatRoomEntry(String chatRoomId, String key, String value, bool sendNotification, bool autoDelete, String notificationExtra, Function(int? code)? finished) async {
  Map map = {"chatRoomId": chatRoomId, "key": key, "value": value, "sendNotification": sendNotification, "autoDelete": autoDelete, "notificationExtra": notificationExtra};
  int? result = await _channel.invokeMethod(RCMethodKey.ForceSetChatRoomEntry, map);
  if (finished != null) {
    finished(result);
  }
}