Aarav Sen Aarav Sen - 1 year ago 251
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 Source
     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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download