Code Monkey home page Code Monkey logo

in-app-update-compose's Introduction

Maven Central Crowdin

In-App update compose

A way to make in app updates in compose

How to include in your project

The library is available via MavenCentral:

allprojects {
    repositories {
        // ...
        mavenCentral()
    }
}
Snapshots of the development version are available in Sonatype's snapshots repository.

Sonatype Nexus (Snapshots)

allprojects {
    repositories {
        // ...
        maven {
            url 'https://oss.sonatype.org/content/repositories/snapshots/'
        }
    }
}

Add it to your module dependencies:

dependencies {
    implementation("se.warting.in-app-update:in-app-update-compose:<latest_version>")
}

How to use

All you need to do is to use RequireLatestVersion:

@Composable
fun MainView() {
    RequireLatestVersion {
        Welcome()
    }
}

For a full implementation see: Full sample

or if you want more granular control:

@Composable
fun InAppUpdate() {
    val updateState = rememberInAppUpdateState()
    when (val result = updateState.appUpdateResult) {
        is AppUpdateResult.NotAvailable -> NotAvailable()
        is AppUpdateResult.Available -> Available(result)
        is AppUpdateResult.InProgress -> InProgress(result)
        is AppUpdateResult.Downloaded -> Downloaded(result)
    }
}

For a full implementation see: Full sample

in-app-update-compose's People

Contributors

dependabot[bot] avatar warting avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

in-app-update-compose's Issues

Unresolved reference: appUpdateResult

@composable
fun InAppUpdate() {
val updateState = rememberInAppUpdateState()
when (val result = updateState.appUpdateResult) {
is AppUpdateResult.NotAvailable -> NotAvailable()
is AppUpdateResult.Available -> Available(result)
is AppUpdateResult.InProgress -> InProgress(result)
is AppUpdateResult.Downloaded -> Downloaded(result)
}
}

Version: 1.2.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.