Pre-built iOS SDK for integrating in-game payments into your app via Xsolla Pay Station.
See exactly how payments work before writing a single line of code. The SDK Explorer lets you walk through authentication, catalog loading, purchasing, and finalization — all in an interactive environment.
- SDK Explorer — interactive demo
- SDK Documentation — full integration guide
- Demo App — sample project
Xsolla Mobile SDK provides a StoreKit-compatible API for in-game purchases via Xsolla Pay Station. It mirrors Apple's StoreKit patterns (SKPaymentQueue, SKProduct, SKPaymentTransaction) so integration feels familiar to iOS developers.
Key features:
- 1000+ payment methods across 200+ geographies
- 130+ currencies including local and alternative payment methods
- Built-in anti-fraud protection
- 25+ languages supported out of the box
- Player authentication (Xsolla Login widget, social login, custom tokens)
- Product catalog and virtual items
- Buy Button and Web Shop integration
- iOS 12.0+
- Xcode 16.4+
- Swift 5.9+
- In Xcode, go to File > Add Package Dependencies...
- Enter the repository URL:
https://github.com/xsolla/xsolla-sdk-ios.git - Select the version rule (e.g., Up to Next Major Version)
- Click Add Package
Add the dependency to your Package.swift:
dependencies: [
.package(url: "https://github.com/xsolla/xsolla-sdk-ios.git", from: "3.8.0")
]Then add "XsollaMobileSDK" to your target's dependencies:
.target(
name: "YourApp",
dependencies: [
.product(name: "XsollaMobileSDK", package: "xsolla-sdk-ios")
]
)Configure the SDK with your project credentials, start the payment queue, and register a transaction observer:
import XsollaMobileSDK
let settings = SKPaymentSettings(projectId: 301871,
loginProjectId: "dfcb133b-6d0b-4937-b8d2-c4f4d58fb53a")
settings.useSandbox = true
settings.openExternalBrowser = true
SKPaymentQueue.default().start(settings)
SKPaymentQueue.default().add(self) // conforms to SKPaymentTransactionObserverQuery your product catalog by SKU:
let skus: Set<String> = ["ticket.10", "ticket.20", "ticket.30", "pack.starter", "pack.premium", "pack.vip", "money.100", "money.200", "money.300"]
let request = SKProductsRequest(productIdentifiers: skus)
request.delegate = self
request.start()
// Conform to SKProductsRequestDelegate
extension YourClass: SKProductsRequestDelegate {
func productsRequest(_ request: SKProductsRequest, didReceive response: SKProductsResponse) {
self.products = response.products
}
}Use the product from your catalog to launch a purchase via Pay Station:
let product = products.first!
let payment = SKPayment(product: product)
SKPaymentQueue.default().add(payment)Handle completed transactions in your SKPaymentTransactionObserver and finish each one:
extension YourClass: SKPaymentTransactionObserver {
func paymentQueue(_: SKPaymentQueue, updatedTransactions: [SKPaymentTransaction]) {
for transaction in updatedTransactions {
switch transaction.transactionState {
case .purchased:
// Award the product to the user
SKPaymentQueue.default().finishTransaction(transaction)
case .failed:
// Handle error
SKPaymentQueue.default().finishTransaction(transaction)
default:
break
}
}
}
}For the full integration guide, see the SDK Documentation.
- GitHub Issues: github.com/xsolla/xsolla-sdk-ios/issues
- Developer portal: developers.xsolla.com
Apache 2.0 License. See LICENSE.
