Skip to main content

iOS SDK Swift 5.0

Offer Scan & Go to your customers in your own iOS App with this SDK. Our iOS SDK supports the entire range of Snabble base functionality including onboarding, scanning, product lists, promotions, payment and shops.

The SDK covers the whole communication with the Snabble Cloud-Platform and provides you with UI elements for your app that are easy to use and customize, so that you simplify the integration of Scan & Go into your app significantly.

The Documentation of the Snabble iOS SDK is currently available at github.com/snabble/snabble-ios-sdk.

Requirements

  • iOS 14.0 or above
  • Xcode 12.5 or above

Installing from Xcode

Starting with the 0.22.2 release, Snabble officially supports installation via Swift Package Manager.

Prior to version 0.22.2 only Cocoapods is supported

Add a package by selecting FileAdd Packages… in Xcode’s menu bar.

Search for the Snabble Apple SDK using the repo's URL:

https://github.com/snabble/snabble-ios-sdk.git

Next, set the Dependency Rule to be Up to Next Major Version and specify 0.22.2 as the lower bound.

Then, select Add Package.

Choose the Snabble products that you want installed in your app.

Alternatively, add Firebase to a Package.swift manifest

To integrate via a Package.swift manifest instead of Xcode, you can add Firebase to the dependencies array of your package:

dependencies:[
.package(
name: "Snabble",
url: "https://github.com/snabble/snabble-ios-sdk.git",
.upToNextMajor(from: "0.22.2")
)
]

Then, in any target that depends on a Firebase product, add it to the dependencies array of that target:

.target(
name: "MyTargetName",
dependencies: [
// The product(s) you want (e.g. SnabbleCore).
.product(name: "SnabbleCore", package: "Snabble"),
]
)

Optional components

In order to use the twint and postFinanceCard payment methods, you will also need to include 'SnabbleDatatrans' as package in your app. During the app's initialization phase you will then need to call DatatransFactory.initialize() with your app's registered URL scheme to make these methods available.

Note that support for these payment methods also requires changes to your app's Info.plist as described in Datatrans' SDK documentation, as well as adding a URL scheme that can be used to pass data back to your app, e.g. by adding

<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>

Versioning

Snabble follows semantic versioning rules. Note that we are currently in initial development, with major version 0. Anything may change at any time.

Sample App

The sample app contains the basic skeleton for creating an iPhone app. It shows an example onboarding, a dashboard with buttons to share the current location, display of supported stores, the product scanner with shopping cart and a profile page.

Visit iOS Sample App on Github.