iOS SDK 
Offer Scan & Go to your customers in your own iOS app with this SDK. The Snabble iOS SDK is built with Swift 6 and SwiftUI and supports the entire range of Snabble base functionality including scanning, shopping cart, promotions, payment, shops and receipts.
The SDK covers the whole communication with the Snabble Cloud-Platform and provides you with ready-to-use SwiftUI views, so that the integration of Scan & Go into your app is reduced to a few lines of code. See Getting Started for a minimal integration.
- Source code: github.com/snabble/snabble-ios-sdk
- API reference: snabble.github.io/snabble-ios-sdk
Requirements
- iOS 17.0 or later
- Xcode 27.1 or later (the iOS 27.1 SDK is required to build)
- Swift 6.3 or later
Installation
The SDK is distributed via Swift Package Manager.
Xcode
Select File → Add Package Dependencies… in Xcode's menu bar and enter the repository URL:
https://github.com/snabble/snabble-ios-sdk.git
Set the Dependency Rule to Up to Next Major Version starting from 1.0.0, then select the products you need, e.g. SnabbleScanAndGo.
Package.swift
dependencies: [
.package(
url: "https://github.com/snabble/snabble-ios-sdk.git",
.upToNextMajor(from: "1.0.0")
)
]
Add the desired products to your target:
.target(
name: "MyApp",
dependencies: [
.product(name: "SnabbleScanAndGo", package: "Snabble"),
]
)
The product Snabble contains the complete SDK for convenience.
Modules
The SDK is organized into five layers with no circular dependencies. Each module can be added individually.
| Module | Layer | Purpose |
|---|---|---|
SnabbleCore | Foundation | Business logic, data models, cart management, offline product database |
SnabbleNetwork | Foundation | API communication and authentication |
SnabbleAssetProviding | Foundation | Theming and asset management |
SnabbleComponents | UI Primitives | Reusable SwiftUI components |
SnabbleTheme | UI Primitives | Asset management with Core integration |
SnabbleShops | Domain Features | Shop list and shop details |
SnabbleCart | Domain Features | Shopping cart UI |
SnabbleUser | Domain Features | User management |
SnabbleReceipts | Domain Features | Receipt display and local archiving |
SnabblePayment | Payment | Payment processing with multiple provider support |
SnabbleScanAndGo | Complete Flows | Complete Scan & Go workflow (Shopper, ShopperView) |
SnabblePhoneAuth | Complete Flows | Phone-number-based OTP authentication |
SnabbleCoupons | Complete Flows | Coupon display and activation |
SnabbleTeaser | Complete Flows | Promotional teaser cards from backend config |
SnabbleOnboarding | Complete Flows | Paged onboarding flow configured via JSON |
Details for each module are available in the API reference and in the module READMEs on GitHub.
Optional: Datatrans (Twint, PostFinance)
In order to use the twint and postFinanceCard payment methods, add the SnabbleDatatrans product to your app. During the app's initialization phase call DatatransFactory.initialize(appCallbackScheme:) with your app's registered URL scheme to make these methods available.
Support for these payment methods also requires changes to your app's Info.plist as described in the Datatrans SDK documentation, as well as a URL scheme that can be used to pass data back to your app:
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string>YOUR_URL_NAME_HERE</string>
<key>CFBundleURLSchemes</key>
<array>
<string>YOUR_URL_SCHEME_HERE</string>
</array>
</dict>
</array>
Sample Apps
The repository contains two sample apps, both running against the staging environment with demo credentials:
- MinimalScanAndGo – one screen, two files. The smallest possible Scan & Go integration, ideal for getting started.
- SwiftySnabble – a complete SwiftUI app with multi-tab navigation, onboarding, shops, receipts and payment methods.
git clone https://github.com/snabble/snabble-ios-sdk
cd snabble-ios-sdk
open Snabble.xcworkspace
Versioning
Snabble follows semantic versioning rules. See the changelog for details on each release.