# Play In-App Update

# Play In-App Update

Native API for Play In-App Update.

## Summary

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       ### Enumerations                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       ||
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------|
| [AppUpdateAvailability](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1ga97b9632d08d1200dc97177656c205294)`{` ` `[APP_UPDATE_AVAILABLILITY_UNKNOWN](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1gga97b9632d08d1200dc97177656c205294a4e2107a4b5c1b267ed8930507ed13e62)` = 0,` ` `[APP_UPDATE_NOT_AVAILABLE](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1gga97b9632d08d1200dc97177656c205294adf9eebd8254f79d9bcfedbd0c51c2e51)` = 1,` ` `[APP_UPDATE_AVAILABLE](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1gga97b9632d08d1200dc97177656c205294a10499fbb8a570dd47903d3d0fde54b46)` = 2,` ` `[APP_UPDATE_TRIGGERED_IN_PROGRESS](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1gga97b9632d08d1200dc97177656c205294ad9cc3d685a73e9c90bbe34d0c7a36115)` = 3` `}`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | enum Availability info for an in-app update.                           |
| [AppUpdateErrorCode](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1ga2b25dc1732fe32dba564981106127d14)`{` ` `[APP_UPDATE_NO_ERROR](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1gga2b25dc1732fe32dba564981106127d14aaaa4a8e766d6050f43644118021e4fb0)` = 0,` ` `[APP_UPDATE_UNKNOWN_ERROR](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1gga2b25dc1732fe32dba564981106127d14a9354539ba3519f55605864496a030aa7)` = -2,` ` `[APP_UPDATE_API_NOT_AVAILABLE](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1gga2b25dc1732fe32dba564981106127d14a3217321ee6821945613960c10ac61e60)` = -3,` ` `[APP_UPDATE_INVALID_REQUEST](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1gga2b25dc1732fe32dba564981106127d14ab65937498df667a2bd2c213e87522368)` = -4,` ` `[APP_UPDATE_UNAVAILABLE](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1gga2b25dc1732fe32dba564981106127d14a3ebf0319b1aa5e20da768ae8775c64be)` = -5,` ` `[APP_UPDATE_NOT_ALLOWED](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1gga2b25dc1732fe32dba564981106127d14ac9d75951a63dd689db7948e38644fe63)` = -6,` ` `[APP_UPDATE_DOWNLOAD_NOT_PRESENT](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1gga2b25dc1732fe32dba564981106127d14a5560967c8bfdc751bd5867a8a3435034)` = -7,` ` `[APP_UPDATE_IN_PROGRESS](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1gga2b25dc1732fe32dba564981106127d14a26a6a036584e1b527bc391d6acbc519a)` = -8,` ` `[APP_UPDATE_PLAY_STORE_NOT_FOUND](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1gga2b25dc1732fe32dba564981106127d14a4f8a5ff94d156d165b45493267298c5f)` = -9,` ` `[APP_UPDATE_APP_NOT_OWNED](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1gga2b25dc1732fe32dba564981106127d14ad914ff55059adfd746a0e9e28f7875e4)` = -10,` ` `[APP_UPDATE_INTERNAL_ERROR](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1gga2b25dc1732fe32dba564981106127d14a3d0d2d622b8f3e30a50d8e111a8fd6aa)` = -100,` ` `[APP_UPDATE_INITIALIZATION_NEEDED](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1gga2b25dc1732fe32dba564981106127d14a6d0407b1862909d3fdaf016e07ca73a7)` = -110,` ` `[APP_UPDATE_INITIALIZATION_FAILED](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1gga2b25dc1732fe32dba564981106127d14a7a95946ea55fa157cae7b2c0b1c5d574)` = -111` `}` | enum Errors that can be encountered while using the in-app update API. |
| [AppUpdateStatus](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1ga0fcc535c870b96801418543f13e7c603)`{` ` `[APP_UPDATE_STATUS_UNKNOWN](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1gga0fcc535c870b96801418543f13e7c603a541203e112fd406dd068bfd48f0c89a3)` = 0,` ` `[APP_UPDATE_PENDING](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1gga0fcc535c870b96801418543f13e7c603a9d2a31cf6a2262d6a871bb18cd459e6c)` = 1,` ` `[APP_UPDATE_DOWNLOADING](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1gga0fcc535c870b96801418543f13e7c603a71e02e5d7d578349e1260a80a2e461fb)` = 2,` ` `[APP_UPDATE_INSTALLING](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1gga0fcc535c870b96801418543f13e7c603a0c90edcc138c93b8ebd8cf9a105876e0)` = 3,` ` `[APP_UPDATE_INSTALLED](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1gga0fcc535c870b96801418543f13e7c603a686b0dda00788c07a961537e83529718)` = 4,` ` `[APP_UPDATE_FAILED](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1gga0fcc535c870b96801418543f13e7c603a8e59f3b104f6aa3bdcc2a938d8e0466d)` = 5,` ` `[APP_UPDATE_CANCELED](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1gga0fcc535c870b96801418543f13e7c603a02b68f00e496b4eb8607de503d7154e3)` = 6,` ` `[APP_UPDATE_DOWNLOADED](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1gga0fcc535c870b96801418543f13e7c603ae0f6a20feb3b1e2cfad1e2e313c867fc)` = 11,` ` `[APP_UPDATE_REQUEST_INFO_PENDING](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1gga0fcc535c870b96801418543f13e7c603a94e982867a3cf58bebbc54c80fc38b77)` = 100,` ` `[APP_UPDATE_REQUEST_INFO_FAILED](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1gga0fcc535c870b96801418543f13e7c603a7f687d2d0aa889f4afaad226a5ba0cfc)` = 101,` ` `[APP_UPDATE_REQUEST_INFO_COMPLETED](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1gga0fcc535c870b96801418543f13e7c603a5b8c3d65ab9a925124732a4bfa0b4edb)` = 102,` ` `[APP_UPDATE_REQUEST_START_UPDATE_PENDING](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1gga0fcc535c870b96801418543f13e7c603a16b7545144060f3e119b1d680f254458)` = 110,` ` `[APP_UPDATE_REQUEST_COMPLETE_UPDATE_PENDING](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1gga0fcc535c870b96801418543f13e7c603a5f379d50ff08848e58ef5b0ca9f8cb47)` = 120` `}`            | enum Status returned when requesting an in-app update.                 |
| [AppUpdateType](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1ga7fa33ea73368628dc79cca13b8a38b65)`{` ` `[APP_UPDATE_TYPE_UNKNOWN](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1gga7fa33ea73368628dc79cca13b8a38b65ada5dc29c2b090332048f5bf81d45cfeb)` = -1,` ` `[APP_UPDATE_TYPE_FLEXIBLE](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1gga7fa33ea73368628dc79cca13b8a38b65aaa528eda633f85375ddb457a05bc7534)` = 0,` ` `[APP_UPDATE_TYPE_IMMEDIATE](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1gga7fa33ea73368628dc79cca13b8a38b65a6ce85e9f103d441e9f36c3307816394e)` = 1` `}`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | enum Methods for performing the in-app update flow.                    |

