Telegram/Whatsapp message

Post your questions and help other users.

Moderator: Martin

Post Reply
akapelis
Posts: 41
Joined: 13 Jul 2016 20:51

Telegram/Whatsapp message

Post by akapelis » 23 Oct 2016 17:27

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.

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Telegram/Whatsapp message

Post by Martin » 25 Oct 2016 13:37

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

akapelis
Posts: 41
Joined: 13 Jul 2016 20:51

Re: Telegram/Whatsapp message

Post by akapelis » 26 Oct 2016 21:50

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

pmgnt
Posts: 26
Joined: 15 Jul 2016 00:34

Re: Telegram/Whatsapp message

Post by pmgnt » 14 Mar 2017 06:13

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.

akapelis
Posts: 41
Joined: 13 Jul 2016 20:51

Re: Telegram/Whatsapp message

Post by akapelis » 06 May 2017 13:13

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.

Post Reply