Skip to main content

Step 1: Include the library in your project

CocoaPods

Add the following line to your Podfile:
pod 'YunoSDK', '~> 1.1.22'

Swift Package Manager

Add YunoSDK as a dependency:
.package(url: "https://github.com/yuno-payments/yuno-sdk-ios.git", .upToNextMajor(from: "1.1.17"))

Step 2: Initialize SDK

Initialize the SDK with your Public API Key:
import YunoSDK

Yuno.initialize(
    apiKey: "PUBLIC_API_KEY",
    config: YunoConfig(),
    callback: { (value: Bool) in }
)

Step 3: Adopt YunoPaymentDelegate

Adopt the YunoPaymentDelegate protocol:
Swift 6 Concurrency RequirementsIf you’re using Swift 6, you’ll need to implement the YunoPaymentDelegate protocol with specific concurrency considerations. See the Swift 6 Concurrency guide for detailed implementation options and best practices.
class ViewController: UIViewController, YunoPaymentDelegate {
    var checkoutSession: String { "checkout_session" }
    var countryCode: String { "US" }
    var viewController: UIViewController? { self }

    func yunoCreatePayment(with token: String) {
        // Call your backend to create a payment
    }

    func yunoPaymentResult(_ result: Yuno.Result) {
        // Handle final payment state
    }
}

Step 4: Initiate the payment process

startPaymentLite(
    with: self,
    paymentSelected: paymentSelected,
    showPaymentStatus: true
)

Step 5: Continue payment (Required)

If sdk_action_required: true is returned by the API, call:
Yuno.continuePayment()
Demo AppSee the Yuno iOS SDK repository for full implementation examples.