1

I have read some articles and according to them, WhatsApp has no API for developers for sending personal messages. Though when I type send a WhatsApp message in Google Assistant(Android mobile device) it shows a simple UI to choose a contact and type a message and a send button to send it directly from the assistant.

enter image description here

I also want to do this kinda thing with my messaging app.

My questions are

  1. How to achieve this?

  2. Has WhatsApp done this thing from their side to do this or Google Assistant did this?

Note: Not only WhatsApp I have noticed the same thing for the preloaded SMS messaging app in android devices.

Edit: The possible duplicate found has nothing to do with my question because it doesn't relate google assistant functionality.

Eco4ndly
  • 515
  • 1
  • 5
  • 22
  • Possible duplicate of [Android: How to send message programmatically by using WhatsApp, WeChat?](https://stackoverflow.com/questions/24774595/android-how-to-send-message-programmatically-by-using-whatsapp-wechat) – Yanick Salzmann Apr 03 '19 at 07:16
  • @YanickSalzmann this does not work. So according to you its Google Assistant who is responsible for showing the UI not WhatsApp? – Eco4ndly Apr 03 '19 at 07:20
  • This is exactly what is done, whatsapp registers an App Action, which pretty much just exposes the intent that is shown in the duplicate question and the google assistant is then executing said intent. – Yanick Salzmann Apr 03 '19 at 12:58
  • But according to this link [App Actions] (https://developer.android.com/guide/actions) App Actions are still not available for end users. – Eco4ndly Apr 04 '19 at 06:02
  • Whatsapp is probably not the average end user – Yanick Salzmann Apr 04 '19 at 10:17

3 Answers3

0

Have you come across this answer?
https://stackoverflow.com/a/46683818/3138726

This would require user consent though. It will open up the screen with prefill text for that contact.

Tanay
  • 33
  • 6
  • The intent of this code is to open WhatsApp application with some loaded value. Though the code didn't work for me. But if you look closely the google assistant, it doesn't open the WhatsApp application still it is able to send the message to the selected contact. – Eco4ndly Apr 03 '19 at 08:06
0

actually google got a permmesion from whatsapp company to do this, that is not possible to send messages from your own application

-1

i think Google assistance use whatsapp cloud api for sending messages like calling an api with request parameter if doesn't please drop down edits or any other idea

  • 1
    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jun 18 '23 at 15:36