sendForwardMessage method

  1. @Deprecated('sendForwardMessage自3.6.0开始弃用,我们将创建消息与发送消息分离,请先使用createForwardMessage创建消息,再调用sendMessage发送消息')
Future<V2TimValueCallback<V2TimMessage>> sendForwardMessage({
  1. required String msgID,
  2. required String receiver,
  3. required String groupID,
  4. MessagePriorityEnum? priority = MessagePriorityEnum.V2TIM_PRIORITY_NORMAL,
  5. bool onlineUserOnly = false,
  6. bool isExcludedFromUnreadCount = false,
  7. OfflinePushInfo? offlinePushInfo,
  8. String? webMessageInstance,
})

转发消息

如果需要转发一条消息,不能直接调用 sendMessage 接口发送原消息,需要先 createForwardMessage 创建一条转发消息再发送。

参数 message 待转发的消息对象,消息状态必须为 V2TIM_MSG_STATUS_SEND_SUCC,消息类型不能为 V2TIMGroupTipsElem。 返回 转发消息对象,elem 内容和原消息完全一致。

注意 web 端使用时必须传入webMessageInstance 字段。 在web端返回的消息实例会包含该字段

Implementation

@Deprecated(
    'sendForwardMessage自3.6.0开始弃用,我们将创建消息与发送消息分离,请先使用createForwardMessage创建消息,再调用sendMessage发送消息')
Future<V2TimValueCallback<V2TimMessage>> sendForwardMessage(
    {required String msgID,
    required String receiver,
    required String groupID,
    MessagePriorityEnum? priority = MessagePriorityEnum.V2TIM_PRIORITY_NORMAL,
    bool onlineUserOnly = false,
    bool isExcludedFromUnreadCount = false,
    OfflinePushInfo? offlinePushInfo,
    String? webMessageInstance}) async {
  return await ImFlutterPlatform.instance.sendForwardMessage(
      msgID: msgID,
      receiver: receiver,
      groupID: groupID,
      priority: priority!.index,
      onlineUserOnly: onlineUserOnly,
      isExcludedFromUnreadCount: isExcludedFromUnreadCount,
      offlinePushInfo: offlinePushInfo?.toJson(),
      webMessageInstance: webMessageInstance);
}