Not a member? Register | Lost your password?
Close Panel

Questions

WhatsApp Message

0

The following code is used by Google Now App and will NOT work for any other application.



I'm writing this post because it makes me angry, that WhatsApp does not allow any other developers to send messages directly except for Google.



And I want other freelance-developers to know, that this kind of cooperation is going on, while Google keeps talking about "open for anybody" and WhatsApp says they don't want to provide any access to developers.



Recently WhatsApp has added an Intent specially for Google Now, which should look like following:



Intent intent = new Intent("com.google.android.voicesearch.SEND_MESSAGE_TO_CONTACTS");
intent.setPackage("com.whatsapp");
intent.setComponent(new ComponentName("com.whatsapp", "com.whatsapp.VoiceMessagingActivity"));

intent.putExtra("com.google.android.voicesearch.extra.RECIPIENT_CONTACT_CHAT_ID", number);
intent.putExtra("android.intent.extra.TEXT", text);
intent.putExtra("search_action_token", ?????);


I could also find out that "searchactiontoken" is a PendingIntent
that contains an IBinder-Object, which is sent back to Google App and checked, if it was created by Google Now.



Otherwise WhatsApp will not accept the message.


03/10/2016 03:55 AM

Reply 0