|                                                                                                                  ### Typedefs                                                                                                                   ||
|---------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------|
| [AppUpdateInfo](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1gac1ae6e8c4f93360ecb1a5f5f95da4df3)    | typedef `struct AppUpdateInfo_` An opaque struct used to access information about an update. |
| [AppUpdateOptions](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1ga688e0e8160c3b3213beaf8b01ed2b31a) | typedef `struct AppUpdateOptions_` An opaque struct used to provide options for an update.   |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   ### Functions                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    ||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [AppUpdateInfo_destroy](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1ga3ac84095638d8ed020deb2ebd845952a)`(`[AppUpdateInfo](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1gac1ae6e8c4f93360ecb1a5f5f95da4df3)` *info)`                                                                                                                                                                                                       | `void` Releases the specified AppUpdateInfo and any references it holds.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| [AppUpdateInfo_getAvailability](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1gab3aa398a4bb8fc831ca52340fa5861b4)`(`[AppUpdateInfo](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1gac1ae6e8c4f93360ecb1a5f5f95da4df3)` *info)`                                                                                                                                                                                               | [AppUpdateAvailability](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1ga97b9632d08d1200dc97177656c205294) Returns the update availability for the specified AppUpdateInfo.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| [AppUpdateInfo_getAvailableVersionCode](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1ga97daeb9e7cf1cee3376d6922c20f7900)`(`[AppUpdateInfo](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1gac1ae6e8c4f93360ecb1a5f5f95da4df3)` *info)`                                                                                                                                                                                       | `uint32_t` Returns the latest available version code for the specified AppUpdateInfo.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| [AppUpdateInfo_getBytesDownloaded](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1ga11072361e1fc78a46e348604d90209b1)`(`[AppUpdateInfo](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1gac1ae6e8c4f93360ecb1a5f5f95da4df3)` *info)`                                                                                                                                                                                            | `uint64_t` Returns the total number in bytes already downloaded for the specified AppUpdateInfo.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| [AppUpdateInfo_getClientVersionStalenessDays](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1ga01fbfa23fb9dda931a7d6828dafbf235)`(`[AppUpdateInfo](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1gac1ae6e8c4f93360ecb1a5f5f95da4df3)` *info)`                                                                                                                                                                                 | `int32_t` Returns the number of days that the Google Play Store app on the user's device has known about an available update.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| [AppUpdateInfo_getPriority](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1gadc950a316eac30974acfd4abfb0d8c82)`(`[AppUpdateInfo](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1gac1ae6e8c4f93360ecb1a5f5f95da4df3)` *info)`                                                                                                                                                                                                   | `int32_t` Returns the priority for this update, as defined by the developer in the Google Play Developer API.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| [AppUpdateInfo_getStatus](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1ga26d11290130fc4d7ca7a835d0a038662)`(`[AppUpdateInfo](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1gac1ae6e8c4f93360ecb1a5f5f95da4df3)` *info)`                                                                                                                                                                                                     | [AppUpdateStatus](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1ga0fcc535c870b96801418543f13e7c603) Returns the update status for the specified AppUpdateInfo.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| [AppUpdateInfo_getTotalBytesToDownload](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1ga6c7a5cf54816c67cb1dcb925d2de4a0d)`(`[AppUpdateInfo](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1gac1ae6e8c4f93360ecb1a5f5f95da4df3)` *info)`                                                                                                                                                                                       | `uint64_t` Returns the total bytes to download for the specified AppUpdateInfo.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| [AppUpdateInfo_isUpdateTypeAllowed](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1ga040a4e7a6197d055c2db7b1b467f0b58)`(`[AppUpdateInfo](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1gac1ae6e8c4f93360ecb1a5f5f95da4df3)` *info, `[AppUpdateOptions](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1ga688e0e8160c3b3213beaf8b01ed2b31a)` *options)`                             | `bool` Returns whether an update is allowed for the specified AppUpdateInfo and AppUpdateOptions.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| [AppUpdateManager_destroy](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1ga9886fee9d63e381a1da12a875ca386f6)`()`                                                                                                                                                                                                                                                                                                                                                          | `void` Frees up memory allocated for the in-app update API.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| [AppUpdateManager_getInfo](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1gae82c77a38ed8cb749ff3447cb3267386)`(`[AppUpdateInfo](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1gac1ae6e8c4f93360ecb1a5f5f95da4df3)` **out_info)`                                                                                                                                                                                               | [AppUpdateErrorCode](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1ga2b25dc1732fe32dba564981106127d14) Gets the result of an ongoing or completed call to[AppUpdateManager_requestInfo()](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1ga262398baee56bd6c112057488e4fbb44),[AppUpdateManager_requestStartUpdate()](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1gabff89a1f00a9be306a2e9ec032c44364), or[AppUpdateManager_requestCompleteUpdate()](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1ga197a86eaae34d04a4ed39e8498534fe0). |
| [AppUpdateManager_init](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1gadb03d1a42b4945ebbf5996b1be0bf839)`(JavaVM *jvm, jobject android_context)`                                                                                                                                                                                                                                                                                                                         | [AppUpdateErrorCode](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1ga2b25dc1732fe32dba564981106127d14) Initialize the in-app update API, making the other functions available to call.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| [AppUpdateManager_onPause](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1ga5f637fc6977c7e65020d8e027537822c)`()`                                                                                                                                                                                                                                                                                                                                                          | [AppUpdateErrorCode](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1ga2b25dc1732fe32dba564981106127d14) Deregisters an internal update status listener.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| [AppUpdateManager_onResume](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1ga97ade290428d030c830d2bc570cc252f)`()`                                                                                                                                                                                                                                                                                                                                                         | [AppUpdateErrorCode](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1ga2b25dc1732fe32dba564981106127d14) Registers an internal update status listener.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| [AppUpdateManager_requestCompleteUpdate](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1ga197a86eaae34d04a4ed39e8498534fe0)`()`                                                                                                                                                                                                                                                                                                                                            | [AppUpdateErrorCode](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1ga2b25dc1732fe32dba564981106127d14) Asynchronously requests to complete a flexible in-app update flow that was started via[AppUpdateManager_requestStartUpdate()](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1gabff89a1f00a9be306a2e9ec032c44364).                                                                                                                                                                                                                                                                                                          |
| [AppUpdateManager_requestInfo](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1ga262398baee56bd6c112057488e4fbb44)`()`                                                                                                                                                                                                                                                                                                                                                      | [AppUpdateErrorCode](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1ga2b25dc1732fe32dba564981106127d14) Asynchronously requests information about an update.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| [AppUpdateManager_requestStartUpdate](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1gabff89a1f00a9be306a2e9ec032c44364)`(`[AppUpdateInfo](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1gac1ae6e8c4f93360ecb1a5f5f95da4df3)` *info, `[AppUpdateOptions](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1ga688e0e8160c3b3213beaf8b01ed2b31a)` *options, jobject android_activity)` | [AppUpdateErrorCode](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1ga2b25dc1732fe32dba564981106127d14) Asynchronously requests to start the in-app update flow.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| [AppUpdateOptions_createOptions](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1ga6ff2892662049f39a2ab0e60f7a9ab11)`(`[AppUpdateType](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1ga7fa33ea73368628dc79cca13b8a38b65)` type, `[AppUpdateOptions](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1ga688e0e8160c3b3213beaf8b01ed2b31a)` **out_options)`                            | [AppUpdateErrorCode](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1ga2b25dc1732fe32dba564981106127d14) Creates a new AppUpdateOptions with the specified AppUpdateType.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| [AppUpdateOptions_destroy](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1ga6e858817099fa6d6b3eceb553a25fea0)`(`[AppUpdateOptions](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1ga688e0e8160c3b3213beaf8b01ed2b31a)` *options)`                                                                                                                                                                                              | `void` Releases the specified AppUpdateOptions and any references it holds.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| [AppUpdateOptions_getAppUpdateType](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1ga7f03f5894258fe4cb3ec65cb17613a60)`(`[AppUpdateOptions](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1ga688e0e8160c3b3213beaf8b01ed2b31a)` *options)`                                                                                                                                                                                     | [AppUpdateType](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1ga7fa33ea73368628dc79cca13b8a38b65) Returns the update type for the specified AppUpdateOptions.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| [AppUpdateOptions_isAssetPackDeletionAllowed](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1gaf022c772cca925bb4f2853b4da8557b6)`(`[AppUpdateOptions](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1ga688e0e8160c3b3213beaf8b01ed2b31a)` *options)`                                                                                                                                                                           | `bool` Returns whether the app installer should be allowed to delete some asset packs from the app's storage before attempting to update the app, for example if disk space is limited.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| [AppUpdateOptions_setAssetPackDeletionAllowed](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1gaee41166fe9bd4a60c3b0e5f3364068c1)`(`[AppUpdateOptions](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1ga688e0e8160c3b3213beaf8b01ed2b31a)` *options, bool allow)`                                                                                                                                                              | [AppUpdateErrorCode](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1ga2b25dc1732fe32dba564981106127d14) Indicates whether the app installer is allowed to delete existing asset packs while updating the app, for example if disk space is limited.                                                                                                                                                                                                                                                                                                                                                                                                                            |

