{"id":13902433,"url":"https://github.com/warting/In-App-Update-Compose","last_synced_at":"2025-07-18T00:31:30.139Z","repository":{"id":36979469,"uuid":"413340665","full_name":"warting/In-App-Update-Compose","owner":"warting","description":"A compose friendly way to deal with in app updates on android","archived":false,"fork":false,"pushed_at":"2024-07-02T03:29:11.000Z","size":415,"stargazers_count":66,"open_issues_count":2,"forks_count":5,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-07-02T05:44:00.147Z","etag":null,"topics":["android","compose","in-app-updates","jetpack-compose"],"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/warting.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["warting"]}},"created_at":"2021-10-04T08:40:10.000Z","updated_at":"2024-07-02T05:44:00.148Z","dependencies_parsed_at":"2024-06-27T05:38:10.951Z","dependency_job_id":null,"html_url":"https://github.com/warting/In-App-Update-Compose","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/warting%2FIn-App-Update-Compose","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/warting%2FIn-App-Update-Compose/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/warting%2FIn-App-Update-Compose/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/warting%2FIn-App-Update-Compose/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/warting","download_url":"https://codeload.github.com/warting/In-App-Update-Compose/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":214260251,"owners_count":15707068,"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","compose","in-app-updates","jetpack-compose"],"created_at":"2024-08-06T22:01:08.872Z","updated_at":"2025-07-18T00:31:30.108Z","avatar_url":"https://github.com/warting.png","language":"Kotlin","funding_links":["https://github.com/sponsors/warting"],"categories":["Kotlin"],"sub_categories":[],"readme":"[![Maven Central](https://maven-badges.herokuapp.com/maven-central/se.warting.in-app-update/in-app-update-compose/badge.png)](https://maven-badges.herokuapp.com/maven-central/se.warting.in-app-update/in-app-update-compose)\n[![Crowdin](https://badges.crowdin.net/in-app-update-compose/localized.svg)](https://crowdin.com/project/in-app-update-compose)\n![Platform](https://img.shields.io/badge/platform-android-green.svg)\n[![API](https://img.shields.io/badge/API-21%2B-brightgreen.svg?style=flat)](https://android-arsenal.com/api?level=21)\n\n# In-App Update Compose\n\nA Jetpack Compose implementation for managing in-app updates in Android applications. This library makes it easy to integrate Google Play's in-app update API with your Compose UI, providing both ready-to-use UI components and flexible state management.\n\n## Features\n\n- 🔄 Automatic update checking with Google Play\n- 🎨 Material Design UI components for update flows\n- 🔧 Configurable update priorities and prompt intervals\n- 🔕 Silent update option for minimal UI intervention \n- 🎛️ Custom UI state management support\n- 👥 Multiple implementation approaches to fit your needs\n\n## Requirements\n\n- Android API level 21+ (Android 5.0 Lollipop and higher)\n- Jetpack Compose\n- App published on Google Play Store\n\n## How to include in your project\n\nThe library is available via MavenCentral:\n\n```\nallprojects {\n    repositories {\n        // ...\n        mavenCentral()\n    }\n}\n```\n\n\n\u003cdetails\u003e\n\u003csummary\u003eSnapshots of the development version are available in Sonatype's snapshots repository.\u003c/summary\u003e\n\u003cp\u003e\n\n[![Sonatype Nexus (Snapshots)](https://img.shields.io/nexus/s/se.warting.in-app-update/in-app-update-compose?server=https%3A%2F%2Foss.sonatype.org)](https://oss.sonatype.org/content/repositories/snapshots/se/warting/in-app-update/in-app-update-compose/)\n\n```groovy\nallprojects {\n    repositories {\n        // ...\n        maven {\n            url 'https://oss.sonatype.org/content/repositories/snapshots/'\n        }\n    }\n}\n```\n\n\u003c/p\u003e\n\u003c/details\u003e\n\n## Libraries\n\nThis library consists of two main libraries:\n\n### Core Module\nBasic functionality without any default UI:\n\n```\ndependencies {\n    implementation(\"se.warting.in-app-update:in-app-update-compose:\u003clatest_version\u003e\")\n}\n```\n\n### Material UI Module\nImplementation with Material Design components:\n\n```\ndependencies {\n    implementation(\"se.warting.in-app-update:in-app-update-compose-mui:\u003clatest_version\u003e\")\n}\n```\n\n## How to use\n\n### Using Material UI Implementation\n\nThe simplest way is to use the Material UI implementation with `MaterialRequireLatestVersion`. This component provides a complete Material Design UI for handling all update states:\n\n```kotlin\n@Composable\nfun MainView() {\n    MaterialRequireLatestVersion {\n        // Your app content goes here\n        Welcome()\n    }\n}\n```\n\nWhen using `MaterialRequireLatestVersion`:\n- A loading indicator appears when checking for updates\n- Required updates show a mandatory update screen until the user updates\n- Download progress is displayed for required updates being downloaded\n- Downloaded required updates show an install prompt\n- Optional updates allow continued app usage with normal content\n- Update errors show a dedicated error screen\n\n#### Supported Languages\n\nThe Material UI components come with translations for the following languages:\n- English (en) - Default\n- Afrikaans (af-ZA)\n- Arabic (ar-SA)\n- Catalan (ca-ES)\n- Czech (cs-CZ)\n- Danish (da-DK)\n- Dutch (nl-NL)\n- Finnish (fi-FI)\n- French (fr-FR)\n- German (de)\n- Greek (el-GR)\n- Hebrew (iw-IL)\n- Hungarian (hu-HU)\n- Italian (it-IT)\n- Japanese (ja-JP)\n- Korean (ko-KR)\n- Norwegian (no-NO)\n- Polish (pl-PL)\n- Portuguese (Brazil) (pt-BR)\n- Portuguese (Portugal) (pt-PT)\n- Romanian (ro-RO)\n- Russian (ru)\n- Serbian (sr-SP)\n- Spanish (es-ES)\n- Swedish (sv-SE)\n- Turkish (tr-TR)\n- Ukrainian (uk-UA)\n- Vietnamese (vi-VN)\n- Chinese (Simplified) (zh-CN)\n- Chinese (Traditional) (zh-TW)\n\nIf you need support for additional languages, please:\n1. Open an issue on GitHub describing the language you need\n2. Or submit a Pull Request with your translation\n\nTranslations are managed through [Crowdin](https://crowdin.com/project/in-app-update-compose). You can contribute directly there as well.\n\nFor a full implementation example, see: [Material UI sample](app/src/main/java/se/warting/appupdatecompose/UiActivity.kt)\n\n### Using Core Implementation with Custom UI\n\nFor more granular control, you can use the core module and create your own UI:\n\n```kotlin\n@Composable\nfun InAppUpdate() {\n    val updateState = rememberInAppUpdateState()\n    when (updateState) {\n        InAppUpdateState.Loading -\u003e Loading()\n        InAppUpdateState.NotAvailable -\u003e NotAvailable()\n        is InAppUpdateState.RequiredUpdate -\u003e RequiredUpdate(updateState)\n        is InAppUpdateState.OptionalUpdate -\u003e OptionalUpdate(updateState)\n        is InAppUpdateState.InProgressUpdate -\u003e InProgress(updateState)\n        is InAppUpdateState.DownloadedUpdate -\u003e Downloaded(updateState)\n        is InAppUpdateState.Error -\u003e Error(updateState)\n    }\n}\n```\n\nFor a more complex implementation with different update modes, see: [Custom Implementation](app/src/main/java/se/warting/appupdatecompose/MainActivity.kt)\n\n### Core Update State Management\n\nThe `rememberInAppUpdateState` function is the core of this library's update functionality. It handles checking for updates, determining their priority, and managing the update flow:\n\n```kotlin\n@Composable\nfun YourCustomImplementation() {\n    val updateState = rememberInAppUpdateState(\n        highPrioritizeUpdates = 4,\n        mediumPrioritizeUpdates = 2,\n        promptIntervalHighPrioritizeUpdateInDays = 1,\n        autoTriggerRequiredUpdates = true\n    )\n    \n    // Use updateState to build your own UI and behavior\n}\n```\n\nKey features of `rememberInAppUpdateState`:\n- Returns an `InAppUpdateState` that represents the current update status\n- Automatically checks for available updates from Google Play\n- Categorizes updates by priority (high, medium, low)\n- Can be configured to automatically trigger required or optional updates\n- Controls how frequently users are prompted about updates\n- Provides actions for starting, completing, or declining updates\n\nBoth `MaterialRequireLatestVersion` and `SilentUpdateHandler` use this function internally, but you can also use it directly when you need complete control over your update UI and behavior.\n\n### Update Types and Priority\n\nThe library categorizes updates into different priority levels:\n\n1. **High Priority Updates** - Critical updates like security patches\n2. **Medium Priority Updates** - Important feature updates\n3. **Low Priority Updates** - Minor enhancements and improvements\n\nYou can configure how these updates are handled:\n\n```kotlin\nrememberInAppUpdateState(\n    highPrioritizeUpdates = 4,           // How many updates to consider high priority\n    mediumPrioritizeUpdates = 2,         // How many updates to consider medium priority\n    promptIntervalHighPrioritizeUpdateInDays = 1,    // How often to prompt for high priority\n    promptIntervalMediumPrioritizeUpdateInDays = 3,  // How often to prompt for medium priority\n    promptIntervalLowPrioritizeUpdateInDays = 7      // How often to prompt for low priority\n)\n```\n\n### Additional Options\n\nThe library supports various configurations:\n\n```kotlin\nMaterialRequireLatestVersion(\n    // Custom settings\n    highPrioritizeUpdates = 4,\n    mediumPrioritizeUpdates = 2,\n    promptIntervalHighPrioritizeUpdateInDays = 1,\n    promptIntervalMediumPrioritizeUpdateInDays = 1,\n    promptIntervalLowPrioritizeUpdateInDays = 7,\n) {\n    // Your app content\n}\n```\n\n### Silent Update Handling\n\nFor applications that want updates to happen silently in the background with minimal UI intervention, use the `SilentUpdateHandler`:\n\n```kotlin\nSilentUpdateHandler(\n    errorContent = {\n        // Your custom error UI\n    },\n    content = {\n        // Your normal app content\n    }\n)\n```\n\nWhen using `SilentUpdateHandler`:\n- Updates are checked for and processed automatically in the background\n- Your regular content is shown during normal operation and for optional updates\n- Required updates that are declined will cause the app to close\n- No UI is shown during update loading or download processes\n- Your error content is only shown if update checking fails\n\n\u003e **Note:** The previous `NoUi` component is deprecated and has been replaced by `SilentUpdateHandler`\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE).\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwarting%2FIn-App-Update-Compose","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwarting%2FIn-App-Update-Compose","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwarting%2FIn-App-Update-Compose/lists"}