Configure and initialize the SDK:

Configure the SDK

The iOS Mobile Checkout SDK exposes a ConfigModel. Create an instance with the following arguments:

let config = ConfigModel(
    checkoutPublicKey: "{YOUR_CHECKOUT_PUBLIC_KEY}",
    environment: "sandbox",
)
ArgumentTypeRequired?Description
checkoutPublicKeystringYesThe checkout public key, located in the Publisher Dashboard. In the sidebar menu, click Settings, then select the Integration tab. Copy the Checkout Public Key value.
environmentstringYesThe checkout environment.
One of:
- sandbox: For testing.
- production: For live operations.

Initialize the SDK

To initialize the SDK, call the method below on application load or as soon as it’s ready. We recommend calling it within the viewDidLoad lifecycle method, using the ConfigModel instance:

import ACCheckoutSDK
class ViewController: UIViewController {
    override func viewDidLoad() {
        super.viewDidLoad()
        
        // Set your checkout token and environment
        let config = ACConfigModel(
            checkoutPublicKey: "{YOUR_CHECKOUT_PUBLIC_KEY}",
            environment: "sandbox"
        )

        // Initialize the SDK
        ACBridgeAPI.initialize(configModel: config, customerId: "{PLAYER_ID}")

        // Set the callback delegate 
        ACBridgeAPI.delegate = self
    }
}