## Enumerations

### AppUpdateAvailability

```text
 AppUpdateAvailability
```  
Availability info for an in-app update.

|                                              Properties                                               ||
|------------------------------------|-------------------------------------------------------------------|
| `APP_UPDATE_AVAILABLE`             | An update is available.                                           |
| `APP_UPDATE_AVAILABLILITY_UNKNOWN` | Update availability is unknown.                                   |
| `APP_UPDATE_NOT_AVAILABLE`         | No updates are available.                                         |
| `APP_UPDATE_TRIGGERED_IN_PROGRESS` | An update has been triggered by the developer and is in progress. |

### AppUpdateErrorCode

```text
 AppUpdateErrorCode
```  
Errors that can be encountered while using the in-app update API.

|                                                                                                               Properties                                                                                                               ||
|------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `APP_UPDATE_API_NOT_AVAILABLE`     | The in-app update API isn't available on this device.                                                                                                                                              |
| `APP_UPDATE_APP_NOT_OWNED`         | The app isn't owned by any user on this device. An app is "owned" if it has been acquired from the Play Store.                                                                                     |
| `APP_UPDATE_DOWNLOAD_NOT_PRESENT`  | The update has not been (fully) downloaded yet.                                                                                                                                                    |
| `APP_UPDATE_INITIALIZATION_FAILED` | Error initializing dependencies.                                                                                                                                                                   |
| `APP_UPDATE_INITIALIZATION_NEEDED` | The requested operation failed: call[AppUpdateManager_init()](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1gadb03d1a42b4945ebbf5996b1be0bf839)first. |
| `APP_UPDATE_INTERNAL_ERROR`        | An internal error occurred.                                                                                                                                                                        |
| `APP_UPDATE_INVALID_REQUEST`       | The function call was invalid, for example due to specifying a null parameter.                                                                                                                     |
| `APP_UPDATE_IN_PROGRESS`           | The update is already in progress and there is no UI flow to resume.                                                                                                                               |
| `APP_UPDATE_NOT_ALLOWED`           | The update isn't allowed due to the current device state, for example low battery or low disk space.                                                                                               |
| `APP_UPDATE_NO_ERROR`              | No error has occurred.                                                                                                                                                                             |
| `APP_UPDATE_PLAY_STORE_NOT_FOUND`  | The Play Store app is either not installed or not the official version.                                                                                                                            |
| `APP_UPDATE_UNAVAILABLE`           | The update is unavailable to this user or device.                                                                                                                                                  |
| `APP_UPDATE_UNKNOWN_ERROR`         | An unknown error occurred.                                                                                                                                                                         |

