Start using packagecloud in minutes

Join thousands of developers using packagecloud to distribute software securely, consistently, and affordably.

README

last updated: Thu 03/20/25 at 07:45:59 PM by lucas-yupistudios

BioPass ID Fingerprint SDK

Latest Version

March 20, 2025 - [v2.1.4]

Table of Contents

Quick Start Guide

First, you will need a license key to use the SDK. You can acquire a license key when subscribing to a BioPass ID plan.

Check out our official documentation for more in depth information on BioPass ID.

1. Prerequisites

Attention: To use Fingerprint you will need a physical device, Fingerprint does not work on simulators.

- iOS version: 15.0 or higher
- Swift: 5.0.0
- CocoaPods
- Info.plist
- License key
- A physical device with a camera
- Internet connection is required to verify the license

Add to the Info.plist:

  • the key Privacy - Camera Usage Description and a usage description.

Or in text format add the key:

<key>NSCameraUsageDescription</key>
<string>Your camera usage description</string>

Privacy Manifest File.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>NSPrivacyCollectedDataTypes</key>
    <array>
        <dict>
            <key>NSPrivacyCollectedDataType</key>
            <string>NSPrivacyCollectedDataTypeOtherUserContent</string>
            <key>NSPrivacyCollectedDataTypeLinked</key>
            <false/>
            <key>NSPrivacyCollectedDataTypeTracking</key>
            <false/>
            <key>NSPrivacyCollectedDataTypePurposes</key>
            <array>
                <string>NSPrivacyCollectedDataTypePurposeAppFunctionality</string>
            </array>
        </dict>
        <dict>
            <key>NSPrivacyCollectedDataType</key>
            <string>NSPrivacyCollectedDataTypeDeviceID</string>
            <key>NSPrivacyCollectedDataTypeLinked</key>
            <false/>
            <key>NSPrivacyCollectedDataTypeTracking</key>
            <false/>
            <key>NSPrivacyCollectedDataTypePurposes</key>
            <array>
                <string>NSPrivacyCollectedDataTypePurposeAppFunctionality</string>
            </array>
        </dict>
    </array>
    <key>NSPrivacyTracking</key>
    <false/>
    <key>NSPrivacyAccessedAPITypes</key>
    <array>
        <dict>
            <key>NSPrivacyAccessedAPITypeReasons</key>
            <array>
                <string>CA92.1</string>
            </array>
            <key>NSPrivacyAccessedAPIType</key>
            <string>NSPrivacyAccessedAPICategoryUserDefaults</string>
        </dict>
    </array>
</dict>
</plist>

2. Installation

With XCFramework Folder

Here you can find the latest releases. Download touchlesslib.zip and unzip, then add the .xcframework folder to your project.

  1. Select your target;
  2. Click in the general tab;
  3. Go to the Frameworks, libraries and embedded content group;
  4. Drag and drop the xcframework folder to add to your project.

3. How to use

In SwiftUI

import touchlesslib
import SwiftUI

struct MyApp: View 

    // instantiate the FingerprintConfig
    var config: FingerprintConfig = FingerprintConfig()

    @State var imagesFingerprint: [UIImage]? = []

    @State var isPresented = false

    // you can define a custom setImage to receive the Fingerprint images
    func setImages(images: [UIImage]) 
        for image in images 
            print("Fingerprint: ", image)
            imagesFingerprint?.append(image)





    var body: some View 
        NavigationView 
            ScrollView 
                VStack 
                    Text("BioPass ID Fingerprint SDK")
                        .frame(maxHeight: .infinity, alignment: .top)

                    VStack 
                        ForEach(imagesFingerprint!, id: \.self)  image in
                            if image != nil 
                                Image(uiImage: image)
                                    .resizable()
                                    .frame(width: 500, height: 500)




                    Spacer()
                    Button 
                        isPresented = true
                        openFingerprint()
                     label: 
                        Text("Open Fingerprint")
                    .fullScreenCover(isPresented: $isPresented) 
                        FingerprintView(with: config, onFingerCapture:  images, error in
                            if let error = error 
                                print("ERROR :", error)

                            if images.count != 0 
                                setImages(images: images)

                        , onStatusChanged:  state in
                            print("Status : ", state)
                        , onFingerDetected:  rects in
                            print("Rects :", rects)
                        )
                    .frame(alignment: .center)
                    Spacer()


        .navigationBarTitle("", displayMode: .inline)


    func openFingerprint() 
        config.licenseKey = "your-license-key"
        isPresented = true


