Add the biometrics authentication SDK to your iOS app

Learn how to add the biometric authentication software development kit (SDK) to your iOS or Android app so you can test biometric authentication during your manual and automated test sessions.

Add KobitonLAContext.framework

First you’ll add KobitonLAContext.framework as an embedded and signed framework in your app’s Xcode project.

  1. Launch Xcode and select your project.

  2. Download and unzip KobitonLAContext.zip.

  3. Move KobitonLAContext.framework into the project directory.

  4. In Xcode, scroll down to Frameworks, Libraries, and Embedded Content and select the + icon.

  5. Select Add Other…, Add Files…, and choose KobitonLAContext.framework.

  6. Select Embed & Sign.

Modify ViewController.swift

Next you’ll open the ViewController. swift file in your project directory and replace all LocalAuthentication imports with KobitonLAContext.

Then replace all context = LAContext() variables with context = KobitonLAContext().

Example
import UIKit
import LocalAuthentication /// Change to import KobitonLAContext

    class ViewController: UIViewController {
    var context = LAContext() /// Change to var = KobitonLAContext()

enum AuthenticationState {
case loggedin, loggedout
}

Save the file. If your app requires support for iOS 14 or earlier, you’ll also need to add a few info.plist parameters. Otherwise, you can verify your changes.

Add new info.plist parameters

If your app requires support for iOS 14 or earlier, you’ll also need to add a few info.plist parameters. These let you …

  1. Open the project’s root directory and select Info.

  2. Next to any of the custom iOS target properties, select the + icon, and choose App Transport Security Settings to add this property to the list.

  3. Next to your new property, select the dropdown, then the + icon, then choose Allow Arbitrary Loads.

  4. Set Allow Arbitrary Loads to Yes.

  5. Your changes are saved automatically. When you’re finished, verify your changes.

Verify your changes

First, rebuild your .ipa and upload it to the app repository. Then, start a manual test session, launch your app, and try using biometric authentication to sign in. Select Pass and check the logs to see verify your changes.