Aarav Sen Aarav Sen - 7 months ago 141
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.

     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