NIMSession class
最近会话
- Annotations
-
- @JsonSerializable()
Constructors
-
NIMSession({required String sessionId, String? senderAccount, String? senderNickname, required NIMSessionType sessionType, String? lastMessageId, NIMMessageType? lastMessageType, NIMMessageStatus? lastMessageStatus, String? lastMessageContent, int? lastMessageTime, NIMMessageAttachment? lastMessageAttachment, int? unreadCount = 0, Map<
String, dynamic> ? extension, Map<String, dynamic> ? sessionForWeb, int? tag}) -
NIMSession.fromMap(Map<
String, dynamic> map) -
factory
Properties
-
extension
↔ Map<
String, dynamic> ? -
扩展字段
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- lastMessageAttachment → NIMMessageAttachment?
-
如果最近一条消息是扩展消息类型,获取消息的附件内容.
在最近消息列表,第三方app可据此自主定义显示的缩略语final - lastMessageContent → String?
-
获取最近一条消息的缩略内容。
对于文本消息,返回文本内容。
对于其他消息,返回一个简单的说明内容final - lastMessageId → String?
-
最近一条消息的消息ID NIMMessage.uuid
final
- lastMessageStatus → NIMMessageStatus?
-
获取最近一条消息状态
final
- lastMessageTime → int?
-
获取最近一条消息的时间,单位为ms
final
- lastMessageType → NIMMessageType?
-
获取最近一条消息的消息类型
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- senderAccount → String?
-
获取与该联系人的最后一条消息的发送方的帐号
final
- senderNickname → String?
-
获取与该联系人的最后一条消息的发送方的昵称
final
-
sessionForWeb
↔ Map<
String, dynamic> ? -
web 专用session字段
其中 isTop?: bool 字段,表示该会话是否置顶;
msgReceiptTime ?: int ,表示对方已读的最新一条消息的时间。
getter/setter pair
- sessionId → String
-
最近联系人的ID(好友帐号,群ID等)
final
- sessionType → NIMSessionType
-
获取会话类型
final
- tag ↔ int?
-
设置一个标签,用于做联系人置顶、最近会话列表排序等扩展用途。 SDK不关心tag的意义。
第三方app需要事先规划好可能的用途 android 独有,不推荐使用,建议使用extension扩展字段代替getter/setter pair - unreadCount ↔ int?
-
获取该联系人的未读消息条数
getter/setter pair
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toMap(
) → Map< String, dynamic> -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited