Identify users
Rewards belong to a user, so identify the user as soon as you know who they are. Before that, the SDK tracks the device as an anonymous visitor, and that history is linked to the user when you identify them.
Returning users
- Android
- iOS
Flyy.setUser("user-1001")
Flyy.setUser("user-1001", "segment-premium") // with a segment
Flyy.setUser("user-1001") { ok -> /* identified */ }
Flyy.setUser("user-1001")
Flyy.setUser("user-1001", segmentId: "segment-premium")
Flyy.setUser("user-1001") { ok in /* identified */ }
New signups
Use the new-user call so signup campaigns and referrals trigger. To credit a
referrer as well, use setUserWithReferralCode — see Referrals.
- Android
- iOS
Flyy.setNewUser("user-1001")
Flyy.setNewUser("user-1001")
Recommended: server-issued tokens
:::warning Production apps Don't identify users with a plain user id in production. Anyone who knows an id could act as that user. Have your backend exchange the id for a user token using the Flyy partner API, return the token to the app, and pass it to the SDK. :::
- Android
- iOS
Flyy.setUserToken(tokenFromYourBackend) // returning user
Flyy.setNewUserToken(tokenFromYourBackend) // new signup
// or at start:
Flyy.start(this) { partnerId = "…"; userToken = tokenFromYourBackend }
Flyy.setUserToken(tokenFromYourBackend)
Flyy.setNewUserToken(tokenFromYourBackend)
Profile details
Optional. Shown on leaderboards and used for payouts.
- Android
- iOS
Flyy.loginUser("user-1001", "Asha Rao") // identify + name in one call
Flyy.setUsername("Asha Rao")
Flyy.setDisplayName("Asha")
Flyy.setContactNumber("+919800000000")
Flyy.addUserToSegment("Premium", "premium")
Flyy.loginUser("user-1001", userName: "Asha Rao")
Flyy.setUsername("Asha Rao")
Flyy.setDisplayName("Asha")
Flyy.setContactNumber("+919800000000")
Flyy.addUserToSegment(title: "Premium", key: "premium")
Sign-out
- Android
- iOS
Flyy.logout()
Flyy.logout()
What happens after you identify
Each successful identify does the same three things on both platforms:
- refreshes app info (campaigns, theme, placements for this user's segments),
- checks for pending scratch cards and shows the scratch popup if there is one,
- re-sends the push token so notifications reach this user.
Failed calls are queued and retried while offline. Completion callbacks run only on a real success — never on failure, and never before init.