unpinMessage method

Future<void> unpinMessage(
  1. int messageId
)

Unpin Message

Implementation

Future<void> unpinMessage(int messageId) async {
  final sdk = SendbirdSdk().getInternal();
  if (messageId < 0) {
    throw SBError(
      message: "messageId has to be greater than 0",
      code: ErrorCode.notSupportedError,
    );
  }

  try {
    await sdk.api.send(
      PinDeleteRequest(
        channelType: ChannelType.group,
        channelUrl: super.channelUrl,
        messageId: messageId,
      ),
    );
  } catch (exception) {
    logger.e(StackTrace.current, exception);
    throw (SBError(message: "Pin Delete Request Failed.."));
  }
}