cancelScheduledMessage method

Future<void> cancelScheduledMessage(
  1. int scheduledMessageId, {
  2. OnScheduledMessageCancelCallback? callback,
})

Cancels scheduled message

Implementation

Future<void> cancelScheduledMessage(
  int scheduledMessageId, {
  OnScheduledMessageCancelCallback? callback,
}) async {
  try {
    return _sdk.api.send(
      GroupChannelScheduledMessageCancelRequest(
        channelUrl: channelUrl,
        scheduledMessageId: scheduledMessageId,
      ),
    );
  } catch (e) {
    if (callback != null) {
      final error = SBError(message: 'Failed Sending Request');
      callback(error);
    }
  }
}