> For the complete documentation index, see [llms.txt](https://docs.digitalturbine.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.digitalturbine.com/dt-ignite/use-cases/automatically-updating-the-host-app.md).

# Automatically Updating the Host App

Use the DTIS SDK to automatically update your Host App on a device. Device users must opt in for Auto Updates, and the Host App must capture and send the user's Auto Update preference to DT. Auto Updates of the Host App through DT Ignite Services requires the following device conditions:

* Device is connected to an unmetered connection (`NETWORK_TYPE_UNMETERED`).
* Device is charging.

When testing your Auto Update implementation, ensure that the test device meets these conditions.

The following diagram shows the general flow for implementing automatic updates of the Host App through the DTIS SDK:

```mermaid
sequenceDiagram
    participant Host as Host App
    participant SDK as Ignite
    autonumber

    Host ->> SDK: Initialize and Connect
    Host ->> SDK: getIsAutoUpdateEnabled()
    
    alt IsAutoUpdateEnabled=null
        Host ->> Host:  Capture user opt-in for Auto Updates
        Host ->> SDK: setIsAutoUpdateEnabled()
    else IsAutoUpdateEnabled=true
        SDK -->> Host: App Update Broadcasts
    end
    
    Host ->> SDK: Disconnect
```

| SEQUENCE ITEM | DESCRIPTION                                                                                                                                                                                                                                                                                                                                                                                                   |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 1             | <p><strong>Initialization and Connection</strong><br>The Host App initializes the DTIS SDK and connects to Ignite. This action establishes a secure connection between the two components and authenticates the Host App with Ignite. For more information, see <a href="https://docs.digitalturbine.com/dt-ignite/sdk-reference/connect-to-ignite.md">Connect to Ignite</a>.</p>                             |
| 2             | <p><strong>Check for Auto Update Enabled</strong><br>The Host App calls the <a href="https://docs.digitalturbine.com/dt-ignite/sdk-reference/check-for-auto-update-preference.md"><code>getIsAutoUpdateEnabled()</code> method</a> to determine whether or not the device user has opted in for automatic updates of the Host App.</p>                                                                        |
| 3             | <p><strong>Capture User Preference</strong><br>If the user has not specified their Auto Update preference, the Host App must surface a UI to capture their preference.</p>                                                                                                                                                                                                                                    |
| 4             | <p><strong>Send Auto Update Preference</strong><br>Send the device user's Auto Update preference to DT using the <a href="https://docs.digitalturbine.com/dt-ignite/sdk-reference/send-auto-update-preference.md"><code>setIsAutoUpdateEnabled()</code> method</a>.</p>                                                                                                                                       |
| 5             | <p><strong>Listen for Auto Updates</strong><br>If a user has opted in for Auto Updates, Ignite schedules tasks to update the Host App on devices. Ignite broadcasts notifications when the updates are scheduled and completed. For more information, see <a href="https://docs.digitalturbine.com/dt-ignite/sdk-reference/send-auto-update-preference.md#appupdatebroadcast">Auto Update Broadcasts</a>.</p> |
| 6             | <p><strong>Disconnect from Ignite</strong><br>Disconnect from Ignite Services. For more information, see <a href="https://docs.digitalturbine.com/dt-ignite/sdk-reference/disconnect-from-ignite.md">Disconnect from Ignite</a>.</p>                                                                                                                                                                          |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.digitalturbine.com/dt-ignite/use-cases/automatically-updating-the-host-app.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