FingerprintCaptureState (enum)

| Name                                    |
| --------------------------------------- |
| FingerprintCaptureState.NO_DETECTION    |
| FingerprintCaptureState.MISSING_FINGERS |
| FingerprintCaptureState.TOO_CLOSE       |
| FingerprintCaptureState.TOO_FAR         |
| FingerprintCaptureState.OK              |
| FingerprintCaptureState.STOPPED         |
| FingerprintCaptureState.PROCESSING      |
| FingerprintCaptureState.MODEL_NOT_FOUND |

4. LicenseKey

First, you will need a license key to use the SDK. To get your license key contact us through our website BioPass ID.

To use BioPass ID Fingerprint you need a license key. To set the license key needed is simple as setting another attribute. Simply doing:

let config = FingerprintConfig()
    config.licenseKey = "your-license-key"       

Config

FingerprintConfig

| Variable name                   | Type                                 | Default value                                  |
| ------------------------------- | ------------------------------------ | ---------------------------------------------- |
| licenseKey                      | String                               | ""                                             |
| numberFingersToCapture          | Int                                  | 4                                              |
| fontFamily                      | String                               | fingerprintsdk_opensans_regular                |
| overlayColor                    | Color                                | ColorUtil.hexStringToColor(hex: "#80000000") |
| timeToCapture                   | Int                                  | 5                                              |
| captureCountdown                | FingerprintCaptureCountdownOptions   |                                                |
| captureType                     | FingerprintCaptureType               | FingerprintCaptureType.LEFT_HAND_FINGERS       |
| outputType                      | FingerprintOutputType                | FingerprintOutputType.CAPTURE_AND_SEGMENTATION |
| backButton                      | FingerprintButtonOptions             |                                                |
| helpText                        | FingerprintHelpTextOptions           |                                                |
| fingerEllipse                   | FingerprintFingerEllipseOptions      |                                                |
| distanceIndicator               | FingerprintDistanceIndicatorOptions  |                                                |

FingerprintCaptureType (enum)

| Name                                      |
| ----------------------------------------- |
| FingerprintCaptureType.RIGHT_HAND_FINGERS |
| FingerprintCaptureType.LEFT_HAND_FINGERS  |
| FingerprintCaptureType.THUMBS             |

FingerprintOutputType (enum)

| Name                                           |
| ---------------------------------------------- |
| FingerprintOutputType.ONLY_CAPTURE             |
| FingerprintOutputType.CAPTURE_AND_SEGMENTATION |

FingerprintCaptureCountdownOptions

| Name            | Type    | Default value                                |
| --------------- | ------- | -------------------------------------------- |
| enabled         | Bool    | true                                         |
| backgroundColor | Color   | Color.gray                                   |
| progressColor   | Color   | ColorUtil.hexStringToColor(hex: "#D6A262") |
| textColor       | Color   | Color.white                                  |

FingerprintButtonOptions

| Name            | Type                   | Default value                                             |
| --------------- | ---------------------- | --------------------------------------------------------- |
| enabled         | Bool                   | true                                                      |
| backgroundColor | Color                  | ColorUtil.hexStringToColor(hex: "#80000000")            |
| buttonPadding   | Int                    | 0                                                         |
| buttonSize      | CGSize                 | CGSize(width: 56, height: 56)                             |
| iconOptions     | FingerprintIconOptions |                                                           |
| labelOptions    | FingerprintTextOptions |                                                           |

FingerprintIconOptions

| Name      | Type    | Default value                   |
| --------- | ------- | ------------------------------- |
| enabled   | Bool    | true                            |
| iconFile  | Int     | ""                              |
| iconColor | Color   | Color.white                     |
| iconSize  | CGSize  | CGSize(width: 32, height: 32)   |

FingerprintTextOptions

| Name      | Type    | Default value |
| --------- | ------- | ------------- |
| enabled   | Bool    | true          |
| content   | String  | ""            |
| textColor | Color   | Color.white   |
| textSize  | CGFloat | 14            |

