Set Up Your Project

Add the SDK to your project so your application can access all the BindID functionality, as described below.

STEP 1: Add the SDK to Your Project

Install the SDK as a dependency using Swift Package Manager. Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into the swift compiler. Add XmBindIdSDK as a dependency by adding it to the dependencies value of your Package.swift:

dependencies: [
.package(url: "https://github.com/TransmitSecurity/bindid-ios-sdk.git", .upToNextMajor(from: "1.18.0"))

For information on how to use CocoaPods or Carthage instead, see here.

Note: Check out our GitHub repo to see the latest SDK version available.

STEP 2: Configure the SDK

You need to configure the BindID SDK with your client ID, and to work with the BindID sandbox or production environment:

Note: You will need to add the import XmBindIdSDK at the top of the implementation class.

To initialize the SDK, invoke the initialize() method (see API reference). The following example uses initialization parameters to set the environment as production (see XmBindIdServerEnvironmentMode) and the client ID (generated in the BindID Admin Portal) as qL4IJvJ1kHwunrLNOGhAAVCMD39EDPWF:

let config = XmBindIdConfig(serverEnvironment: XmBindIdServerEnvironment(environmentMode: XmBindIdServerEnvironmentMode.production), clientId: "qL4IJvJ1kHwunrLNOGhAAVCMD39EDPWF")
XmBindIdSdk.shared.initialize(config: config) { [weak self] (_, error) in
if let e = error {
print("error: \(e)")
} else {
print("SDK initialized")
}
}

See the API documentation for information on other initialization parameters.