Skip to main content

Initialize

Initialize once, as early as possible. This is the only required call. After it, the SDK tracks installs, refreshes campaign config on every foreground, and keeps a WebView warm so the first screen paints instantly.

Call Flyy.start in your launcher activity's onCreate:

MainActivity.kt
Flyy.start(this) {
partnerId = "YOUR_PARTNER_KEY" // dashboard → Settings
environment = FlyyEnvironment.STAGE // PRODUCTION when live
user = "user-1001" // or userToken = "…" (see Identify users)
themeColor = "#7C3AED"
}

Flyy.start is idempotent. A repeat call (rotation, re-entry) initializes nothing again, re-sends no identity and adds no duplicate listeners. Config is saved, so an activity restored after process death works without a new call.

Prefer to initialize in Application.onCreate? Use the explicit API instead:

App.kt
class App : Application() {
override fun onCreate() {
super.onCreate()
Flyy.init(this, "YOUR_PARTNER_KEY", Flyy.STAGE)
}
}

Options​

Only partnerId is required.

OptionDefaultWhat it does
partnerId—Partner key from the dashboard. Required.
environmentPRODUCTIONFlyyEnvironment.PRODUCTION or STAGE.
user—Your user id. Same as calling setUser.
userToken—Token from your backend. Wins over user.
themeColorpartner defaultPrimary brand color, e.g. "#7C3AED".
uiVariantpartner defaultVisual style of the rewards UI.
segmentId—Segment for this user.
floatingWidgetsfalseShow dashboard-configured bubbles on your screens. See Floating widgets.
matchHostThemetrueRead your app's colors, fonts and shapes. See Theming.
hostTheme—Manual theme overrides, e.g. mapOf("colors.primary" to "#C2138F").
pushToken—An FCM token you already have.
prewarmtrueKeep a hidden WebView ready for an instant first open.
otaEnabledtrueDownload newer rewards UI builds. See OTA.
sdkUrlFlyy hostedServe the rewards UI from your own origin.
extras—Extra key/values passed to the rewards UI.
onUiEvent { }—Called for every rewards UI activity event.
onClosed { }—Called when the user closes the full-screen SDK.

Environments​

EnvironmentUse it for
STAGEDevelopment and QA. Uses your staging campaigns and test wallet.
PRODUCTIONRelease builds. Real rewards and payouts.
tip

Choose the environment from your build type so a debug build can never pay out real rewards: environment = if (BuildConfig.DEBUG) FlyyEnvironment.STAGE else FlyyEnvironment.PRODUCTION