Setup
Release control is on by default onceLerix.initialize() runs, with the
built-in screens. To change it, pass appControl:
MyApplication.kt
Google Play in-app updates
usePlayInAppUpdate needs Play’s in-app update library in your app. The SDK
doesn’t bundle it, so add it yourself:
app/build.gradle.kts
Version
The SDK sendsversionName as the version and versionCode as the build
number, and the package name so Lerix can build the Google Play link. Rules
compare build numbers when both sides have one.
Instant changes with silent push
When you start or end a maintenance window or force an update, Lerix sends a silent FCM data message so apps in the background refresh too. It reaches apps with push notifications set up, and the SDK handles it for you: it is never shown as a notification. Without push, apps pick up the change at their next check.Built-in screens
- Maintenance: a full-screen activity over your app, with a Try again button. Back sends the app to the background; it never returns into the app. If another of your activities comes to the front, the screen comes back on top.
- Required update: the same full-screen host, with release notes and an Update button.
- Update prompt: a dialog on the current activity with Update, Later and, when allowed, Skip this version. Back closes it without saving Later.
AndroidManifest.xml. Buttons follow the device language
(English, or Arabic right to left). See
Custom UI for when
each one appears.
Your own screens
Setui = false, then collect Lerix.appControl.state, a
StateFlow<LerixAppControlState>. The state has update (LerixAppUpdate),
maintenance (LerixMaintenance) and sdk (LerixSdkControl), each null
when nothing applies (fields in
The state).
Lerix.appControl.currentState reads it once.
MainActivity.kt
openStore so Play’s in-app update can start
from it. Without one, the SDK uses the activity in the foreground.
Check now
Lerix.appControl.refresh() is a suspend function that ignores the saved
answer’s lifetime, fetches, and returns the new state. refresh(callback)
does the same from Java-style code. The SDK already checks on launch, when the app
returns to the foreground, and every minute during an emergency (see
Delivery and offline behaviour).