# Technical Guide

## Device Events

The following device states/events are available as triggers in the launcher.json's  [base-level object](/bluefletch-enterprise/product-guides/bluefletch-launcher/technical-guide.md#base) `"intents"`. Multiple intent objects can be listed sequentially in each device event's array.

| Field           | Description                                                                                                                               |
| --------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| preLogin        | **array** A collection of Custom Intents to invoke before the authentication process begins.                                              |
| login           | **array** A collection of Custom Intents to invoke after user logs into the device.                                                       |
| logout          | **array** A collection of Custom Intents to invoke after user logs out of the device, prior to launcher completing full logout.           |
| postLogout      | **array** A collection of Custom Intents to invoke after user logs out of the device. This occurs after all Logout actions are completed. |
| boot            | **array** A collection of Custom Intents to invoke after device boot.                                                                     |
| uncradle        | **array** A collection of Custom Intents to invoke after the device is removed from the cradle.                                           |
| cradle          | **array** A collection of Custom Intents to invoke after the device is placed on the cradle.                                              |
| screenOn        | **array** A collection of Custom Intents to invoke after the screen turns on.                                                             |
| motionLockEnter | **array** A collection of custom intents to invoke when lockInMotion engages on the device.                                               |
| motionLockExit  | **array** A collection of custom intents to invoke when the device exits from lockInMotion state.                                         |
| siteChange      | **array** A collection of custom intents to invoke when a site change is detected.                                                        |

## Key-Value Pairs

The following key-value pairs are used to build each custom intent object:

<table><thead><tr><th>Key</th><th>Value Description</th></tr></thead><tbody><tr><td>package</td><td><strong>string</strong> The package to invoke.</td></tr><tr><td>action</td><td><strong>string</strong> Android action, or special Platform Action.</td></tr><tr><td>category</td><td><strong>string</strong> Android Category.</td></tr><tr><td>class</td><td><strong>string</strong> The Class name within the package.</td></tr><tr><td>flags</td><td><strong>integer</strong> Flags to use during firing the intent. Currently supports the value of 1, which indicates new task.</td></tr><tr><td>typeIntent</td><td><strong>string</strong> The type of intent, values b, i, a, d or p. b = Broadcast (default), i = implicit intent, a = start Activity, d = delay, p = platform.</td></tr><tr><td>extras</td><td><p><strong>Hash Map</strong> Key/value pairs of additional data to send.<br>Example:</p><pre class="language-json"><code class="lang-json">"extras": {
   "market": "retail", 
   "region": "northeast"
}
</code></pre></td></tr><tr><td>data</td><td><strong>string</strong> Data to send with the intent.</td></tr><tr><td>filter</td><td><p><strong>object</strong> Object for defining which key-value pair of the session object will trigger the intent.<br>Example:</p><pre class="language-json"><code class="lang-json">"filter": { 
   "session.groups": "Associates"
}
</code></pre></td></tr></tbody></table>

## Examples

### All Device Event Arrays

Below is an example where each device event array is present. The following example performs the following:

1. After login, the Launcher home screen will rotate to Landscape orientation
2. During logout:
   1. Launcher clears the cache of Android Chrome
   2. The Launcher home screen will rotate back to Portrait orientation
3. In addition, whenever the device is removed from the cradle:
   1. The device volume will be adjusted to 100%

```json
"intents": {
    "preLogin": [],
    "login": [
        {
            "action": "com.bluefletch.launcher.ACTION_ROTATE_LANDSCAPE",
            "typeIntent": "p"
        }
    ],
    "logout":[
        {
            "action": "CLEARCACHE",
            "package": "com.android.chrome",
            "typeIntent": "p"
        },
        {
            "action": "com.bluefletch.launcher.ACTION_ROTATE_PORTRAIT",
            "typeIntent": "p"
        }
    ],
    "postLogout": [],
    "boot": [],
    "uncradle": [
        {
            "action": "ADJUST_AUDIO",
            "typeIntent": "p",
            "extras": {
                "others": 100
            }
        }
    ],
    "cradle": [],
    "screenOn": [],
    "motionLockEnter": [],
    "motionLockExit": [],
    "siteChange": [
        {
            "action": "SET_LANGUAGE",
            "typeIntent": "p",
            "extras": {
              "lang": "${config.ex.lang}"
            }
        },
        {
            "action": "SET_TIMEZONE",
            "typeIntent": "p",
            "extras": {
              "timezone": "${config.ex.timezone}",
              "ntpServer": "north-america.pool.ntp.org"
            }
         }
    ]
  }
```

{% hint style="info" %}
Unused arrays may or may not be included in the "intents" object for the existing intents to work; empty arrays do not cause issues but they are also not required to be included.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.bluefletch.com/bluefletch-enterprise/product-guides/bluefletch-launcher/custom-intents/technical-guide.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