### AppUpdateStatus

```text
 AppUpdateStatus
```  
Status returned when requesting an in-app update.

|                                                      Properties                                                       ||
|----------------------------------------------|-------------------------------------------------------------------------|
| `APP_UPDATE_CANCELED`                        | An update has been canceled.                                            |
| `APP_UPDATE_DOWNLOADED`                      | An update has been fully downloaded.                                    |
| `APP_UPDATE_DOWNLOADING`                     | Download of an update is in progress.                                   |
| `APP_UPDATE_FAILED`                          | An update has failed.                                                   |
| `APP_UPDATE_INSTALLED`                       | An update has been successfully installed.                              |
| `APP_UPDATE_INSTALLING`                      | An update is being installed.                                           |
| `APP_UPDATE_PENDING`                         | Download of an update is pending and will be processed soon.            |
| `APP_UPDATE_REQUEST_COMPLETE_UPDATE_PENDING` | Request for completing an update is pending and will be processed soon. |
| `APP_UPDATE_REQUEST_INFO_COMPLETED`          | Request for update info has completed.                                  |
| `APP_UPDATE_REQUEST_INFO_FAILED`             | Request for update info has failed.                                     |
| `APP_UPDATE_REQUEST_INFO_PENDING`            | Request for update info is pending and will be processed soon.          |
| `APP_UPDATE_REQUEST_START_UPDATE_PENDING`    | Request for starting an update is pending and will be processed soon.   |
| `APP_UPDATE_STATUS_UNKNOWN`                  | The update status is unknown.                                           |

