addOrRemoveLabels method

Future addOrRemoveLabels({
  1. required List<String> labelIds,
  2. required List<String> chatIds,
})

Add labels to specific chats

Implementation

Future addOrRemoveLabels({
  required List<String> labelIds,
  required List<String> chatIds,
}) async {
  final parsedChatIds = jsonEncode(chatIds.map(parsePhone).toList());
  return await wpClient.evaluateJs(
    '''window.WPP.labels.addOrRemoveLabels(${jsonEncode(labelIds)}, $parsedChatIds);''',
    methodName: "addOrRemoveLabels",
  );
}