---
description: Functions to control the in app update options in the app.
---

# In App Update - Android

{% hint style="info" %}
You'll need to import the javascript file in your website before starting from this [link](https://docs.webtonative.com/javascript-apis/getting-started).
{% endhint %}

{% tabs %}
{% tab title="Plain Javascript" %}
```
const { InAppUpdate } = window.WTN;

InAppUpdate.checkIfAppUpdateAvailable({
    callback: function(data) {
        //your logic
    }
});

InAppUpdate.updateApplication({
    updateType: "immediate", //immediate or flexible
    callback: function(data) {
        
    }
});
```
{% endtab %}

{% tab title="ES5+" %}
```
import { InAppUpdate } from "webtonative";

InAppUpdate.checkIfAppUpdateAvailable({
    callback: function(data) {
        //your logic
    }
});

InAppUpdate.updateApplication({
    updateType: "immediate", //immediate or flexible
    callback: function(data) {
        
    }
});
```
{% endtab %}
{% endtabs %}

In `checkIfAppUpdateAvailable` it will return two keys isUpdateAvailable (boolean) and latestVersion (string)

For Example:- `{ "isUpdateAvailable": true, "latestVersion": "2.0.1" }`&#x20;

In `updateApplication`  it will return a key updateStatus (string)\
Values:- UPDATE\_CANCELLED or UPDATE\_STARTED

For Example:- `{"updateStatus":"UPDATE_CANCELLED"}`&#x20;



\*Feature added in Android on 02/07/25
