13

I see there are many threads on

How to send whatsApp message without opening WhatsApp?

All the answers lead to either of these two options:

  1. Open whatsApp -> select contact. Message set in intent would be sent to that contact.
  2. Open whatsApp with specific contact -> paste manually the message set in intent and hit send.

So, there is no option provided by WhatsApp to directly send a message to contact completely in background.

If this is so, then how GoogleNow is able get hold of this unavailable service of whatsApp?

If it is a new service opened up in google or whatsApp, can I get pointers so I could use this in my app?

TryinHard
  • 4,078
  • 3
  • 28
  • 54
naamadheya
  • 1,902
  • 5
  • 21
  • 28
  • Are you talking about the new Direct Share feature that was introduced in Android M? – Eduard B. Aug 26 '15 at 05:20
  • Right. This is the one I was looking for. Is this in Lolipop? – naamadheya Sep 07 '15 at 15:43
  • No. As I said above, it's a new feature only in Android Marshmallow. – Eduard B. Sep 07 '15 at 16:02
  • Ok, But then it iterates back to my question. How "Google Now" is able to send message to WhatsApp contact in Lolipop? – naamadheya Sep 08 '15 at 06:47
  • Hmm, I think that in fact you are looking for this: https://developer.android.com/training/wearables/apps/voice.html#SystemProvided – Eduard B. Sep 15 '15 at 22:47
  • well, I would not need the voice actions as myApp needs to send messagesg (ex: whatsApp message) in background. What happens after the voice action is read is what I am looking for. How that voice message is sent to another app? – naamadheya Sep 21 '15 at 05:11
  • 1
    @Edy : I donot want to use GoogleNow in my app. I want to create the Intent like Google Now does to send WhatsApp message without opening WhatsApp. – naamadheya Nov 09 '15 at 12:22
  • hi @naamadheya do you found any working solution how google now sends msg directly to whatapp without user interaction on send button – Raj Jun 20 '19 at 17:56
  • @Raj No and I believe it is done at OS level exposed APIs. Not exposed to other applications. Probably not exposed to avoid spams. – naamadheya Aug 09 '19 at 15:23

1 Answers1

3

WhatsApp doesn't have any information about it, and doesn't have any API.

Refer to these discussions:

WhatsApp's philosophy is to push storage down to devices, rather than doing central server based message storage. This means the API needs to live on the device as well.

Because "WhatsApp does not want to inundate users with messages they don't want to see", per Brian Acton in the latest F8 conference. While that may be sad for developers, I think it's a good decision. WhatsApp's appeal is private, human, group conversations. It does that extremely well and for more than a billion people. Disturbing that would be risky.

Several companies around the world could benefit on developing customer service apps through WhatsApp.

And in the official page of WhatsApp there's only these information about integration (which is actually an Android System function).

I think what GoogleNow really does is handle the events of the system, Google has Android so there is no problem for them to know all the events and actions that can be integrated into the system when having an app installed.

So, is not possible for us (unfortunately) do that yet. We'll have to wait to WhatsApp to elaborate some API.

Brandon Zamudio
  • 2,853
  • 4
  • 18
  • 34
  • 1
    I would think that, there is some access WhatsApp is providing to Android to achieve this or else would it not be accessing an App without its consent? – naamadheya Apr 25 '17 at 16:43
  • Mmm not exactly without consent, we can see that WhatsApp is integrated to the Contacts App of Android, so we can send a message to these specific contact from the default Contacts App. To do that you can refer this: http://stackoverflow.com/questions/4479352/integrate-my-app-with-contact – Brandon Zamudio Apr 25 '17 at 17:14
  • It's not what you have explained. Whatsapp might have used google assistant's api to integrate itself to google assistant. – Dushyant Suthar Oct 12 '19 at 12:56