### AppUpdateType

```text
 AppUpdateType
```  
Methods for performing the in-app update flow.

Note: regardless of the method selected, the app needs to be restarted to install an update.

|                                                                     Properties                                                                      ||
|-----------------------------|------------------------------------------------------------------------------------------------------------------------|
| `APP_UPDATE_TYPE_FLEXIBLE`  | Flexible update flow, where the user can still use the app while the update is downloaded.                             |
| `APP_UPDATE_TYPE_IMMEDIATE` | Immediate update flow, where the user is unable to interact with the app while the update is downloaded and installed. |
| `APP_UPDATE_TYPE_UNKNOWN`   | The app update type is unknown or unspecified.                                                                         |

## Typedefs

### AppUpdateInfo

```scdoc
struct AppUpdateInfo_ AppUpdateInfo
```  
An opaque struct used to access information about an update.  

### AppUpdateOptions

```scdoc
struct AppUpdateOptions_ AppUpdateOptions
```  
An opaque struct used to provide options for an update.

## Functions

### AppUpdateInfo_destroy

```scdoc
void AppUpdateInfo_destroy(
  AppUpdateInfo *info
)
```  
Releases the specified AppUpdateInfo and any references it holds.

Except for rare cases, this function doesn't make JNI calls and can be called every frame.

|                                           Details                                           ||
|------------|---------------------------------------------------------------------------------|
| Parameters | |--------|----------------------------| | `info` | The AppUpdateInfo to free. | |

### AppUpdateInfo_getAvailability

```scdoc
AppUpdateAvailability AppUpdateInfo_getAvailability(
  AppUpdateInfo *info
)
```  
Returns the update availability for the specified AppUpdateInfo.

<br />

