createSession method Null safety
- {required String sessionId,
- required NIMSessionType sessionType,
- int tag = 0,
- required int time,
- bool linkToLastMessage = false}
Create an empty conversation and save it to the database.
sessionId
- The conversation ID
sessionType
- The conversation type
tag
- The conversation tag, for example, it can be the tag representing that the conversation is pinned (implemented in the UIKit: RECENT_TAG_STICKY ); you can customize it as required; pass 0 if you do not need the customization.
time
- The conversation time (unit: ms)
linkToLastMessage
- Specify whether to include the information of the last message.
Implementation
/// <br> [sessionId] - The conversation ID
/// <br> [sessionType] - The conversation type
/// <br> [tag] - The conversation tag, for example, it can be the tag representing that the conversation is pinned (implemented in the UIKit: RECENT_TAG_STICKY ); you can customize it as required; pass 0 if you do not need the customization.
/// <br> [time] - The conversation time (unit: ms)
/// <br> [linkToLastMessage] - Specify whether to include the information of the last message.
Future<NIMResult<NIMSession>> createSession({
required String sessionId,
required NIMSessionType sessionType,
int tag = 0,
required int time,
bool linkToLastMessage = false,
}) {
return _platform.createSession(
sessionId: sessionId,
sessionType: sessionType,
time: time,
tag: tag,
linkToLastMessage: linkToLastMessage,
);
}