user3698799
user3698799

Reputation: 81

Check if message was succesfully sent via whatsapp

Good Day,

Im building an android app with a function of sharing a text message through whatsapp. Here is my code:

Intent intent = new Intent();
            intent.setAction(Intent.ACTION_SEND);
            intent.putExtra(Intent.EXTRA_TEXT, message.toString());
            intent.setType("text/plain");
            intent.setPackage("com.whatsapp");
            startActivity(Intent.createChooser(intent,""));

The code is working and I can share the message by choosing a contact and pressing send button in whatsapp.

My only problem is I need to go back from my activity and must know whether the message was successfully sent or not.

Any idea?

Thanks in advance.

Upvotes: 1

Views: 746

Answers (1)

N J
N J

Reputation: 27535

whether the message was successfully sent or not.

Answer is No because WhatsApp does not have any api.

Upvotes: 1

Related Questions