Page 1 of 1

Telegram/Whatsapp message

Posted: 23 Oct 2016 17:27
by akapelis
Hi friends, I would like to create a flow that automatically sends a message to my wife when I get to work.
Is there a way to send a precompiled message via telegram or whatsapp?
Maybe with the "StartActivity" action, but i can't figured out...
Thank you very much.

Re: Telegram/Whatsapp message

Posted: 25 Oct 2016 13:37
by Martin
Hi,

To my knowledge there's no way to directly send a Whatsapp message without user interaction.
You could use action Start Activity with example Compose Mail to see if Whatsapp can handle the intent. You will likely have to select the recipient in Whatsapp and press the send button manually. You could try to automate the manual actions with action Control UI.

Regards,
Martin

Re: Telegram/Whatsapp message

Posted: 26 Oct 2016 21:50
by akapelis
Martin wrote:Hi,

To my knowledge there's no way to directly send a Whatsapp message without user interaction.
You could use action Start Activity with example Compose Mail to see if Whatsapp can handle the intent. You will likely have to select the recipient in Whatsapp and press the send button manually. You could try to automate the manual actions with action Control UI.

Regards,
Martin
Thank you Martin, I will try...
I really love this app :P

Re: Telegram/Whatsapp message

Posted: 14 Mar 2017 06:13
by pmgnt
This does the trick!
Requieres rooted device and sqlite3 installed.


Script:
receiver_id = "xxxxxxxx@s.whatsapp.net"
msg = "Hello.."


Root command:
sqlite3 /data/data/com.whatsapp/databases/msgstore.db "INSERT INTO messages (key_remote_jid, key_from_me, key_id,status, needs_push, data, timestamp, media_url, media_mime_type, media_wa_type, media_size, media_name, latitude, longitude, thumb_image, remote_resource, received_timestamp, send_timestamp, receipt_server_timestamp, receipt_device_timestamp, raw_data, media_hash, recipient_count, media_duration, origin) VALUES ('{receiver_id}',1,'{getDate()/1000-1}',0,0,'{msg}',{getDate()},'','','0 ',0,'',0.0,0.0,' ','',{getDate()},-1,-1,-1,0,'',0,0,0); update chat_list set message_table_id = (select max(messages._id) from messages) where chat_list.key_remote_jid = '{receiver_id}' ; "


Root command:
am force-stop com.whatsapp



Now reopen Whatsapp and message will be sent..

best regards.

Re: Telegram/Whatsapp message

Posted: 06 May 2017 13:13
by akapelis
pmgnt wrote:This does the trick!
Requieres rooted device and sqlite3 installed.


Script:
receiver_id = "xxxxxxxx@s.whatsapp.net"
msg = "Hello.."


Root command:
sqlite3 /data/data/com.whatsapp/databases/msgstore.db "INSERT INTO messages (key_remote_jid, key_from_me, key_id,status, needs_push, data, timestamp, media_url, media_mime_type, media_wa_type, media_size, media_name, latitude, longitude, thumb_image, remote_resource, received_timestamp, send_timestamp, receipt_server_timestamp, receipt_device_timestamp, raw_data, media_hash, recipient_count, media_duration, origin) VALUES ('{receiver_id}',1,'{getDate()/1000-1}',0,0,'{msg}',{getDate()},'','','0 ',0,'',0.0,0.0,' ','',{getDate()},-1,-1,-1,0,'',0,0,0); update chat_list set message_table_id = (select max(messages._id) from messages) where chat_list.key_remote_jid = '{receiver_id}' ; "


Root command:
am force-stop com.whatsapp



Now reopen Whatsapp and message will be sent..

best regards.
Thank you very much, but my device isn't rooted.