Lucra Flows (iOS)

Lucra Flows (iOS)

Lucra Flows are full‑screen SwiftUI or UIKit experiences that encapsulate entire user journeys: onboarding, KYC, funding, contest creation, matchup details, tournament details, and more.

Your app triggers Lucra flows; Lucra handles UI, navigation, validation, and backend communication.


🎯 Why Lucra Flows?

  • No need to build complex regulated UI

  • Ensures legal & compliance correctness

  • Keeps your app lightweight

  • Automatically updates with new product features

You present a flow, Lucra handles the rest.


🧩 The LucraFlow Enum

public enum LucraFlow: Int, Identifiable {
    public var id: Int { rawValue }

    case onboarding
    case verifyIdentity
    case addFunds
    case withdrawFunds
    case createGamesMatchup(gameId: String? = nil, location: String? = nil)
    case createSportsMatchup
    case profile
    case publicFeed
    case sportsContestDetails(matchupId: String)
    case gamesMatchupDetails(matchupId: String)
    case myMatchups
    case matchupDetails(matchupId: String)
    case tournamentDetails(matchupId: String)
    case demographicCollection
    case wallet
    case homePage(location: String?)
}

Every flow is presented full screen.


🎬 Presenting Lucra Flows β€” SwiftUI

Use the .lucraFlow view modifier:

Setting flow = .profile β†’ opens Lucra’s Profile UI. Setting flow = nil β†’ dismisses Lucra.


🎬 Presenting Flows β€” UIKit

Lucra takes over presentation with modalPresentationStyle = .fullScreen.


πŸ”™ Close Button - Conditional Navigation

The LucraUI flow components have an additional parameter called hideCloseButton that allows you to hide or show the close button for the given navigational flow.

lucraClient.ui.flow(.createGamesMatchup(gameId: nil, location: nil), hideCloseButton: true)

Setting this value to true will hide the X button present in the screen, and allow you to dismiss the view based on other logic such as reacting to Events.

🚦 Automatic Gatekeeping Flows

The flows provided by the LucraSDK will automatically route the user to certain screens based on the state of their account. For example, if you invoke the .addFunds flow without the user being logged in, they will be automatically redirected to the login screen.

🧭 Common Flows

Onboarding

Routes the user to the onboarding experience.

Verify Identity

Routes the user to the identity verification flow.

Demographic Collection

Routes the user to the demographic collection form flow.

Wallet

Routes the user to the wallet, which is a slimmer version of the Profile with basic funds-related functionality.

Add Funds

Routes the user to the Add Funds flow

Withdraw Funds

Routes the user to the Add Funds flow

Create GYP Matchup

Routes the user to the Add Funds flow The gameId parameter is used for recrational games, it's used to determine which recreational game to create and is optional. The location parameter is used for tournaments, it determines which location to fetch tournaments from for the landing screen.

Create Sports Matchup

Routes the user to the Create Sports Matchup flow.

Sports Contest Details

A flow that brings the user to the Sports Contest Details flow.

The matchupId parameter is the ID of the matchup to fetch.

Games Matchup Details

A flow that brings the user to the details of a Games matchup.

The matchupId parameter is the ID of the matchup to fetch.

Tournament Details

A flow that routes the user to the details of a given Tournament.

The matchupId parameter is the ID of the matchup to fetch.

My Matchups

A flow that routes the user to the list of all of their matchups.

Matchup Details

A flow that routes the user to the details of their matchup, without needing to specify its given type.

The matchupId parameter is the ID of the matchup to fetch.

Profile

Routes the user to the Profile flow.

Public Feed

Routes the user to the Public Feed flow.

Home Page

Routes the user to the Home Page flow, where they can browse available tournaments and games.

The location parameter represents the ID of the user’s current location. Pass nil to allow the user to select a location from a list.


πŸ§ͺ Handling Completion & Navigation

Lucra completes flows internally. Dismissal is automatic when user closes the UI.

To track events, use:

Lucra Event Listener

Lucra Event Listenerarrow-up-right

  • Combine subscription: client.$event


βœ”οΈ Integration Checklist

Lucra Flows integration is complete.

Last updated