Jayashri
Jayashri

Reputation: 21

how to send whatsapp message to Paticular Contact without Click on send button

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

Answers (1)

Rahul Sharma
Rahul Sharma

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

Related Questions