Install
iOS
For v22.0, distribution of AHI SDK is now available through both CocoaPods and Swift Package Manager distribution services.
NOTE: Add camera usage description to the app Info.plist
:
Swift Package Manager
Add the following git repos to the app project in Xcode:
https://git-codecommit.ap-southeast-2.amazonaws.com/v1/repos/ahi-pod-ios-multiscan
https://git-codecommit.ap-southeast-2.amazonaws.com/v1/repos/ahi-pod-ios-facescan
https://git-codecommit.ap-southeast-2.amazonaws.com/v1/repos/ahi-pod-ios-fingerscan
https://git-codecommit.ap-southeast-2.amazonaws.com/v1/repos/ahi-pod-ios-bodyscan
Add or remove FaceScan, FingerScan, and BodyScan depending on what scan technologies are used by your application.
NOTE: Add the following linker flag to the project: -all_load
. Currently, SPM doesn't yet support libraries to declare custom linker flags like CocoaPods supports.
CocoaPods
As AHI is distributed through an access restriction, the following will need to be configured with CocoaPods. Run the following command in Terminal to install the AHI private CocoaPods repository:
pod repo add ahi-private https://git-codecommit.ap-southeast-2.amazonaws.com/v1/repos/ahi-pod-ios-cocoapods
In the App Podfile, declare the private repository by adding the following lines at the top (this includes the public CocoaPods CDN repository):
source 'https://git-codecommit.ap-southeast-2.amazonaws.com/v1/repos/ahi-pod-ios-cocoapods'
source 'https://cdn.cocoapods.org/'
To add the scans, add the following to your project target in the Podfile file:
pod 'AHIMultiScan'
pod 'AHIFaceScan'
pod 'AHIFingerScan'
pod 'AHIBodyScan'
Add or remove FaceScan, FingerScan, and BodyScan depending on what scan technologies are used by your application.
Android
AHI SDKs are distributed and managed using Maven and are most easily accessed using Gradle. Therefore, Gradle should be installed to be able to integrate the AHI SDKs into a project.
To access the Maven repository, you will need an Access Key
and a Secret Key
which you should have received from AHI. Once you have these, we recommend making them available to your build system as Gradle properties. This can be done by adding them to your machine as Environment Variables.
Once environment variables are set add the following lines
def AWS_ACCESS_KEY = System.getenv("AHI_AWS_ACCESS_KEY") ?: ""
def AWS_SECRET_KEY = System.getenv("AHI_AWS_SECRET_KEY") ?: ""
maven {
url 's3://ahi-prod-sdk-builds/android/release'
credentials(AwsCredentials) {
accessKey "$AWS_ACCESS_KEY"
secretKey "$AWS_SECRET_KEY"
}
}
to the repositories section within the dependencyResolutionManagement
block in your settings.gradle
file (Gradle version 7.0 or above)
OR
to the repositories section within the allprojects
block in your project level build.gradle
file (Gradle version lower than 7.0)
NOTE: Add following options in app level build.gradle
to enable view binding and avoid collision amoung c++ libries in different SDKs
android {
buildFeatures {
viewBinding true
}
packagingOptions {
jniLibs {
pickFirsts += ['**/*.so']
}
}
}
Further down in the app level build.gradle
file you will see the dependencies section. Add the following lines to add AHI's maven repos.
def AHISdkVersion = '22.0.+'
implementation "com.advancedhumanimaging.sdk:ahi-sdk-multiscan:$AHISdkVersion"
implementation "com.advancedhumanimaging.sdk:ahi-sdk-facescan:$AHISdkVersion"
implementation "com.advancedhumanimaging.sdk:ahi-sdk-fingerscan:$AHISdkVersion"
implementation "com.advancedhumanimaging.sdk:ahi-sdk-bodyscan:$AHISdkVersion"
Add or remove FaceScan, FingerScan, and BodyScan depending on what scan technologies are used by your application.