{"id":20604912,"url":"https://github.com/allaboutapps/a3inappupdater","last_synced_at":"2025-04-15T02:27:11.956Z","repository":{"id":37760543,"uuid":"190704577","full_name":"allaboutapps/A3InAppUpdater","owner":"allaboutapps","description":"Android Library to minimize the implementation effort for In App Updates and Forced Updates","archived":false,"fork":false,"pushed_at":"2021-05-07T06:20:31.000Z","size":6124,"stargazers_count":44,"open_issues_count":2,"forks_count":7,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-03-28T14:11:40.043Z","etag":null,"topics":["android","android-app","android-library","appupdate","id-allaboutapps-android","inappupdate"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/allaboutapps.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-06-07T07:28:21.000Z","updated_at":"2024-01-27T09:19:50.000Z","dependencies_parsed_at":"2022-09-09T00:20:45.346Z","dependency_job_id":null,"html_url":"https://github.com/allaboutapps/A3InAppUpdater","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allaboutapps%2FA3InAppUpdater","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allaboutapps%2FA3InAppUpdater/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allaboutapps%2FA3InAppUpdater/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allaboutapps%2FA3InAppUpdater/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/allaboutapps","download_url":"https://codeload.github.com/allaboutapps/A3InAppUpdater/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248993158,"owners_count":21195146,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","android-app","android-library","appupdate","id-allaboutapps-android","inappupdate"],"created_at":"2024-11-16T09:25:35.454Z","updated_at":"2025-04-15T02:27:11.938Z","avatar_url":"https://github.com/allaboutapps.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# A3InAppUpdater\n\n[![Build Status](https://travis-ci.org/allaboutapps/A3InAppUpdater.svg?branch=master)](https://travis-ci.org/allaboutapps/A3InAppUpdater)\n[ ![Download](https://api.bintray.com/packages/allaboutapps/A3-Android/at.allaboutapps.inappupdater.a3inappupdater/images/download.svg) ](https://bintray.com/allaboutapps/A3-Android/at.allaboutapps.inappupdater.a3inappupdater/_latestVersion)\n\n\n![all about apps](https://allaboutapps.at/wp-content/uploads/2019/11/aaa-logo-dark@2x.png \"all about apps\")\n\n###### Looking for a job as android developer located in vienna? [Just contact us](https://www.allaboutapps.at/jobs/android-app-entwickler/)\n\n\nThis library aims to simplify Android [In App Updates](https://developer.android.com/guide/app-bundle/in-app-updates). You can force your users to update to latest app version with just a few lines of code. \n\n### BLOG POST\nVisit [https://code.allaboutapps.at/articles/android-in-app-updates/](https://code.allaboutapps.at/articles/android-in-app-updates/) to get some detailed informations about this library\n\n### DEMO VIDEOS\n\n![Flexible update](assets/flexible_update_small.gif)\n\n[(YOUTUBE) Demo type FLEXIBLE](https://youtu.be/c4IGhj5E7eI)\n\n[(YOUTUBE) Demo type IMMEDIATE](https://youtu.be/mr5SGbXs3ec)\n\n[(YOUTUBE) Demo Forced update](https://youtu.be/9R7vMctW87I)\n\n# Usage\n\n\n## Add to project\n\n```Gradle\n    implementation 'at.allaboutapps.inappupdater:inappupdater:{latest_version}'\n```\n\n## Initialize the InAppUpdateManager\n```Kotlin\n    inAppUpdateManager = InAppUpdateManager(activity)\n```\n\n## Subscribe to updates \n```Kotlin\n    inAppUpdateStatusDisposable = inAppUpdateManager.observeInAppUpdateStatus()\n        .subscribe { currentStatus -\u003e\n            if (currentStatus.isUpdatePending()) { //just start the update if there is one in progress\n                inAppUpdateManager.startUpdate()\n            }\n            updateUI(currentStatus) // update the ui when a new status arrives\n        }\n```\n\n## Update Mode\nThere are two modes\n* Flexible *(default)* - User can use the app during update download, installation and restart needs to be triggered by user\n\n* Immediate - User will be blocked until download and installation is finished, restart is triggered automatically\n\n\n#### Start the update process\n```Kotlin\n    inAppUpdateManager.startUpdate(updateType)\n```\n\n\n## Forced updates\nThere are some reasons when an update is mandatory. For this case you can implement a provider interface to decide if an update is a forced update\n\n```Kotlin\n   class DemoForceUpdateProvider : ForceUpdateProvider {\n\n    override fun requestUpdateShouldBeImmediate(availableVersionCode: Int, doUpdate: () -\u003e Unit) {\n\n        // place your logic here\n\n        // if a forced update is needed, just call doUpdate\n        doUpdate()\n\n    }\n```\n\nJust provide to the InAppUpdateManager a second, optional parameter\n```Kotlin\n    inAppUpdateManager = InAppUpdateManager(this, DemoForceUpdateProvider())\n```\n\nThe force update activity screen provided by Google Play Core library can be closed through the back button. So we need to override onActivityResult to force the update again\n```Kotlin\n      override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {\n        inAppUpdateManager.onActivityResult(requestCode, resultCode)\n        super.onActivityResult(requestCode, resultCode, data)\n    }\n```\n\n\n### How to setup the demo app\n\nIn App Updates needs a newer version of the app available in Play Store.\n\n1. Add a SigningConfig to build.gradle\n2. Set versionCode to 9000 // or any other high number\n3. Set a unique application id\n4. Generate APK / AAB\n5. Upload APK / AAB to your play store account\n6. Do not use App signing ( Google will resign your app, so you cannot test it with local installations)\n7. Release app to play store (app must be published and available)\n8. Set versionCode to a lower number\n9. Run app \n\n\n### Any Troubles?\n\n* In-app updates are available only to user accounts that own the app. So, make sure the account you’re using has downloaded your app from Google Play *at least once before* using the account to test in-app updates.\n* Make sure that the app that you are testing in-app updates with has the same application ID and is signed with the same signing key as the one available from Google Play.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fallaboutapps%2Fa3inappupdater","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fallaboutapps%2Fa3inappupdater","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fallaboutapps%2Fa3inappupdater/lists"}