JchuAppUpdateController

class JchuAppUpdateController(activity: ComponentActivity, val config: JchuAppUpdateConfig = JchuAppUpdateConfig()) : DefaultLifecycleObserver

Manages Google Play's flexible in-app update flow for one ComponentActivity.

Create this controller during the activity's onCreate callback. It registers its activity result and observes the activity lifecycle; the host app remains responsible for rendering JchuAppUpdateSnapshot in its own UI.

This controller is opt-in. Set JchuAppUpdateConfig.enabled to false for builds that should not check Google Play for updates.

Constructors

Link copied to clipboard
constructor(activity: ComponentActivity, config: JchuAppUpdateConfig = JchuAppUpdateConfig())

Properties

Link copied to clipboard
Link copied to clipboard

The latest snapshot, also available before the first update check completes.

Link copied to clipboard

Observable snapshots for UI frameworks such as Jetpack Compose.

Functions

Link copied to clipboard
fun dismiss()

Dismisses the current update UI and applies the configured cooldown to available updates.

Link copied to clipboard

Completes installation after the flexible update has reached JchuAppUpdateState.Downloaded.

Link copied to clipboard
open fun onCreate(owner: LifecycleOwner)
Link copied to clipboard
open override fun onDestroy(owner: LifecycleOwner)
Link copied to clipboard
open fun onPause(owner: LifecycleOwner)
Link copied to clipboard
open override fun onResume(owner: LifecycleOwner)
Link copied to clipboard
open override fun onStart(owner: LifecycleOwner)
Link copied to clipboard
open override fun onStop(owner: LifecycleOwner)
Link copied to clipboard
fun retry()

Checks again and requests that an available update be presented even if recently dismissed.

Link copied to clipboard

Reopens the app's update UI for an update that is still in progress.

Link copied to clipboard

Starts the flexible update flow for the latest available update.