Setup
Release control is on by default onceLerix.initialize runs, with the
built-in screens. To change it, pass appControl:
AppDelegate.swift
Version
The SDK sendsCFBundleShortVersionString as the version and
CFBundleVersion as the build number, and the bundle ID so Lerix can pick the
right store 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 push so apps in the background refresh too. It needs the setup from Push Notifications: the Remote notifications background mode, anddidReceiveRemoteNotification forwarding to
Lerix.notifications.handleRemoteNotification(userInfo:). The SDK recognises
the refresh message and checks right away. Without push, apps pick up the
change at their next check.
Built-in screens
- Maintenance: on iOS, a window of its own above everything else in the app, including alerts, with a Try again button. On macOS, an opaque layer over every app window that takes all clicks and keys; the menu bar (for example Quit) stays usable.
- Required update: the same full-screen host, with release notes and an Update button that opens the App Store.
- Update prompt: an alert (macOS: a sheet) with Update, Later and, when allowed, Skip this version. Release notes are added to the message.
Your own screens
Setui: false, then read Lerix.appControl.state and observe changes. The
state has update (LerixAppUpdate), maintenance (LerixMaintenance) and
sdk (LerixSdkControl), each nil when nothing applies (fields in
The state). Changes arrive on
the main thread.
onChange holds one closure. To observe from several places, use
addListener, which returns a token for removeListener:
Check now
refresh() ignores the saved answer’s lifetime, fetches, and returns the new
state. The SDK already checks on launch, when the app returns to the
foreground, and every minute during an emergency (see
Delivery and offline behaviour).