Reputation: 21
Here is my code ..
String toNumber = "+91 86092 47049";
toNumber = toNumber.replace("+", "").replace(" ", "");
Intent sendIntent = new Intent("android.intent.action.MAIN");
sendIntent.putExtra("jid", toNumber + "@s.whatsapp.net");
sendIntent.putExtra(Intent.EXTRA_TEXT, "Hello ..");
sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.setPackage("com.whatsapp");
sendIntent.setType("text/plain");
startActivity(sendIntent);
It works but it's not exactly 'sending' it.It entered the text and now the user need to press 'send' button manually. Is it possible to send it without click on 'send' button?
Upvotes: 0
Views: 2400
Reputation: 2893
As per the WhatsApp FAQ there are only two ways to send text
Using Url
Using Intent
In both cases users have to click send button explicitly to send the message.
So as of now it is not possible to send message directly without clicking send button.
Upvotes: 3