Track events
Campaigns reward events: an order, a top-up, a completed KYC. Send one line where the event happens. The key must match an event set up on your dashboard.
- Android
- iOS
Flyy.sendEvent("order_completed", "499")
Flyy.sendEvent("kyc_done", "1")
Flyy.sendEvent("profile", JSONObject(mapOf("tier" to "gold")))
// with confirmation:
Flyy.sendEvent("order_completed", "499") { /* delivered */ }
Flyy.sendEvent("order_completed", value: "499")
Flyy.sendEvent("profile", json: ["tier": "gold"])
// with confirmation:
Flyy.sendEvent("order_completed", value: "499") { ok in /* delivered */ }
Events are queued and retried while offline (WorkManager on Android, a persisted queue on iOS), so it is safe to send from any code path.
Client events vs server events
| Send from | Use for |
|---|---|
The app (sendEvent) | Engagement: screen visits, feature use, streaks. |
| Your backend (Flyy partner API) | Anything that pays real money or must not be faked: orders, payments, deposits. |
warning
A client event can be faked by a modified app. For transactions, your server must be the source of truth.
Analytics events
trackEvent sends to your extra-events pipeline (the extra_events_base_url in
your app config), not to campaigns. If that URL isn't set, the event is dropped
with a log line.
Flyy.trackEvent("banner_seen", "home_top")
Listening to the rewards UI
- Android
- iOS
Flyy.start(this) {
partnerId = "…"
onUiEvent { event -> analytics.log(event.actionEventName, event.campaignID) }
onClosed { refreshBalance() }
}
Flyy.sharedInstance.delegate = self // FlyySDKClosedListener and other v1 listeners