---
# System prepended metadata

title: Mobile User App Updates

---

# Mobile User App Updates

We have logic that controls user updates depending on two values - actual version in application store and minimum required version.

## Terms
In app we are using next variables:
* `curentVersion` - currently installed app version on device.
* `latestStoreVersion` - latest available for download version in application store (AppStore/Google Play).
* `minRequiredVersion` - minimum required version that should be installed on devices for stable work.
* `skippedUpdateVersion` - version that will be ingored for optional updates.

## Flow
Each version check occurs during program startup when we see the Splash screen. We can have next stages of the mobile application version:
* `curentVersion` >= `minRequiredVersion` and `curentVersion` >= `latestStoreVersion`. The app don't need any update.

* `curentVersion` >= `minRequiredVersion` but `curentVersion` < `latestStoreVersion`. The app has an optional update. We'll see orange notification at the top of app on each screen until user press `SKIP`/`UPDATE` button. On `SKIP` the app will store the `latestStoreVersion` into `skippedUpdateVersion` and the orange notification will stop showing for the `latestStoreVersion`. On `UPDATE` it will open application store.
![](https://i.imgur.com/O86INRp.jpg)
* `curentVersion` < `minRequiredVersion` but `minRequiredVersion` > `latestStoreVersion`. The app should be updated but that new critical update still not present in store (due to an incorrect antry in the DB or app update still not reviewed in store). Then we will not show any update information for user.
* `curentVersion` < `minRequiredVersion` and `minRequiredVersion` <= `latestStoreVersion`. The app should be updated but that critical update is present in store. Then user will be navigated to the required update screen with message that user "must update to the newest version of the app". Also on the screen user can see version comparsion and optional note from DB. User cannot navigate to any other part of the app until he will update application or `minRequiredVersion` will be decreesed in DB.
![](https://i.imgur.com/iBMW4Q6.jpg)

## API

The information about `minRequiredVersion` stores in `systemConfigs` collection, in `rakeUserApp.mobileVersion` field and have next structure:
```
{
    // Waitng for Oleh's answer on the structure
}
```

The data can be accessed using next route:
`GET {user-app-url}/rake-user-app-backend/mobile-version`

Response:
```
"data": {
    "mobileApp": {
        "minVersion": "1.14.1",
        "latestStableVersion": "1.14.9",
        "text": "Please, upgrade"
    }
}
```