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
| Method | Description |
|---|---|
start(context) { … } | Initialize + identify in one idempotent call. Options. |
init(context, partnerId, environment) | Explicit init, e.g. from Application. |
STAGE, PRODUCTION | Environment 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
| Method | Description |
|---|---|
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 · setContactNumber | Profile fields. |
addUserToSegment(title, key) | Add to a segment. |
logout() | Clear identity. |
getAnonymousId(context) | Visitor id used before identify. |
Referrals
| Method | Description |
|---|---|
setReferrerCode(code) · getReferrerCode() | Captured or injected referral code. |
getReferrerDetails(context, listener) | Who referred this user. |
verifyReferralCode(…) · getReferralCount(…) · getShareData(…) | Referral data. |
Events
| Method | Description |
|---|---|
sendEvent(key, String | JSONObject[, callback]) | Campaign event. Queued offline. |
trackEvent(key, String | JSONObject[, callback]) | Analytics pipeline event. |
Screens
| Method | Description |
|---|---|
open(context[, screen][, query]) | Full-screen SDK. |
open(context, deepPath = "offers/12") | Any path. |
openRewards · openWallet · openReferrals · openSpin · openMilestones · openInbox | Shortcuts. |
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
| API | Description |
|---|---|
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
| Method | Description |
|---|---|
handlePush(data) | true if the message was Flyy's. |
syncPushToken(token) | FCM token. |
FlyyMessagingService | Drop-in messaging service. |
showRewardWonPopup(…) · showRewardWonScratchPopup(…) · showPopup(…) · showToastAlert(…) | Popups over your app. |
Data
| Method | Description |
|---|---|
getWalletBalance(context, label, listener) | Wallet balance. |
getOffersCount(…) | Live offer count. |
getScratchCardCount(…) | Scratch card counts. |
getLeaderboardParticipants(…) · getPreviousLeaderboardWinners(…) | Leaderboards. |
checkAppInfo() | Refresh app config. |
OTA
| Method | Description |
|---|---|
getOtaVersion() | Version of the rewards UI being served. |
checkForOtaUpdate(callback) | Force a check. |