iOS Installation

Overview

The iOS SDK is provided in a Binary Framework format (extension xcframework) and can be installed in one of two ways:

  • Using Cocoapods - a quick and convenient way to download external dependencies for an iOS project.
  • Via Direct Download (where the SDK is copied to the project)

Once you added an SDK to a project using a desired method, also review and add the required entitlements, as explained in the Adding the Required Entitlements section of this page.

Adding Sensibill SDK to a Project

This section explains how to install Sensibill SDK for iOS in XCFramework format to your application

We recommend installing the SDK with Cocoapods.

Steps

  1. If your project isn’t using CocoaPods already, follow the Installation and Getting Started guides on the official CocoaPods website . Once your project is integrated with the CocoaPods, you should have a Podfile in the root directory of your project.

  2. Add the Sensibill SDK for iOS as a dependency to your project’s Podfile in the following format:

    pod 'Sensibill', :git => 'git@github.com:getsensibill/sdk-ios.git', :tag => 'vX.Y.Z'

    where vX.Y.Z represents to version of the SDK you want to use.

    Note: once Sensibill SDK was added to Podfile, don’t forget to run pod install from the root directory of your application’s project in your terminal. This will add Sensibill SDK for iOS to your project’s Pods.

  3. Validate the integration by importing the Sensibill module into one of your Swift classes:

    import Sensibill

    and try to build your project. If the project builds successfully, the Sensibill SDK for iOS was integrated correctly. Otherwise follow the Troubleshooting steps below.

Method 2: Via Direct Download

This is an alternative method, which can be used if the app integration with Cocoapods is undesirable.

Steps

  1. Navigate to sdk-ios/releases , select the release, and download the Source code (zip) package.

  2. In the zip you downloaded, locate Sensibill.xcframework

    Note: use a Sensibill.xcframework as a whole, without unpackaging its contents.

  3. Drag the component from step 2 to your Application Target’s Frameworks, Libraries, and Embedded Content section under the General tab.

  4. Ensure that in Project Settings the component you just added:

    • is set to Embed & Sign
    • is included in the Embedded Binaries and Linked Frameworks and Libraries section under the Build Phases tab

Adding the Required Entitlements

  • When a user navigates to the Capture Document screen of the Sensibill SDK, SDK will use device’s camera to capture documents. In order to allow camera usage, your application must prompt the user for consent to use their device’s camera, and thus requires a Privacy - Camera Usage Description entitlement.

  • Sensibill SDK also allows the users to select existing document images from the device’s photo gallery, which requires a Privacy - Photo Library Usage Description entitlement. Alternatively you can disable gallery access by setting the Capture.FeatureFlags.enableImageGallery to false.

  • If you would like to attach user’s device Location data to captured document, the Privacy - Location When In Use Usage Description entitlement is required. By default the location data is not collected, and you need to set Capture.FeatureFlags.attachLocationData to true to enable attaching the location data. Note that if user denies the access to the location, the location data will not be attached to a document, even if it was enabled for the app.

Steps

  1. Open Info.plist of your application.
  2. Locate or add each of the following entitlements, and provide a description of why the entitlement is required.

Required Entitlements

  • For the camera usage: NSCameraUsageDescription (displayed as Privacy - Camera Usage Description)
  • For the photo gallery access: NSPhotoLibraryUsageDescription (displayed as Privacy - Photo Library Usage Description).
  • For attaching user’s location data: NSLocationWhenInUseUsageDescription (displayed as Privacy - Location When In Use Usage Description).

Troubleshooting

Module ‘Sensibill’ not found (in Objective-C File)

  • This compile time error will appear next to following statement in Objective-C file:
@import Sensibill;

Please use the following import statement instead:

#import <SensibillUI/Sensibill.h>
#import <SensibillUI/Sensibill-Swift.h>

Unknown type name SBL* (in Objective-C File)

  • This compile time error will appear in Objective-C file, even if you have imported Sensibill with correct syntax:
#import <Sensibill/Sensibill.h>

The following import statement is required to access the SDK’s swift classes in an Objective-C file:

#import <Sensibill/Sensibill-Swift.h>

This app has crashed because it attempted to access privacy-sensitive data without a usage description

The following crash may occur if the required entitlements were not provided:

This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app’s Info.plist must contain an NSCameraUsageDescription (or NSPhotoLibraryUsageDescription / NSPhotoLibraryAddUsageDescription) key with a string value explaining to the user how the app uses this data.

To correct the crash, add the required entitlements, as described in Adding the Required Entitlements section of this page.