FingerprintHelpTextOptions

| Name      | Type                        | Default value     |
| --------- | --------------------------- | ----------------- |
| enabled   | Bool                        | true              |
| messages  | FingerprintHelpTextMessages |                   |
| textColor | Color                       | Color.white       |
| textSize  | CGFloat                     | 14                |

FingerprintHelpTextMessages

| Name             | Type   | Default value                                                               |
| ---------------- | ------ | --------------------------------------------------------------------------- |
| leftHandMessage  | String | "Encaixe a mão esquerda (sem o polegar)\naté o marcador ficar centralizado" |
| rightHandMessage | String | "Encaixe a mão direita (sem o polegar)\naté o marcador ficar centralizado"  |
| thumbsMessage    | String | "Encaixe os polegares\naté o marcador ficar centralizado."                  |

FingerprintFingerEllipseOptions

| Name          | Type    | Default value                                   |
| ------------- | ------- | ----------------------------------------------- |
| enabled       | Bool    | true                                            |
| ellipseColor  | Color   | ColorUtil.hexStringToColor(hex: "#80D6A262")  |

FingerprintDistanceIndicatorOptions

| Name               | Type                   | Default value                                    |
| ------------------ | ---------------------- | ------------------------------------------------ |
| enabled            | Bool                   | true                                             |
| selectedBarColor   | Color                  | ColorUtil.hexStringToColor(hex: "#D6A262")     |
| unselectedBarColor | Color                  | Color.white                                      |
| arrowColor         | Color                  | ColorUtil.hexStringToColor(hex: "#D6A262")     |
| tooCloseText       | FingerprintTextOptions | FingerprintTextOptions(content: "Muito perto")   |
| tooFarText         | FingerprintTextOptions | FingerprintTextOptions(content: "Muito longe")   |

How to change font

To add the font files to your Xcode project:

  1. In Xcode, select the Project navigator.
  2. Drag your fonts from a Finder window into your project. This copies the fonts to your project.
  3. Select the font or folder with the fonts, and verify that the files show their target membership checked for your app’s targets.

Then, add the "Fonts provided by application" key to your app’s Info.plist file. For the key’s value, provide an array of strings containing the relative paths to any added font files.

In the following example, the font file is inside the fonts directory, so you use fonts/RobotoMono-BoldItalic.ttf as the string value in the Info.plist file.

Finally, just set the font by passing the font name when instantiating FingerprintConfig.

var config = FingerprintConfig()
config.licenseKey = "your-license-key"
config.fontFamily =  "Poppins-Bold"

How to change icon

To add icon files to your Xcode project:

  1. In the Project navigator, select an asset catalog: a file with a .xcassets file extension.
  2. Drag an image from the Finder to the outline view. A new image set appears in the outline view, and the image asset appears in a well in the detail area.

Finally, just set the icon by passing the icon name when instantiating FingerprintConfig.

var config = FingerprintConfig()
config.licenseKey = "your-license-key"
// changing back button icon
config.backButton.iconOptions.iconFile = "ic_close"

Changelog

2.1.4

  • Documentation update.

2.1.3

  • Documentation update.

2.1.2

  • Documentation update.

2.1.1

  • Documentation update.

2.1.0

  • Documentation update;
  • Added new time to capture functionality;
  • Added countdown view.

2.0.2

  • Documentation update;
  • Added Privacy manifest file.

2.0.1

  • Documentation update.

2.0.0

  • Documentation update;
  • FingerprintConfig refactoring:
    • Removed showFingerEllipseView and fingerColor, they are now in a new configuration class called FingerprintFingerEllipseOptions;
    • Removed showDistanceIndicatorView, distanceIndicatorLineColor, distanceIndicatorHighlightColor, tooCloseText and tooFarText, now they are in a new configuration class called FingerprintDistanceIndicatorOptions.

1.0.2

  • Documentation update.

1.0.1

  • Documentation update.

1.0.0

  • Documentation update;
  • Added validation on the number of fingers to be captured;
  • The name of the onReceiveImages callback has been changed to onFingerCapture;
  • Refactoring in onFingerCapture:
    • Now, if the fingerprint extraction fails, a String will be returned with an error message.
Quick install instructions for: