Intent sending handlers are a feature that allows the server to send Android intents to other apps in response to certain HTTP requests. This option is for advanced users. It enables, among other things, running scripts in popular Android automation apps such as Tasker, Automate, Macrodroid, and similar.
Intent sending handlers are enabled by checking the corresponding checkbox in the Handlers section of the app settings. When you enable it, an additional configuration screen opens where you define how HTTP requests are mapped to intents.
On the configuration screen you can set:
For each handler you can configure:
/intent and the path is /open, then the handler will be triggered by requests to /intent/open.You can check the Android Intent documentation for more information about the options.
Let's say you want to trigger a specific macros in Macrodroid when a user visits /intent/macrodroid. You can configure the handler as follows:
/intent/macrodroidBroadcastYou also need to create a macro in Macrodroid. Under "Triggers" add a new trigger and search for "intent" word so you can find "Intent Received" trigger. Input the action name you configured in the handler (e.g. "run_my_macro") and save the trigger. Under "Actions" select an action you whould like from the Macrodroid's action list and save the macro. Now, when a user visits /intent/macrodroid, the Macrodroid app will be launched in background and the "run_my_macro" macro will be executed.
Note that Macrodroid has a built-in "HTTP Server Request" trigger so if all you need is to trigger a macro when a user visits a specific URL, you can use the built-in Macrodroid's functionality.
You can also add extra data to the intent. This is useful if you want to pass data to the target app. For example, if you want to pass a specific value to the Macrodroid app, you can add it to the extra data. The extra data is a list of key-value pairs.
There are possibility to predefine extra data by providing exact key and value as well as to provide a placeholder for the value (in a form of :param_name) that will be replaced with the actual value from get request parameters (e.g. /intent/macrodroid?param1=value1¶m2=value2).
Ordered broadcasts can return a result to the sender. This is useful if you want to get a response from the target app. Unfortunately, most known automation programs cannot return the result of Ordered Broadcasts, but if you want to implement this in your own application, remember that SHTTPS will interpret the result returned as the "data" of the Ordered Broadcast as the body of the HTTP response, the broadcast result code as the HTTP response code, and extra data from the broadcast result as HTTP response headers.