|                                                                        Details                                                                         ||
|-------------|-------------------------------------------------------------------------------------------------------------------------------------------|
| Parameters  | |--------|---------------------------------------------------------| | `info` | The AppUpdateInfo for which to get update availability. | |
| **Returns** | The update availability, for example APP_UPDATE_AVAILABLE.                                                                                |

### AppUpdateInfo_getAvailableVersionCode

```scdoc
uint32_t AppUpdateInfo_getAvailableVersionCode(
  AppUpdateInfo *info
)
```  
Returns the latest available version code for the specified AppUpdateInfo.

<br />

|                                                                           Details                                                                            ||
|-------------|-------------------------------------------------------------------------------------------------------------------------------------------------|
| Parameters  | |--------|------------------------------------------------------------| | `info` | The AppUpdateInfo for which to get available version code. | |
| **Returns** | The available version code for the update, or 0 if unknown.                                                                                     |

### AppUpdateInfo_getBytesDownloaded

```gdscript
uint64_t AppUpdateInfo_getBytesDownloaded(
  AppUpdateInfo *info
)
```  
Returns the total number in bytes already downloaded for the specified AppUpdateInfo.

<br />

|                                                                     Details                                                                      ||
|-------------|-------------------------------------------------------------------------------------------------------------------------------------|
| Parameters  | |--------|------------------------------------------------------| | `info` | The AppUpdateInfo for which to get bytes downloaded. | |
| **Returns** | The total number of bytes already downloaded.                                                                                       |

### AppUpdateInfo_getClientVersionStalenessDays

```scdoc
int32_t AppUpdateInfo_getClientVersionStalenessDays(
  AppUpdateInfo *info
)
```  
Returns the number of days that the Google Play Store app on the user's device has known about an available update.

<br />

|                                                                             Details                                                                              ||
|-------------|-----------------------------------------------------------------------------------------------------------------------------------------------------|
| Parameters  | |--------|--------------------------------------------------------------| | `info` | The AppUpdateInfo for which to get client version staleness. | |
| **Returns** | The number of days an app update has been available, or -1 if unknown or unavailable.                                                               |

### AppUpdateInfo_getPriority

```scdoc
int32_t AppUpdateInfo_getPriority(
  AppUpdateInfo *info
)
```  
Returns the priority for this update, as defined by the developer in the Google Play Developer API.

<br />

|                                                                    Details                                                                     ||
|-------------|-----------------------------------------------------------------------------------------------------------------------------------|
| Parameters  | |--------|-----------------------------------------------------| | `info` | The AppUpdateInfo for which to get update priority. | |
| **Returns** | The update priority, or 0 if unknown or unavailable.                                                                              |

### AppUpdateInfo_getStatus

```scdoc
AppUpdateStatus AppUpdateInfo_getStatus(
  AppUpdateInfo *info
)
```  
Returns the update status for the specified AppUpdateInfo.

<br />

|                                                                  Details                                                                   ||
|-------------|-------------------------------------------------------------------------------------------------------------------------------|
| Parameters  | |--------|---------------------------------------------------| | `info` | The AppUpdateInfo for which to get update status. | |
| **Returns** | The update status, for example APP_UPDATE_REQUEST_INFO_PENDING.                                                               |

### AppUpdateInfo_getTotalBytesToDownload

```gdscript
uint64_t AppUpdateInfo_getTotalBytesToDownload(
  AppUpdateInfo *info
)
```  
Returns the total bytes to download for the specified AppUpdateInfo.

<br />

|                                                                                Details                                                                                 ||
|-------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------|
| Parameters  | |--------|-----------------------------------------------------------------| | `info` | The AppUpdateInfo for which to get the total bytes to download. | |
| **Returns** | The total size in bytes for the update, or 0 if unknown.                                                                                                  |

### AppUpdateInfo_isUpdateTypeAllowed

```scdoc
bool AppUpdateInfo_isUpdateTypeAllowed(
  AppUpdateInfo *info,
  AppUpdateOptions *options
)
```  
Returns whether an update is allowed for the specified AppUpdateInfo and AppUpdateOptions.

This function's result can be checked prior to calling[AppUpdateManager_requestStartUpdate()](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1gabff89a1f00a9be306a2e9ec032c44364).

|                                                                                                                     Details                                                                                                                      ||
|-------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Parameters  | |-----------|-------------------------------------------------------------| | `info`    | An AppUpdateInfo to check for whether an update is allowed. | | `options` | The AppUpdateOptions specifying the update flow type.       | |
| **Returns** | True if the specified update options are allowed, or false if either the update isn't allowed or if there is an error, for example due to invalid parameters.                                                                       |

