Skip to main content

iOS API

Everything is static on Flyy. The v1 API lives on Flyy.sharedInstance ([Flyy sharedFlyyInstance] in Objective-C) — see migration.

Setup​

APIDescription
initialize(_ config: FlyyConfig)Initialize. Options.
prewarm() · recyclePrewarm()Prepare a hidden WebView for an instant open.
setThemeColor(_:) · setUiVariant(_:)Theme and UI variant.
setSegmentId(_:) · getSegmentId()Segment.
setBaseFlyyDomain(_:) · setBaseStageFlyyDomain(_:)API domain overrides.

Identity​

APIDescription
setUser(_:segmentId:completion:)Returning user.
setNewUser(_:segmentId:completion:)New signup.
setUserToken(_:) · setNewUserToken(_:)Server-issued token. Recommended.
setUserWithReferralCode(_:completion:)New signup + credit the referrer.
loginUser(_:userName:completion:)Identify with a display name.
setUsername · setDisplayName · setContactNumberProfile fields.
addUserToSegment(title:key:)Add to a segment.
logout()Clear identity.
getAnonymousId()Visitor id used before identify.

Referrals​

APIDescription
startReferralTracking(userActivity:onComplete:)Install attribution.
setReferrerCode(_:) · getReferrerCode()Referral code.
getReferrerLink(onComplete:)Share link.

Events​

APIDescription
sendEvent(_:value:completion:) · sendEvent(_:json:completion:)Campaign event. Queued offline.
trackEvent(_:value:completion:)Analytics pipeline event.

Screens​

APIDescription
open(from:screen:deepPath:)Full-screen SDK.
open(path:query:from:)Any path; presenter optional.
handleDeeplink(_:from:)Paths, flyy://, URLs, v1 screen names.
navigateToRewards · navigateToWallet · navigateToReferAndEarn · navigateToSpinWheel · navigateToMilestones · openInbox · …Shortcuts; from: optional.
closeSdk(from:)Dismiss the SDK.

Embeds and placements​

APIDescription
FlyyEmbedView · load(_:) · loadPath(_:) · onCta · onStateEmbeds.
FlyyEmbed(_:onState:onCta:) · FlyyEmbedPage(_:)SwiftUI embeds.
FlyyPlacementView(slot:) · FlyySlot(_:) · FlyyStories(slot:)Inline placements.
.flyyTarget(_:) · .flyyAnchor(_:)SwiftUI targets and anchors.
registerAnchor(_:view:) · unregisterAnchor(_:)UIKit anchors.
showPlacement(_:) · showNudge(_:) · showDynamicIsland(_:) · dismissPlacements()Manual triggers.
setCurrentScreen(_:)Name a route for targeting.
showFloatingWidget(_:) · hideFloatingWidget() · setFloatingWidgetEnabled(_:) · refreshFloatingWidgets()Floating widgets.
floatingWidgetListener · floatingCtaHandlerFloating widget callbacks.

Push and popups​

APIDescription
handlePush(_:)true if the payload was Flyy's.
syncPushToken(_:)FCM registration token.
FlyyNotifications.handleTap(_:presenter:) · .handleForeground(_:) · .isFlyyNotification(_:)Notification center hooks.
FlyyPopups.showRewardWonPopup · .showRewardWonScratchPopup · .showPopup · .showToastAlertPopups over your app.

OTA​

APIDescription
getOtaVersion()Version being served.
checkForOtaUpdate(_:)Force a check.