iOS SDK - Technical Guide
Overview
This document helps developers to set up and integrate Cardknox Payments SDK into Objective C and Swift projects. The document contains steps for framework integration, required settings setup and import of SDK headers.
Technical Overview
The SDK is distributed as a
.framework
.framework
contains theCardknoxPaymentsSDK
binary andObjectiveC
.h
headers describing the SDK APIThe
CardknoxPaymentsSDK
does not containbitcode
and cannot be integrated with applications that requirebitcode
.framework
only supportsarm64
64-bit architecture for device builds. Simulator targets are not supported.SDK minimum deployment target is 14.0
Framework File Integration
Download the zip file with CardknoxPaymentsSDK.framework. Links for downloading framework files can find in iOS SDK - Get Started section.
Extract CardknoxPaymentsSDK.framework from downloaded .zip file.
Required Settings Setup
Disabling Bitcode
The Cardknox SDK doesn’t support bitcode. To disable Bitcode follow these steps:
Click on your application target. Choose
Build Settings
>All
Info.plist merge
The
CardknoxPaymentsSDK
framework contains anInfo.plist
file which contains various key/value pairs that are required by the framework, for example, it defines aNSBluetoothAlwaysUsageDescription
key with a value similar to “Bluetooth is required to find, connect to and transfer data between a card reader and the app"The application that is using the
CardknoxPaymentsSDK
framework also defines anInfo.plist
file with its own key/value pairsThe goal is to merge the framework
Info.plist
file with the applicationInfo.plist
in order to avoid runtime errors in theCardknoxPaymentsSDK
framework code due to missing key/values.XCode
doesn't perform any merges automatically.Note that if there are identical keys present in the application
Info.plist
and in the frameworkInfo.plist
files, such as theNSBluetoothAlwaysUsageDescription
key; the value defined in the application Info.plist for that key will have priority during the merge; making it easy to override values in the frameworkInfo.plist
To merge the two files, define a
Run Script
step in theXCode
application Target'sBuild Phases
section and run thePlistBuddy
tool, as following:Delete the
Type a script...
contents of the input box and add the following command
CardknoxPaymentsSDK headers import
This section shows how to use the CardknoxPaymentsSDK
in Objective C and Swift code. For Objective C it’s sufficient to reference the main SDK header. For Swift, an umbrella header is required to wrap the main SDK header into a Swift compatible format.
Objective C import
For Objective C applications - reference the CardknoxPaymentsSDK
main header file in your code with #import "CardknoxPaymentsSDK/CardknoxPaymentsSDK.h"
Swift import
For Swift applications - an umbrella header needs to be created and referenced by your application Target
in order to properly embed the framework into your app. To create the umbrella header, follow the steps:
Clear all text in the header file
Navigate to your target’s
Build Settings
>All
Last updated