### AppUpdateManager_destroy

```scdoc
void AppUpdateManager_destroy()
```  
Frees up memory allocated for the in-app update API.

Does nothing if[AppUpdateManager_init()](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1gadb03d1a42b4945ebbf5996b1be0bf839)hasn't been called.  

### AppUpdateManager_getInfo

```scdoc
AppUpdateErrorCode AppUpdateManager_getInfo(
  AppUpdateInfo **out_info
)
```  
Gets the result of an ongoing or completed call to[AppUpdateManager_requestInfo()](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1ga262398baee56bd6c112057488e4fbb44),[AppUpdateManager_requestStartUpdate()](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1gabff89a1f00a9be306a2e9ec032c44364), or[AppUpdateManager_requestCompleteUpdate()](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1ga197a86eaae34d04a4ed39e8498534fe0).

This function doesn't make JNI calls and can be called every frame to monitor progress.**See also:** [AppUpdateInfo_destroy](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1ga3ac84095638d8ed020deb2ebd845952a)

|                                                                      Details                                                                      ||
|-------------|--------------------------------------------------------------------------------------------------------------------------------------|
| Parameters  | |------------|--------------------------------------------| | `out_info` | An out parameter for receiving the result. |              |
| **Returns** | APP_UPDATE_NO_ERROR if the request is ongoing or successful, or an error indicating why in-app update may not currently be possible. |

### AppUpdateManager_init

```scdoc
AppUpdateErrorCode AppUpdateManager_init(
  JavaVM *jvm,
  jobject android_context
)
```  
Initialize the in-app update API, making the other functions available to call.

**See also:** [AppUpdateManager_destroy](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1ga9886fee9d63e381a1da12a875ca386f6)

|                                                                                                                                                                  Details                                                                                                                                                                   ||
|-------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Parameters  | |-------------------|-----------------------------------------------------------------------------------| | `jvm`             | The app's single JavaVM, which can be obtained from ANativeActivity's "vm" field. | | `android_context` | An Android Context, which can be obtained from ANativeActivity's "clazz" field.   | |
| **Returns** | APP_UPDATE_NO_ERROR if initialization succeeded, or an error if not.                                                                                                                                                                                                                                                          |

### AppUpdateManager_onPause

```scdoc
AppUpdateErrorCode AppUpdateManager_onPause()
```  
Deregisters an internal update status listener.

Must be called in ANativeActivity ANativeActivityCallbacks's onPause, or equivalent.

|                                   Details                                   ||
|-------------|----------------------------------------------------------------|
| **Returns** | APP_UPDATE_NO_ERROR if the call succeeded, or an error if not. |

### AppUpdateManager_onResume

```scdoc
AppUpdateErrorCode AppUpdateManager_onResume()
```  
Registers an internal update status listener.

Must be called in ANativeActivity ANativeActivityCallbacks's onResume, or equivalent.

|                                   Details                                   ||
|-------------|----------------------------------------------------------------|
| **Returns** | APP_UPDATE_NO_ERROR if the call succeeded, or an error if not. |

### AppUpdateManager_requestCompleteUpdate

```scdoc
AppUpdateErrorCode AppUpdateManager_requestCompleteUpdate()
```  
Asynchronously requests to complete a flexible in-app update flow that was started via[AppUpdateManager_requestStartUpdate()](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1gabff89a1f00a9be306a2e9ec032c44364).

This function can be called after the update reaches the APP_UPDATE_DOWNLOADED status. After calling this function the system installer will close the app, perform the update, and then restart the app at the updated version.

|                                                   Details                                                   ||
|-------------|------------------------------------------------------------------------------------------------|
| **Returns** | APP_UPDATE_NO_ERROR if the update completion request started successfully, or an error if not. |

### AppUpdateManager_requestInfo

```scdoc
AppUpdateErrorCode AppUpdateManager_requestInfo()
```  
Asynchronously requests information about an update.

Needs to be called once before[AppUpdateManager_requestStartUpdate()](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1gabff89a1f00a9be306a2e9ec032c44364)to obtain an AppUpdateInfo, which is required to launch the in-app update flow.

Use[AppUpdateManager_getInfo()](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1gae82c77a38ed8cb749ff3447cb3267386)to poll for the result.

Note: this function isn't idempotent and restarts the request on every call.

