getMessage static method

Future<BaseMessage> getMessage(
  1. MessageRetrievalParams params
)

Retrieves a BaseMessage with given MessageRetrievalParams.

Implementation

static Future<BaseMessage> getMessage(MessageRetrievalParams params) async {
  if (params.messageId < 0) {
    throw InvalidParameterError();
  }

  final sdk = SendbirdSdk().getInternal();

  return sdk.api.send<BaseMessage>(
    ChannelMessageGetRequest(
      channelType: params.channelType,
      channelUrl: params.channelUrl,
      messageId: params.messageId,
      params: params,
    ),
  );
}