https://github.com/Sovendus-GmbH/sovendus-sdk-iosSovendusSDK folder into your Xcode project.let config = SovendusConfig( trafficSourceNumber: 1234, trafficMediumNumber: 5678, consumerData: nil, orderData: nil, sandbox: true, // Omit or set to false for production
import SwiftUI import SovendusSDK struct ContentView: View { private let config = SovendusConfig( trafficSourceNumber: 1234, trafficMediumNumber:
import UIKit import SwiftUI import SovendusSDK class ViewController: UIViewController { private lazy var config = SovendusConfig( trafficSourceNumber:
list.template.layoutId):| Layout ID | Style | Description |
|---|---|---|
1 | Horizontal Slider | Swipeable pager with page indicators (default) |
2 | Vertical List | Cards stacked vertically |
banner.template.layoutId):| Layout ID | Style | Description |
|---|---|---|
1 | Inline Banner | Compact horizontal layout with image and text (default) |
2 | Card Banner | Centered vertical layout with larger image |
VoucherBenefitsView instance with a different SovendusConfig (unique trafficMediumNumber) triggers its own API callVoucherBenefitsView instances with different configurations. Each instance triggers its own API call, allowing Sovendus to control content and layout per placement:// Placement 1 - e.g. checkout page VoucherBenefitsView( config: SovendusConfig( trafficSourceNumber: 1234, trafficMediumNumber: 100, consumerData: consumerData, orderData: orderData ) )
let consumerData = ConsumerData( salutation: .mr, firstName: "Max", lastName: "Mustermann", email: "customer@example.com", country: "DE", zipCode
let productionConfig = SovendusConfig( trafficSourceNumber: 1234, // Your real TSN from Sovendus trafficMediumNumber: 5678, // Your real TMN from Sovendus consumerData: consumerData, orderData: orderData, sandbox: false,
trafficSourceNumber and trafficMediumNumber from Sovendussandbox: false for production behaviorenableDebugLogs: false to disable debug outputprivate func handleSovendusState(_ state: SovendusState) { switch state { case .loading: // Show loading indicator if needed print("Loading Sovendus content...") case
let config = SovendusConfig( trafficSourceNumber: 1234, trafficMediumNumber: 5678, consumerData: consumerData, orderData: orderData, onLinkOpened: { url in // optional: Custom link handling - useful for:
import SafariServices let config = SovendusConfig( trafficSourceNumber: 1234, trafficMediumNumber: 5678, consumerData: consumerData, orderData: orderData, onLinkOpened: { url
onLinkOpened is not provided, the SDK uses UIApplication.shared.open(url) to open links in the system browser.UIFont:let config = SovendusConfig( trafficSourceNumber: 1234, trafficMediumNumber: 5678, consumerData: consumerData, orderData: orderData, customFont: UIFont(name: "YourCustomFont-Regular",
.ttf or .otf) to your Xcode projectUIAppFonts (Fonts provided by application):<key>UIAppFonts</key> <array> <string>YourCustomFont-Regular.ttf</string> <string>YourCustomFont-Bold.ttf</string> </array>
// Create a custom font with the PostScript name let customFont = UIFont(name: "YourCustomFont-Regular", size: 14) // You can also use font descriptors for more control let descriptor = UIFontDescriptor(name: "YourCustomFont", size:
UIFont(name:size:) is the PostScript name, which may differ from the filename. You can find it by:UIFont.familyNames.forEach { print(UIFont.fontNames(forFamilyName: $0)) }// Define font helpers extension UIFont { static var appFontRegular: UIFont? { UIFont(name: "Poppins-Regular", size: 14) }
customFont is not provided or is nil, the SDK uses the system font.# Check device logs for production errors # Use Xcode Console or device logs # Look for SovendusSDK related messages
struct CheckoutSuccessView: View { @State private var showBenefitsModal = false var body: some View { VStack { Text(
class CheckoutSuccessViewController: UIViewController { private var benefitsViewController: UIViewController? @IBAction func showBenefitsPressed(_ sender: UIButton) { let
enableDebugLogs: trueSovendusSDK in your files