Page 1 of 1

idea:send whatsapp copy of sms or sms copy of whatsapp?

Posted: 22 Jan 2018 13:45
by Friend1
Hi all (especially Desmanto, Martin),


İt's possible to send copy of sms with whatsapp on sms send action performed or send copy of whatsapp message copy (can be group) by whatsapp message send intent? Can follow me simple example of flow? Thank you very much.

Re: idea:send whatsapp copy of sms or sms copy of whatsapp?

Posted: 22 Jan 2018 16:11
by Desmanto
Uh... I don't quite get what you mean? Did you mean Send SMS using automagic to person A and at the same time, send the same message thru Whatsapp to person A too?
Or do you mean to auto forward message from whatsapp to sms or vice versa?

For whatsapp group sent, you can use whatsapp API. But I tried and I don't know the group ID. I still use Control UI if it is group chat.
The usage of API has been posted in other thread.

For auto forward, I have ever discuss with other in our own local forum (in Indonesian). i don't know if google translate can help to translate our non-formal language in the forum :D
https://www.kaskus.co.id/post/5a33f9c46 ... 89388b4568
https://www.kaskus.co.id/post/5a43311a1 ... ea4d8b4568
It works both way, by parsing the data from the notification.

Re: idea:send whatsapp copy of sms or sms copy of whatsapp?

Posted: 23 Jan 2018 11:02
by Friend1
Hi Desmanto,


Thank you very much for your help. Here is my working flow: download/file.php?id=1208

If possible i need to send sms to whatsapp group too. But i can't find group ID to do this.

Re: idea:send whatsapp copy of sms or sms copy of whatsapp?

Posted: 24 Jan 2018 07:07
by Desmanto
For whatsapp group send, use Share to Contact instead. Use Control UI to set the group name and tap it, send.

Action Start Activity
Action : android.intent.action.SEND
Data MIME Type : text/plain
Package Name : com.whatsapp
Class Name : com.whatsapp.ContactPicker
Extras : putString("android.intent.extra.TEXT", "This is test message")

Then the next Control UI, supposed to be the same. You just have to adjust the sleep to suit your phone. And of course change the search text to your group chat name.

Code: Select all

sleep(100);
clickById("com.whatsapp:id/menuitem_search");
sleep(100);
setText2ById("com.whatsapp:id/search_src_text", "Name of the chat group");
sleep(200);
clickById("com.whatsapp:id/contactpicker_row_name");
sleep(100);
clickById("com.whatsapp:id/send");
sleep(500);
clickById("com.whatsapp:id/send");
If you want to try the script, make sure you comment out the last line of clickById(), the Control UI will then stop until the last step before pressing the send button.

Re: idea:send whatsapp copy of sms or sms copy of whatsapp?

Posted: 26 Jan 2018 08:54
by Friend1
Hi Desmanto,

Thank you very much for your suggesions.

Re: idea:send whatsapp copy of sms or sms copy of whatsapp?

Posted: 08 Oct 2018 20:10
by emaeee
Friend1 wrote:Hi Desmanto,


Thank you very much for your help. Here is my working flow: download/file.php?id=1208

If possible i need to send sms to whatsapp group too. But i can't find group ID to do this.

Thanks guys for the flow you provided, it was very useful for my needs. To summary the whole thing:

The Start Activity action works fine with this parameters:
<intentAction>android.intent.action.VIEW</intentAction>
<categoryListEnabled>false</categoryListEnabled>
<categoryList>android.intent.category.DEFAULT</categoryList>
<dataEnabled>true</dataEnabled>
<data>https://api.whatsapp.com/send?phone={ph ... ssage_text}</data>
<dataTypeEnabled>false</dataTypeEnabled>
<dataType>text/plain</dataType>
<explicitComponent>true</explicitComponent>
<packageName>com.whatsapp</packageName>
<className>com.whatsapp.TextAndDirectChatDeepLink</className>
<flagList>FLAG_ACTIVITY_NEW_TASK</flagList>
<extras></extras>
<waitForResult>false</waitForResult>
<accessResultExtras></accessResultExtras>

The result is the opening of com.whatsapp.Conversations activity, on the specific contact with the "phone_number", with the message "message_text" in the input space. The only thing that remains is clicking the send button using Control UI: clickById("com.whatsapp:id/send");
As far as i understood from the forums, the effective sending of the message cannot be achieved by any intent, you always have to click the send button manually or with the Contol UI action.