Installation options
Overview
The iOS SDK is provided in two formats:
- a Binary Framework format (extension
xcframework
) - a legacy Universal Framework format (extension
framework
)
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)
Note that Binary Framework and Universal Framework are stored in different repositories.
Prerequisites
- Decide on format and installation method you will use. We recommend using the Binary Framework format and installing the SDK with Cocoapods.
Installation
Using Cocoapods
If your project isn’t using CocoaPods already, follow the set up guide from the official CocoaPods website here . Otherwise, ensure that the version of Cocoapods you are using is compatible with the Sensibill SDK (See Requirements page for more information.)
Add the Sensibill dependency to your project’s Podfile. Use a template below that matches the format you chose (Binary Framework or Universal Framework)
Format Template for Podfile Binary Framework pod 'Sensibill', :git => 'git@github.com:getsensibill/sdk-ios.git', :tag => 'vX.Y.Z'
Universal Framework pod 'Sensibill', :git => 'git@github.com:getsensibill/sdk-ios-legacy.git', :tag => 'vX.Y.Z'
where vX.Y.Z represents the version of the SDK you want to use.
In your terminal, navigate to the root directory of your application’s project folder. Run
pod install
to integrate the Sensibill SDK to your project.
Via Direct Download
Download the Sensibill SDK directly, navigate to a corresponding Releases page:
- for the XCFramework format - sdk-ios/releases
- for the Universal Framework format - sdk-ios-legacy/releases
Locate the release of the version you need, and download the Source code (zip) package.
In the zip you downloaded, locate
for Binary Framework, Sensibill.xcframework
Note: use a Sensibill.xcframework as a whole, without unpackaging its contents.for Universal Framework, Sensibill.framework
Drag the component from step 2 to your Application Target’s Frameworks, Libraries, and Embedded Content section under the General tab.
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
Migration from Universal Framework to Binary Framework
If your are updating existing integration from Universal Framework to Binary Framework, remove the Run Script Phase from your target’s Build Phases. The script was responsible for executing stripping the unused architectures from Universal Framework, and is no longer required for XCFramework. With XCFramework Xcode will automatically select an appropriate architecture slice for host application, based on target platform.
Required Additional Steps for Universal Framework
The following steps are only applicable to Universal Framework, and are not neccessary when using a Binary Framework.
Create a new Run Script Phase in your target’s Build Phases, underneath the Embed Frameworks phase. Input the following command in the text field of the new phase:
"$BUILT_PRODUCTS_DIR/$FRAMEWORKS_FOLDER_PATH/Sensibill.framework/strip-unused-architectures.sh"
Update the Validate Workspace setting to Yes to avoid the following compilation error:
Building for the iOS Simulator, but the linked and embedded framework ‘Sensibill.framework’ was built for iOS + iOS Simulator.
or
Building for iOS, but the linked and embedded framework ‘Sensibill.framework’ was built for iOS + iOS Simulator.
When updating from earlier Sensibill SDK versions, remove the value for the Support Modules path provided in Swift Import Path build settings under Swift Compiler - Search Paths section.
Troubleshooting
Compilation Errors
Compilation error Building for the iOS Simulator, but the linked and embedded framework 'Sensibill.framework' was built for iOS + iOS Simulator.
appears when running on simulator using Code 12.3 or higher
- Update target’s Build Settings Validate Workspace settings to Yes under Build Options section.
Compilation error Building for iOS, but the linked and embedded framework 'Sensibill.framework' was built for iOS + iOS Simulator.
appears when running on device using XCode 12.3 or higher
- Update target’s Build Settings Validate Workspace settings to Yes under Build Options section
Module ‘Sensibill’ not found (in Objective-C File)
- This compile time error will appear next to following statement in Objective-C file:
@import SensibillUI;
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>
Image not Found
You may get an image not found
error during run time:
Referenced from: /.../YourApp.app/Frameworks/Sensibill.framework/Sensibill
Reason: image not found
The following are common ways that this error is caused, and ways to mitigate them:
- Framework was not included in Embedded Binaries
- To fix this ensure that the framework is included in Embedded Binaries in addition to the default Linked Frameworks and Libraries.
- Objective-C only project may not have Swift setup properly
- To fix this simply add a single Swift file to your project using File > New > File…. When XCode prompts you if you would like to create a Bridging Header click Yes.
No code signature Found
If you encounter an error when installing your app to a physical device:
App installation failed
No code signature found.
Make sure that the Run Script Phase
added during installation has the option Run script only when installing
checked.
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 Installation section.
Info
Before adding Senisbill dependencies to your project, please ensure you’ve added the Sensibill Maven server as a dependency repository in your project build.gradle
file as described on the Get Started > Installation page
Info
For each of the dependencies listed below, please replace X.X.X
with the desired Sensibill SDK version
Sensibill Gradle Dependencies
Once you have access to Sensibill Artifacts, adding the SDK to your project is a matter of adding the correct dependencies to your app
level build.gradle
file.
Please refer to the below reference to determine which Sensibill dependencies to include.
For Full SDK functionality
Just add:
implementation "com.getsensibill:sensibill-sdk-all:X.X.X"
Standalone Capture Only
Just add:
implementation "com.getsensibill:sensibill-capture-standalone:X.X.X"
Headless SDK
Add the below, and see If Using Username Password Authentication if applicable.
implementation "com.getsensibill:sensibill-sdk-core:X.X.X"
Headless SDK + Capture Flow
Add the below, and see If Using Username Password Authentication if applicable.
implementation "com.getsensibill:sensibill-capture-flow:X.X.X"
If Using Username Password Authentication
Add in addition to other modules:
implementation "com.getsensibill:sensibill-auth:X.X.X"
implementation "com.getsensibill:sensibill-oauth-client:X.X.X"