pinMessage method
Pin Message
Implementation
Future<void> pinMessage(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(
PinCreateRequest(
channelType: ChannelType.group,
channelUrl: super.channelUrl,
messageId: messageId,
),
);
} catch (exception) {
logger.e(StackTrace.current, exception);
throw (SBError(message: "Pin Create Request Failed."));
}
}