1

Sorry to ask this here but couldnt find any information related to this online. In native java I have used intent to select com.whatsapp.w4b and com.whatsapp.

I cant figure out how to do it with dart. So far I know:

String androidUrl = 'https://wa.me/$recipientMobile/?text=${Uri.parse(message)}';
String iosUrl = 'https://api.whatsapp.com/send?phone=$recipientMobile=${Uri.parse(message)}';

if (Platform.isAndroid) {
  await launch(androidUrl);
} else if (Platform.isIOS) {
  if(await canLaunch(iosUrl)){
    await launch(iosUrl);
  } else {
    showToast('Error! Try again.', 'Short');
  }
}

This code works but only launches default WhatsApp. How to launch bussiness / personal whatsapp?

Thanks in advance.

Sebastian
  • 286
  • 2
  • 10

1 Answers1

1

EITHER you'll have to ask the users to change the defaults in the link settings of the phone as suggested here.

OR you'll have to share a link that they paste in the browser which will open the app selection section of the phone with both the options, as shown here.

Advait
  • 574
  • 3
  • 12