shareToWhatsApp4Biz method

Future<String?> shareToWhatsApp4Biz({
  1. String msg = '',
  2. String? imagePath = '',
})

share to WhatsApp4Biz imagePath is local image For ios If include image then text params will be ingored as there is no current way in IOS share both at the same.

Implementation

Future<String?> shareToWhatsApp4Biz({String msg = '', String? imagePath = ''}) async {
  final Map<String, dynamic> arguments = <String, dynamic>{};

  arguments.putIfAbsent('msg', () => msg);
  arguments.putIfAbsent('url', () => imagePath);
  String? result;
  try {
    result = await _channel.invokeMethod<String>(_methodWhatsAppBusiness, arguments);
  } catch (e) {
    return 'false';
  }

  return result;
}