forwardMessagesToMultipleUsers method

  1. @override
Future<void> forwardMessagesToMultipleUsers(
  1. List<String> messageIds,
  2. List<String> userList,
  3. dynamic callback(
    1. FlyResponse response
    )?
)
override

This method is used to forward the multiple messages.

Implementation

@override
Future<void> forwardMessagesToMultipleUsers(List<String> messageIds,
    List<String> userList, Function(FlyResponse response)? callback) async {
  //forwardMessage
  bool? forwardMessageResponse;
  try {
    forwardMessageResponse = await mirrorFlyMethodChannel.invokeMethod<bool>(
        'forwardMessagesToMultipleUsers',
        {"message_ids": messageIds, "userList": userList});
    LogMessage.d("Forward Msg Response ", " $forwardMessageResponse");
    callback?.call(FlyResponse(true, FlyConstants.empty, FlyConstants.empty));
    // return forwardMessageResponse;
  } on PlatformException catch (e) {
    LogMessage.d("Platform Exception =", " $e");
    callback?.call(FlyResponse(false, FlyConstants.empty, FlyConstants.empty,
        FlyException(e.code, e.message, e.details)));
  } on Exception catch (e) {
    LogMessage.d("Exception ", " $e");
    callback?.call(FlyResponse(false, FlyConstants.empty, FlyConstants.empty,
        FlyException(FlyErrorCode.unHandle, FlyErrorMessage.unHandle, e)));
  }
}