iOS integration

Check out our iOS SDK.

The Unzer SDK for iOS is shipped as a binary framework. This guide shows you how to integrate the framework in your iOS project.

iOS Project Requirements
The Unzer iOS framework is written in Swift and supports iOS 10.x and higher. If you want to integrate the framework in an Objective-C project consider adding a Swift layer to interact with the framework. If that is not an option or if you have to support an earlier iOS version please get in contact with the technical support. We are happy to help.

1. Adding the Unzer framework to your project

Integrating the Unzer iOS framework in your project requires a couple of steps and depends if and what kind of package manger you use.

Carthage

We fully support the Carthage Package Manager which makes it easy to integrate the Unzer SDK to your project.

  1. Add the following line to your Carfile

github "heidelpay/heidelpay-ios"

  1. Run carthage update

Run carthage update which will download the pre-compiled framework to your projects root folder.

  1. Add Framework

Follow the Carthage documention on how to add the Unzer framework to the Xcode project.

See the next section on how to verify if the Unzer framework is integrated in your project.

Cocoapods

We fully support the CocoaPods Package Manager which makes it easy to integrate the Unzer SDK to your project.

  1. Add the following line to your Podfile

pod "heidelpaySDK", :git => "https://github.com/heidelpay/heidelpay-iOS.git"

  1. Install pods

Run pod install which will install the Unzer framework and adopt your project.

See the next section on how to verify if the Unzer framework is integrated in your project.

No Package Manager

Follow these steps if you don’t use a package manager:

  1. Download the Unzer Framework from

https://github.com/heidelpay/heidelpay-ios

  1. Unpack the ZIP file in your projects root directory.

A folder named heidelpaySDK.framework will be created.

  1. Add to project

Open your project in Xcode and drag the folder heidelpaySDK.framework to the package manager on the left of the project window. Make sure that you select all desired targets in which you will use the Unzer framework.

heidelpay-ios-add-framework.png

  1. Strip simulator binary

The Unzer framework binary is delivered as a so called fat binary. That is it contains the binary code for a real iOS device and the binary code for the simulator which uses the i386 architecture. This makes it easy to run your app in the simulator or on the device with no further configuration.

As soon as you submit your app to the App Store you must make sure that unnecessary binary code is stripped from the app. If you use one of the popular package manager these make sure that this happens.

You can do this by adding a build phase to your release configuration and calling this script in order to strip the frameworks in your build.

Too many symbol files
If you are getting this error when submitting your App make sure that you followed step 4 and stripped the framework!

2. Verify that the Unzer framework is added

You can verify that the framework was added by opening a Swift file in your project and try to import the Unzer Framework.

// import of the heidelpaySDK
import heidelpaySDK

// test code to see if the import sees the framework symbols
var heidelpay: heidelpay?

Move on to Using the Mobile SDK.

Integrating Apple Pay

Implement Apple Pay.

Read More