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.
Telegram/Whatsapp message
Moderator: Martin
Re: Telegram/Whatsapp message
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
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
Thank you Martin, I will try...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
I really love this app

Re: Telegram/Whatsapp message
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.
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
Thank you very much, but my device isn't rooted.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.