Force updates
A force update is a Patch release marked mandatory, so your app can require
the patch before the user continues. Some fixes can’t wait for the next natural
launch — a critical tax bug, a broken eligibility rule. The flag rides through
the update check and surfaces as UpdateInfo.isMandatory; you decide what UI to
show. The pattern mirrors EAS / Expo-Updates’ “Update available → Download
now.”
Mark a release mandatory
Section titled “Mark a release mandatory”# push the fix to everyone and flag it mandatory$ patchcli release --rollout 100 --mandatory --message "Critical: VAT rounding fix"The mandatory flag rides through the update-check response. On the device, checkForUpdate() returns an UpdateInfo with isMandatory == true.
The “Download now” pattern
Section titled “The “Download now” pattern”You stay in control of UI. The recommended flow: check on launch, and if a mandatory update exists, present a blocking sheet that downloads and reloads before letting the user proceed.
func gateOnMandatoryUpdate() async throws { guard let info = try await Patch.shared.checkForUpdate() else { return }
if info.isMandatory { // Block the UI: "A required update is available." presentBlockingSheet(version: info.version, notes: info.releaseNotes)
// Download → verify → stage → hot-swap, then dismiss the gate. if try await Patch.shared.fetchUpdate() { try await Patch.shared.reloadAsync() dismissBlockingSheet() } } else { // Optional update — show a dismissible banner instead. showDismissibleBanner(info) }}Prefer it fully automatic? Call the convenience, which fetches + reloads any mandatory update and no-ops otherwise:
ContentView().task { await Patch.shared.start() // normal startup updates await Patch.shared.enforceMandatoryUpdates() // force any mandatory release}Related
Section titled “Related”- Staged rollouts & A/B — percentages, adoption, and rollback
- SDK reference —
checkForUpdate,fetchUpdate,reloadAsync - Instant rollback for an iOS release
- The iOS hotfix playbook