Hi guys,
I recently started using Signal for communicating with some guys and needed a way to be able to send messages from Tasker without requiring any interaction. What I came up with is a way that should actually work for any SMS app that's out there!
There's a service intent "android.intent.action.RESPOND_VIA_MESSAGE" that's normally used when you decline a call and chose to send a message to the caller - and unlike all the other intents it doesn't require any user input! However being a service intent it's not possible to call it using Taskers "Send Intent" action but instead one has to use "Run shell" as root.
Task setup:
- Variables -> Variable set: Name: %smsto, To: Receipients number
- Variables -> Variable set: Name: %smstext, To: SMS text
- Add action "Run shell": Use root: Yes, Command:
To make sure the event is handled by Signal I send the message directly to Signals service handling these events (org.thoughtcrime.securesms/.service.QuickResponseService) - this can be found by examining Signals AndroidManifest.xml.
If you want to use some other app for sending the message replace "org.thoughtcrime.securesms/.service.QuickResponseService" with your apps service for receiving these intents, just have a look at the apps AndroidManifest.xml and search for the service handling the RESPOND_VIA_MESSAGE action.
Have fun!
I recently started using Signal for communicating with some guys and needed a way to be able to send messages from Tasker without requiring any interaction. What I came up with is a way that should actually work for any SMS app that's out there!
There's a service intent "android.intent.action.RESPOND_VIA_MESSAGE" that's normally used when you decline a call and chose to send a message to the caller - and unlike all the other intents it doesn't require any user input! However being a service intent it's not possible to call it using Taskers "Send Intent" action but instead one has to use "Run shell" as root.
Task setup:
- Variables -> Variable set: Name: %smsto, To: Receipients number
- Variables -> Variable set: Name: %smstext, To: SMS text
- Add action "Run shell": Use root: Yes, Command:
Code:
am startservice -a android.intent.action.RESPOND_VIA_MESSAGE -c android.intent.category.DEFAULT -d smsto:%smsto -e android.intent.extra.TEXT "%smstext" org.thoughtcrime.securesms/.service.QuickResponseService
To make sure the event is handled by Signal I send the message directly to Signals service handling these events (org.thoughtcrime.securesms/.service.QuickResponseService) - this can be found by examining Signals AndroidManifest.xml.
If you want to use some other app for sending the message replace "org.thoughtcrime.securesms/.service.QuickResponseService" with your apps service for receiving these intents, just have a look at the apps AndroidManifest.xml and search for the service handling the RESPOND_VIA_MESSAGE action.
Have fun!