Bundled UI and OTA updates
The rewards UI can be served two ways:
| Mode | How | Updates |
|---|---|---|
| Hosted (default on iOS) | Loaded from Flyy's CDN | Always the latest |
| Bundled (auto-detected on Android) | Shipped in your app | Over the air (OTA) |
Bundled mode opens instantly and works offline. OTA means UI fixes and new campaign layouts reach users without an app release.
Bundle the UI
- Android
- iOS
Copy the web build into src/main/assets/flyy-dist/. Flyy.start detects it and
logs which mode it's in under the FlyySDK tag.
Add the web build to your app target as a folder reference named FlyyDist, then:
Flyy.initialize(FlyyConfig(partnerId: "…", useBundledAssets: true))
How OTA works
- Checks on every launch. When nothing changed, the cost is one small manifest request.
- Downloads only from your configured origin, over TLS. Every file is checked against the manifest's sha256.
- A failed or interrupted update leaves the current build untouched. One previous version is kept.
- A build older than the one inside your app is never installed.
API
- Android
- iOS
Flyy.getOtaVersion() // version being served
Flyy.checkForOtaUpdate(object : FlyyDataCallback {
override fun onSuccess(data: JSONObject) {
// {"status": "updated" | "up_to_date" | "skipped", "version": …}
}
override fun onFailure(message: String) { }
})
Flyy.start(this) { partnerId = "…"; otaEnabled = false } // pin the bundled build
Flyy.getOtaVersion()
Flyy.checkForOtaUpdate { status, version in }
FlyyConfig(partnerId: "…", useBundledAssets: true, otaEnabled: false) // pin
:::tip Testing a new bundled build An active OTA build takes priority over the files in your app. To test a freshly bundled build, clear app data (or delete and reinstall the app) first. :::