iOS Integration
Integrate the Marketfront SDK into your iOS app using the native Swift package.
Coming Soon
The Marketfront SDK for iOS (GettMarketfront) is currently in development.
Contact your partner manager for early access.
All integrations require a session token created by your backend. See Sessions for details.
Expected Features
Installation
Swift Package Manager support:
dependencies: [
.package(url: "https://github.com/gett-tech/marketfront-ios.git", from: "1.0.0")
]
UIKit Integration
import GettMarketfront
class OrderViewController: UIViewController {
private var marketfront: MarketfrontView?
private var sessionToken: String // From your backend
override func viewDidLoad() {
super.viewDidLoad()
marketfront = MarketfrontView(sessionToken: sessionToken)
marketfront?.delegate = self
marketfront?.frame = view.bounds
view.addSubview(marketfront!)
}
}
extension OrderViewController: MarketfrontDelegate {
func marketfrontDidBecomeReady(_ marketfront: MarketfrontView) {
// SDK is ready
}
func marketfront(_ marketfront: MarketfrontView, didCompleteOrder order: Order) {
// Handle completed order
}
}
SwiftUI Integration
import SwiftUI
import GettMarketfront
struct OrderView: View {
let sessionToken: String // From your backend
var body: some View {
MarketfrontView(sessionToken: sessionToken)
.onOrderComplete { order in
// Handle completed order
}
}
}
Event Handling
protocol MarketfrontDelegate: AnyObject {
func marketfrontDidBecomeReady(_ marketfront: MarketfrontView)
func marketfront(_ marketfront: MarketfrontView, didFailWithError error: MarketfrontError)
func marketfront(_ marketfront: MarketfrontView, didSelectStore store: Store)
func marketfront(_ marketfront: MarketfrontView, didAddItem item: CartItem)
func marketfront(_ marketfront: MarketfrontView, didStartCheckout checkout: Checkout)
func marketfront(_ marketfront: MarketfrontView, didCompleteOrder order: Order)
func marketfront(_ marketfront: MarketfrontView, orderDidFail error: OrderError)
}
Theming and configuration options are managed via the Partner Dashboard—see the Feature Comparison for what's configurable.