So one thing to keep in mind is that every intent action will have a different set of requirements which can vary from app to app. So while the SENDTO action does not need address as an extra, when using with the VIEW action the app may need to read it.
So using the direct example from @Hellis81 several posts above its working.
I use the “command_activity” intent to make notifications, set my alarm clock, and set the ringer mode on the phone all the time. So I doubt it’s a permissions problem.
Unless I need to give it a permission for every different “command_activity” intent I use? But I don’t remember needing to do that after the very first time I used that intent.
nothing is popping up prompting me for permissions tho.
I would be surprised if there is not a different permission for writing sms.
The popup when you install apps list sms as one specific permission so that seems to suggest it’s a different permission
the only permission for command_activity is draw over other apps and if needed phone call permissions. The app will look for these things when attempting to send any command so we will prompt the user in this case. For SMS there is no special permission, and the app does not qualify to be a default SMS, given that it works for others the issue is probably something else.
@finity just for sanity sake do you indeed have the Google Messages app installed on the device? I ask because we are targeting that specific app per the provided package.
When you get the toast notification there is also an error printed in the companion app logs, that may give a clue if the actual package is installed so we can see why its failing.
no the app does not qualify to be a default SMS app, unless you can find an intent like was done for making a phone call its probably not possible. I don’t see it specifically mentioned in the google docs I linked earlier either.
Has anyone managed to get the Intent URI for sending an SMS working for an actionable notification, rather than a command activity? I’ve tried to follow the android guidance for sending an SMS (which covers the same items listed in your example), but I can’t seem to get the format right as is needed for the notification.
unfortunately the solutions in this thread are at the mercy of app updates which can change what intents they accept at any time. I am glad you were able to figure it out, hopefully it helps the next person!
I don’t know if this is the right place for this question but I’ll give it a try.
I have registered the intent “io.homeassistant.companion.android.OPEN_DOOR” in the Home Assistant app via the Last Update Sensor.
If I send message: "command_broadcast_intent" with intent_package_name": "io.homeassistant.companion.android" and "intent_action": "io.homeassistant.companion.android.OPEN_DOOR"
via the notify service, I also receive the corresponding event.
However, I would like to trigger the intent via the clickAction of a notification. For this I have set the following for the clickAction of my notifaction: clickAction: "intent://open_door#Intent;package=io.homeassistant.companion.android;action=OPEN_DOOR;end"
but the event is not triggered when I click on the notification. Can anyone help me and advise me what I’m doing wrong?
I am not the best at building intent links but I can tell you that the action open_door is not in our manifest and will not do anything as a result. This page should guide you through it better.
yea you will not be able to get an event sent back from the click action as it can be external to the app and we will not get notified. For that you need to use actionable notification.