UI Module

Presentation

SwiftUI

A View extension exists which presents the lucra flows as a fullScreenCover. All you need to do is create a State var and set the appropriate flow when it needs to be launched. This allows the SDK to control all presentation logic.

@State private var currentLucraFlow: LucraFlow?
...
.lucraFlow($currentLucraFlow, client: lucraClient)

UIKit

A UIViewController extension exists which presents the lucra flows as modalPresentationStyle = .fullScreen. This allows the SDK to control all presentation logic.

self.present(lucraFlow: .profile, client: lucraClient, animated: true)

LucraFlow

Provides an easy to use enum to present each of the supported flows

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 sportsContestDetails(matchupId: String)
    case gamesMatchupDetails(matchupId: String)
    case myMatchups
    case matchupDetails(matchupId: String)
    case tournamentDetails(matchupId: String)
}

Gatekeeping Flows

These flows can be presented manually early on depending on your use case or they will be automatically presented as required when presenting Functionality Flows

Onboarding - Presents phone number authentication flow to the user

Verify Identity - Presents KYC (Know Your Customer) flow to verify the user's identity. Required to take any monetary actions.

Functionality Flows

These are the core flows to present to the user.

Profile - Presents the users profile screen including active contests, user stats, add/withdraw funds, and additional items such as contacting support

Add Funds - Presents flow to add funds to the user's wallet

Withdraw Funds - Presents flow to withdraw from the user's wallet

Create Games Matchup - Presents flow to create a Games You Play contest

Games Contest Details - Presents the selected Games Matchup by ID, with optional team invite ID.

MyMatchups - Presents all the historical matchups for the current user.

Please see the Testing page to find the information and instructions for a dummy credit card/bank account that can be used for deposits.

Last updated