sendCatalogMessage method
Sends the WhatsApp Business catalog of catalogOwner (usually this
account's own number) to phone -- a contact, a group id or a channel id.
jpegThumbnail is a data:image/jpeg;base64,... preview.
Implementation
Future<Message?> sendCatalogMessage({
required String phone,
required String catalogOwner,
String? title,
String? description,
String? textMessage,
String? jpegThumbnail,
}) async {
var result = await wpClient.evaluateJs(
'''window.WPP.chat.sendCatalogMessage(${phone.sendTargetParse}, ${catalogOwner.phoneParse}, {
title: ${title.jsParse} || undefined,
description: ${description.jsParse} || undefined,
textMessage: ${textMessage.jsParse} || undefined,
jpegThumbnail: ${jpegThumbnail.jsParse} || undefined
});''',
methodName: "sendCatalogMessage",
);
return Message.parse(result).firstOrNull;
}