sketchub icon

Whatsapp API to send messages

CoCoCo_CoCoCo
8 Likes
6 Comments
78 Downloads

Screenshots

About

  • How to use the Whatsapp API to send messages with Sketchware:
  1. Open a chat

  2. Open a chat with a predefined message.

Please note that the decision to send the message lies ultimately with the user.

The logic is placed onButtonClick... so I can send a message when a the button is clicked.

In the first example we use an intent and then we setdata to the contents of edittext1. Just in case the image isn't clear enough, the text is:

whatsapp://send?text=

WhatsApp.setAction(Intent.ACTION_VIEW);
WhatsApp.setData(Uri.parse("whatsapp://send?text=".concat(edittext2.getText().toString())));
startActivity(WhatsApp);

©2024 Sketchub | User Policy