Status
The Status card displays the user's current Flex status and opens the Embedded Checkout when tapped.
Initialization
Display the Status card by adding a FlexStatusCard SwiftUI view with a configuration. StatusCardConfig takes no options.
Swift
import FlexCheckout
FlexStatusCard(config: StatusCardConfig())
info
When the Status card CTA is tapped, it will automatically call openCheckout(). Make sure you have registered a token provider with loadToken and configured checkout callbacks with sdk.checkout() before displaying the card.
Swift
let sdk = Flex.initialize(config: FlexConfig(
clientId: "your-flex-client-id"
))
sdk.loadToken {
let response = try await yourApi.getFlexToken()
return response.token
}
sdk.checkout(CheckoutConfig(
onEvent: { event in }
))
Next Steps
- Configure Checkout callbacks to handle events and errors
- Review the Installation guide for lifecycle management and error handling