Aarav Sen Aarav Sen - 13 days ago 15
Android Question

How to send message to particular whatsapp contact programmatically using intent?

I searched various answers but they are outdated.
Whenever I tried using sendTo it only opens contact chooser.

Answer
     Intent sendIntent = new Intent("android.intent.action.MAIN");
     sendIntent.setComponent(new  ComponentName("com.whatsapp","com.whatsapp.Conversation"));
 sendIntent.putExtra("jid",     PhoneNumberUtils.stripSeparators("YOUR_PHONE_NUMBER")+"@s.whatsapp.net");//phone number without "+" prefix

 startActivity(sendIntent);