|                                          Details                                          ||
|-------------|------------------------------------------------------------------------------|
| **Returns** | APP_UPDATE_NO_ERROR if the request started successfully, or an error if not. |

### AppUpdateManager_requestStartUpdate

```scdoc
AppUpdateErrorCode AppUpdateManager_requestStartUpdate(
  AppUpdateInfo *info,
  AppUpdateOptions *options,
  jobject android_activity
)
```  
Asynchronously requests to start the in-app update flow.

Use[AppUpdateManager_getInfo()](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1gae82c77a38ed8cb749ff3447cb3267386)to monitor the current status and download progress of the ongoing asynchronous update operation.

|                                                                                                                                                                                                                       Details                                                                                                                                                                                                                        ||
|-------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Parameters  | |--------------------|----------------------------------------------------------------------------------| | `info`             | The AppUpdateInfo containing information needed for an update.                   | | `options`          | The AppUpdateOptions specifying the update flow type.                            | | `android_activity` | An Android Activity, which can be obtained from ANativeActivity's "clazz" field. | |
| **Returns** | APP_UPDATE_NO_ERROR if the request started successfully, or an error if not.                                                                                                                                                                                                                                                                                                                                                            |

### AppUpdateOptions_createOptions

```carbon
AppUpdateErrorCode AppUpdateOptions_createOptions(
  AppUpdateType type,
  AppUpdateOptions **out_options
)
```  
Creates a new AppUpdateOptions with the specified AppUpdateType.

**See also:** [AppUpdateOptions_destroy](https://developer.android.com/reference/native/play/core/group/appupdate#group__appupdate_1ga6e858817099fa6d6b3eceb553a25fea0)

|                                                                                                                     Details                                                                                                                      ||
|-------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Parameters  | |---------------|---------------------------------------------------------| | `type`        | The AppUpdateType specifying the update flow type.      | | `out_options` | An out parameter to store the created AppUpdateOptions. | |
| **Returns** | APP_UPDATE_NO_ERROR if an AppUpdateOptions is created successfully, or an error if not.                                                                                                                                             |

### AppUpdateOptions_destroy

```scdoc
void AppUpdateOptions_destroy(
  AppUpdateOptions *options
)
```  
Releases the specified AppUpdateOptions and any references it holds.

<br />

|                                                 Details                                                 ||
|------------|---------------------------------------------------------------------------------------------|
| Parameters | |-----------|-------------------------------| | `options` | The AppUpdateOptions to free. | |

### AppUpdateOptions_getAppUpdateType

```scdoc
AppUpdateType AppUpdateOptions_getAppUpdateType(
  AppUpdateOptions *options
)
```  
Returns the update type for the specified AppUpdateOptions.

<br />

|                                                                          Details                                                                           ||
|-------------|-----------------------------------------------------------------------------------------------------------------------------------------------|
| Parameters  | |-----------|--------------------------------------------------------| | `options` | The AppUpdateOptions for which to get the update type. | |
| **Returns** | The type of app update flow.                                                                                                                  |

### AppUpdateOptions_isAssetPackDeletionAllowed

```scdoc
bool AppUpdateOptions_isAssetPackDeletionAllowed(
  AppUpdateOptions *options
)
```  
Returns whether the app installer should be allowed to delete some asset packs from the app's storage before attempting to update the app, for example if disk space is limited.

<br />

|                                                                         Details                                                                          ||
|-------------|---------------------------------------------------------------------------------------------------------------------------------------------|
| Parameters  | |-----------|-------------------------------------------------------| | `options` | The AppUpdateOptions specifying the update flow type. | |
| **Returns** | Bool indicating whether the app installer should be allowed to delete asset packs (if necessary) during an app update.                      |

### AppUpdateOptions_setAssetPackDeletionAllowed

```scdoc
AppUpdateErrorCode AppUpdateOptions_setAssetPackDeletionAllowed(
  AppUpdateOptions *options,
  bool allow
)
```  
Indicates whether the app installer is allowed to delete existing asset packs while updating the app, for example if disk space is limited.

<br />

|                                                                                                                                                                                                        Details                                                                                                                                                                                                        ||
|-------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Parameters  | |-----------|--------------------------------------------------------------------------------------------------------------------| | `options` | The AppUpdateOptions on which to configure this setting.                                                           | | `allow`   | Boolean indicating whether the app installer is allowed to delete asset packs (if necessary) during an app update. | |
| **Returns** | APP_UPDATE_NO_ERROR if the value is set successfully, or an error if not.                                                                                                                                                                                                                                                                                                                                |