forwardMessageByStep static method
Implementation
static Future<void> forwardMessageByStep(int conversationType, String targetId, Message message, {Function(int messageId, int status, int code)? finished}) async {
Map msgMap = MessageFactory.instance!.message2Map(message);
// 此处获取当前时间戳传给原生方法,并且当做 sendMessageCallbacks 的 key 记录 finished
DateTime time = DateTime.now();
int timestamp = time.millisecondsSinceEpoch;
Map map = {"message": msgMap, "conversationType": conversationType, "targetId": targetId, "timestamp": timestamp};
if (finished != null) {
sendMessageCallbacks[timestamp] = finished;
}
await _channel.invokeMethod(RCMethodKey.ForwardMessageByStep, map);
}