Skip to main content

Android API

Everything is on the com.theflyy.sdk.Flyy object. Every entry point is @JvmStatic, so Java calls look the same: Flyy.sendEvent("order", "499");.

Setup​

MethodDescription
start(context) { … }Initialize + identify in one idempotent call. Options.
init(context, partnerId, environment)Explicit init, e.g. from Application.
STAGE, PRODUCTIONEnvironment constants.
setThemeColor(hex) · setThemeColors(map)Brand colors.
setUiVariant(variant) + recyclePrewarm()Switch UI variant at runtime.
setMatchHostTheme(bool) · setHostTheme(map)Theme matching.
setBaseFlyyDomain(host) · setBaseStageFlyyDomain(host)API domain overrides.

Identity​

MethodDescription
setUser(uid[, segmentId][, callback])Returning user.
setNewUser(uid[, segmentId][, callback])New signup.
setUserToken(token) · setNewUserToken(token)Server-issued token. Recommended.
setUserWithReferralCode(uid[, callback])New signup + credit the referrer.
loginUser(uid, name[, listener])Identify with a display name.
setUsername · setDisplayName · setContactNumberProfile fields.
addUserToSegment(title, key)Add to a segment.
logout()Clear identity.
getAnonymousId(context)Visitor id used before identify.

Referrals​

MethodDescription
setReferrerCode(code) · getReferrerCode()Captured or injected referral code.
getReferrerDetails(context, listener)Who referred this user.
verifyReferralCode(…) · getReferralCount(…) · getShareData(…)Referral data.

Events​

MethodDescription
sendEvent(key, String | JSONObject[, callback])Campaign event. Queued offline.
trackEvent(key, String | JSONObject[, callback])Analytics pipeline event.

Screens​

MethodDescription
open(context[, screen][, query])Full-screen SDK.
open(context, deepPath = "offers/12")Any path.
openRewards · openWallet · openReferrals · openSpin · openMilestones · openInboxShortcuts.
handleDeeplink(context, link)Paths, flyy://, URLs, v1 screen names.
deeplinkListener(enable, listener)Take over links to your own screens.
navigateTo…Activity(…)Every v1 navigation method — see migration.

Embeds and placements​

APIDescription
FlyyEmbedView · load(widget | screen) · loadOffer(id) · release()Embeds.
FlyyEmbed(…) · rememberFlyyEmbedNavigator()Compose embeds.
FlyyPlacementView · FlyySlot(id) · FlyyStories(slot)Inline placements.
FlyyTarget(id) { }"Next to an element" in Compose.
registerAnchor(id, view) · unregisterAnchor(id)Anchored placements.
showPlacement(id) · showNudge(id) · showDynamicIsland(id) · dismissPlacements()Manual triggers.
setCurrentScreen(name)Name a route for targeting.
showFloatingWidget(id) · hideFloatingWidget() · setFloatingWidgetEnabled(bool) · refreshFloatingWidgets()Floating widgets.

Push and popups​

MethodDescription
handlePush(data)true if the message was Flyy's.
syncPushToken(token)FCM token.
FlyyMessagingServiceDrop-in messaging service.
showRewardWonPopup(…) · showRewardWonScratchPopup(…) · showPopup(…) · showToastAlert(…)Popups over your app.

Data​

MethodDescription
getWalletBalance(context, label, listener)Wallet balance.
getOffersCount(…)Live offer count.
getScratchCardCount(…)Scratch card counts.
getLeaderboardParticipants(…) · getPreviousLeaderboardWinners(…)Leaderboards.
checkAppInfo()Refresh app config.

OTA​

MethodDescription
getOtaVersion()Version of the rewards UI being served.
checkForOtaUpdate(callback)Force a check.