Project Setup
- iOS
- Android
1. Update Project's Build Setting
- Enable Bitcode: NO
- Validate Workspace: YES
NOTE: If you're using Xcode 14 or above you may not need to update these settings, since these are now deprecated
2. Update the Info.plist file:
- This permission is mandatory so Lens can scan and process your receipts:
<key>NSCameraUsageDescription</key>
<string>Scan documents</string>
- These permissions are mandatory if you support gallery backups/usage:
<key>NSPhotoLibraryAddUsageDescription</key>
<string>Back up your document images in your photo gallery</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Choose document images to process from your photo gallery</string>
- Optional. These permissions are mandatory if you want to improve uploading speed and vendor extraction accuracy:
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>Helps to identify places around you</string>
1. Update your build.gradle (:app) with the following configuration:
- Gradle: 8.0 (Groovy)
- Gradle: 7.0 (Groovy)
- Gradle: Any (Kotlin)
android {
...
androidResources {
noCompress = "veryfi"
}
}
android {
...
androidResources {
noCompress "veryfi"
}
}
android {
...
androidResources {
noCompress.add("veryfi")
}
}
2.Update the Application section of your AndroidManifest.xml file (Optional)
This step is required only if your manifest.application has android:allowBackup
or android:usesCleartextTraffic
tags.
- Add the tools import in the
<matifest>
tag. - Include the following settings
<manifest.application>
tag.
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools">
<application
...
tools:ignore="AllowBackup,GoogleAppIndexingWarning"
tools:replace="android:allowBackup, android:usesCleartextTraffic">
...
</manifest>
- It is recommended to use
usesCleartextTraffic
as false to avoid HTTP and FTP connections.
Prerequisites
1. Generate Access Credentials to pull the iOS and Android Lens SDKs from Veryfi's private repository.
1.1. Generate iOS Cocoapods Access Credentials:
- Sign in to the API Portal.
- Navigate to the Keys section under the Settings Menu.
- Within the Keys, choose Lens: Cocoapods (iOS) section and click the "Add Access Key" button.
- Fill in required information You will be prompted to provide the following information:
- First and Last Name
- Email Address
- Create a Password
Upon providing the required information, your username will be generated.
In the documentation, the created cocoapods username and password will be referred to as COCOAPODS_USERNAME
and COCOAPODS_PASSWORD
.
You can now use these credentials to access the privately stored SDK.
The password you create here will be used to access the SDK, and it won't be displayed in the Keys section again. Make sure to save it in a secure place.
Store iOS Cocoapods Access Credentials with Git Credential Tool (Recommended)
For convenience and security, we recommend storing these access credentials using a Git Credential Storage. This will ensure that you are automatically logged in each time you install or update the Lens SDK.
- Replace
COCOAPODS_USERNAME
andCOCOAPODS_PASSWORD
with corresponding credentials
git credential approve <<EOF
protocol=https
host=repo.veryfi.com
path=shared/lens/veryfi-lens-podspec.git
username=COCOAPODS_USERNAME
password=COCOAPODS_PASSWORD
EOF
1.2. Generate Android Maven Access Credentials:
- Sign in to the API Portal.
- Navigate to the Keys section under the Settings Menu.
- Within the Keys, choose Lens: Maven (Android) section and click the "Add Access Key" button.
- Fill in required information:
You will be prompted to provide the following information:
- First and Last Name
- Email Address
- Create a Password
Upon providing the required information, your username will be generated.
The generated credentials are referred to as MAVEN_USERNAME
and MAVEN_PASSWORD
.
You can now use these credentials to access the privately stored SDK.
The password you create here will be used to access the SDK, and it won't be displayed in the Keys section again. Make sure to save it in a secure place.
Add your Access Credentials to your system environment
Open your system profile (~/.bash_profile
, ~/.zshrc
or similar) and add next environmental variables there.
Replace MAVEN_USERNAME
and MAVEN_PASSWORD
with corresponding credentials
export MAVEN_VERYFI_USERNAME=MAVEN_USERNAME
export MAVEN_VERYFI_PASSWORD=MAVEN_PASSWORD
iOS Project Configuration
1. Run the following command in the root folder of your project to build the project and fetch the iOS dependencies:
npm run build
2. Go to the generated iOS projects App folder
cd ./ios/App
3. Update the Podfile
- Add the Veryfi private Cocoapods repository as a source at the top of the Podfile:
source 'https://repo.veryfi.com/shared/lens/veryfi-lens-podspec.git'
source 'https://github.com/CocoaPods/Specs.git'
- Add the VeryfiLens pod to your target
pod 'VeryfiLens'
pod 'AWSS3'
4. Run this command on the iOS App folder to fetch the iOS dependencies:
pod install --repo-update
5. Provide the generated Cocoapods Access Credentials, if required (Optional)
If you haven't stored the Cocoapods Credentials in the Git Credential Tool, you will be asked to provide your COCOAPODS_USERNAME
and COCOAPODS_PASSWORD
to pull the iOS Lens SDK from the private repository.
6. Update the Build Settings
- Go to the generated iOS folder
- Open the Runner.xcworkspace
- Go to the Targets > VeryfiLens > Build Settings
- Scroll down to the Build Options section, and configure the following build settings:
- Enable Bitcode: NO
- Validate Workspace: YES
NOTE: If you're using Xcode 14 or above you may not need to update these settings, since these are now deprecated
8. Update the Info.plist file:
- This permission is mandatory so Lens can scan and process your receipts:
<key>NSCameraUsageDescription</key>
<string>Scan documents</string>
- These permissions are mandatory if you support gallery backups/usage:
<key>NSPhotoLibraryAddUsageDescription</key>
<string>Back up your document images in your photo gallery</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Choose document images to process from your photo gallery</string>
- Optional. These permissions are mandatory if you want to improve uploading speed and vendor extraction accuracy:
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>Helps to identify places around you</string>
7. Sync your web code to your native project
Go back to the root folder:
cd ../..
Synchronize the Capacitor project :
npx cap sync
Android Project Configuration
1. Add the Veryfi Maven repository to the android/build.gradle (android) file:
- Groovy
- Kotlin
allprojects {
repositories {
...
//Add Veryfi Maven repository for VeryfiLens SDK
maven {
url "https://nexus.veryfi.com/repository/maven-releases/"
credentials {
username = System.getenv("MAVEN_VERYFI_USERNAME")
password = System.getenv("MAVEN_VERYFI_PASSWORD")
}
authentication {
basic(BasicAuthentication)
}
}
}
}
allprojects {
repositories {
...
//Add Veryfi Maven repository for VeryfiLens SDK
maven {
url = uri("https://nexus.veryfi.com/repository/maven-releases/")
credentials {
username = System.getenv("MAVEN_VERYFI_USERNAME")
password = System.getenv("MAVEN_VERYFI_PASSWORD")
}
}
}
}
2. Update your ./android/app/build.gradle (:app) with the following configuration:
- Gradle: 8.0 (Groovy)
- Gradle: 7.0 (Groovy)
- Gradle: Any (Kotlin)
android {
...
androidResources {
noCompress = "veryfi"
}
}
android {
...
androidResources {
noCompress "veryfi"
}
}
android {
...
androidResources {
noCompress.add("veryfi")
}
}
3.Update the Application section of your AndroidManifest.xml file (Optional)
This step is required only if your manifest.application has android:allowBackup
or android:usesCleartextTraffic
tags.
- Add the tools import in the
<matifest>
tag - Include the following settings
<manifest.application>
tag
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools">
<application
...
tools:ignore="AllowBackup,GoogleAppIndexingWarning"
tools:replace="android:allowBackup, android:usesCleartextTraffic">
...
</manifest>
- It is recommended to use
usesCleartextTraffic
as false to avoid HTTP and FTP connections.
Prerequisites
1. Generate Access Credentials to pull the iOS and Android Lens SDKs from Veryfi's private repository.
1.1. Generate iOS Cocoapods Access Credentials:
- Sign in to the API Portal.
- Navigate to the Keys section under the Settings Menu.
- Within the Keys, choose Lens: Cocoapods (iOS) section and click the "Add Access Key" button.
- Fill in required information You will be prompted to provide the following information:
- First and Last Name
- Email Address
- Create a Password
Upon providing the required information, your username will be generated.
In the documentation, the created cocoapods username and password will be referred to as COCOAPODS_USERNAME
and COCOAPODS_PASSWORD
.
You can now use these credentials to access the privately stored SDK.
The password you create here will be used to access the SDK, and it won't be displayed in the Keys section again. Make sure to save it in a secure place.
Store iOS Cocoapods Access Credentials with Git Credential Tool (Recommended)
For convenience and security, we recommend storing these access credentials using a Git Credential Storage. This will ensure that you are automatically logged in each time you install or update the Lens SDK.
- Replace
COCOAPODS_USERNAME
andCOCOAPODS_PASSWORD
with corresponding credentials
git credential approve <<EOF
protocol=https
host=repo.veryfi.com
path=shared/lens/veryfi-lens-podspec.git
username=COCOAPODS_USERNAME
password=COCOAPODS_PASSWORD
EOF
1.2. Generate Android Maven Access Credentials:
- Sign in to the API Portal.
- Navigate to the Keys section under the Settings Menu.
- Within the Keys, choose Lens: Maven (Android) section and click the "Add Access Key" button.
- Fill in required information:
You will be prompted to provide the following information:
- First and Last Name
- Email Address
- Create a Password
Upon providing the required information, your username will be generated.
The generated credentials are referred to as MAVEN_USERNAME
and MAVEN_PASSWORD
.
You can now use these credentials to access the privately stored SDK.
The password you create here will be used to access the SDK, and it won't be displayed in the Keys section again. Make sure to save it in a secure place.
- React Native
- Expo
Add your Access Credentials to your system environment
Open your system profile (~/.bash_profile
, ~/.zshrc
or similar) and add next environmental variables there.
Replace MAVEN_USERNAME
and MAVEN_PASSWORD
with corresponding credentials
export MAVEN_VERYFI_USERNAME=MAVEN_USERNAME
export MAVEN_VERYFI_PASSWORD=MAVEN_PASSWORD
Store Access Credentials in EAS Secrets
If you use EAS to build your iOS or Android project, you need to add in the Secrets section of your EAS project the variable enviroments that you set in the previous step with your credentials.
Replace MAVEN_USERNAME
and MAVEN_PASSWORD
with corresponding credentials
MAVEN_VERYFI_USERNAME=MAVEN_USERNAME
MAVEN_VERYFI_PASSWORD=MAVEN_PASSWORD
iOS Project Configuration
The below steps assume that you already have Cocoapods installed and initialized in your ios project.
1. Open the ios folder in your project in Terminal and run:
pod install
2. If you are using Objective-C only in your iOS project, create a Bridging Header. To have XCode do this for you:
1. Right-click on your project folder in XCode and select New File
2. Select Swift File, enter any name and click Create
3. In the popup, follow the prompts to Create Bridging Header
3. Go to your app's Target > Build Settings, scroll down to the Build Options section and configure the following:
- Enable Bitcode: NO
- Validate Workspace: YES
NOTE: If you're using Xcode 14 or above you may not need to update these settings, since these are now deprecated
- React Native
- Expo
4. Add the following to your app's Info.plist file:
- This permission is mandatory so Lens can scan and process your receipts:
<key>NSCameraUsageDescription</key>
<string>Scan documents</string>
- These permissions are mandatory if you support gallery backups/usage:
<key>NSPhotoLibraryAddUsageDescription</key>
<string>Back up your document images in your photo gallery</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Choose document images to process from your photo gallery</string>
- Optional. These permissions are mandatory if you want to improve uploading speed and vendor extraction accuracy:
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>Helps to identify places around you</string>
4. Expo Info.plist modification through the app.json
By using Expo you'll get access to the Info.plist by adding this object inside ios
object in your app.json
config file.
"infoPlist": {
"NSCameraUsageDescription": "Scan documents",
"NSPhotoLibraryAddUsageDescription": "Back up your document images in your photo gallery",
"NSPhotoLibraryUsageDescription": "Choose document images to process from your photo gallery"
}
Android Project Configuration
1. Update your ./android/app/build.gradle (:app) with the following configuration:
- Gradle: 8.0 (Groovy)
- Gradle: 7.0 (Groovy)
- Gradle: Any (Kotlin)
android {
...
androidResources {
noCompress = "veryfi"
}
}
android {
...
androidResources {
noCompress "veryfi"
}
}
android {
...
androidResources {
noCompress.add("veryfi")
}
}
2.Update the Application section of your AndroidManifest.xml file (Optional)
This step is required only if your manifest.application has android:allowBackup
or android:usesCleartextTraffic
tags.
- Add the tools import in the
<matifest>
tag - Include the following settings
<manifest.application>
tag
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools">
<application
...
tools:ignore="AllowBackup,GoogleAppIndexingWarning"
tools:replace="android:allowBackup, android:usesCleartextTraffic">
...
</manifest>
- It is recommended to use
usesCleartextTraffic
as false to avoid HTTP and FTP connections.
3.Configure Android Settings in Expo (Optional)
In your Expo project, use the android.manifest section within expo.config.js to set android:allowBackup
or android:usesCleartextTraffic
to false. This approach allows you to apply native Android configurations without modifying AndroidManifest.xml directly, which Expo's build process will respect and apply during the build phase.
// expo.config.js
export default {
// ... other config properties
android: {
manifest: {
application: {
android: {
allowBackup: false,
usesCleartextTraffic: false,
},
},
},
},
};
Prerequisites
1. Generate Access Credentials to pull the iOS and Android Lens SDKs from Veryfi's private repository.
1.1. Generate iOS Cocoapods Access Credentials:
- Sign in to the API Portal.
- Navigate to the Keys section under the Settings Menu.
- Within the Keys, choose Lens: Cocoapods (iOS) section and click the "Add Access Key" button.
- Fill in required information You will be prompted to provide the following information:
- First and Last Name
- Email Address
- Create a Password
Upon providing the required information, your username will be generated.
In the documentation, the created cocoapods username and password will be referred to as COCOAPODS_USERNAME
and COCOAPODS_PASSWORD
.
You can now use these credentials to access the privately stored SDK.
The password you create here will be used to access the SDK, and it won't be displayed in the Keys section again. Make sure to save it in a secure place.
Store iOS Cocoapods Access Credentials with Git Credential Tool (Recommended)
For convenience and security, we recommend storing these access credentials using a Git Credential Storage. This will ensure that you are automatically logged in each time you install or update the Lens SDK.
- Replace
COCOAPODS_USERNAME
andCOCOAPODS_PASSWORD
with corresponding credentials
git credential approve <<EOF
protocol=https
host=repo.veryfi.com
path=shared/lens/veryfi-lens-podspec.git
username=COCOAPODS_USERNAME
password=COCOAPODS_PASSWORD
EOF
1.2. Generate Android Maven Access Credentials:
- Sign in to the API Portal.
- Navigate to the Keys section under the Settings Menu.
- Within the Keys, choose Lens: Maven (Android) section and click the "Add Access Key" button.
- Fill in required information:
You will be prompted to provide the following information:
- First and Last Name
- Email Address
- Create a Password
Upon providing the required information, your username will be generated.
The generated credentials are referred to as MAVEN_USERNAME
and MAVEN_PASSWORD
.
You can now use these credentials to access the privately stored SDK.
The password you create here will be used to access the SDK, and it won't be displayed in the Keys section again. Make sure to save it in a secure place.
Add your Access Credentials to your system environment
Open your system profile (~/.bash_profile
, ~/.zshrc
or similar) and add next environmental variables there.
Replace MAVEN_USERNAME
and MAVEN_PASSWORD
with corresponding credentials
export MAVEN_VERYFI_USERNAME=MAVEN_USERNAME
export MAVEN_VERYFI_PASSWORD=MAVEN_PASSWORD
iOS Project Configuration
1. Build iOS project
flutter build ios
2. Update iOS Build Settings
- Select the Pods project
- Select the Veryfi target
- Open the Build Settings tab
- Scroll down to the Build Options section
Enable Bitcode: NO
Validate Workspace: YES
NOTE: If you're using Xcode 14 or above you may not need to update these settings, since these are now deprecated
3. Update ios app's Info.plist file:
- This permission is mandatory so Lens can scan and process your receipts:
<key>NSCameraUsageDescription</key>
<string>Scan documents</string>
- These permissions are mandatory if you support gallery backups/usage:
<key>NSPhotoLibraryAddUsageDescription</key>
<string>Back up your document images in your photo gallery</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Choose document images to process from your photo gallery</string>
- Optional. These permissions are mandatory if you want to improve uploading speed and vendor extraction accuracy:
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>Helps to identify places around you</string>
Android Project Configuration
1. Update your ./android/app/build.gradle (:app) with the following configuration:
- Gradle: 8.0 (Groovy)
- Gradle: 7.0 (Groovy)
- Gradle: Any (Kotlin)
android {
...
androidResources {
noCompress = "veryfi"
}
}
android {
...
androidResources {
noCompress "veryfi"
}
}
android {
...
androidResources {
noCompress.add("veryfi")
}
}
2.Update the Application section of your AndroidManifest.xml file (Optional)
This step is required only if your manifest.application has android:allowBackup
or android:usesCleartextTraffic
tags.
- Add the tools import in the
<matifest>
tag - Include the following settings
<manifest.application>
tag
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools">
<application
...
tools:ignore="AllowBackup,GoogleAppIndexingWarning"
tools:replace="android:allowBackup, android:usesCleartextTraffic">
...
</manifest>
- It is recommended to use
usesCleartextTraffic
as false to avoid HTTP and FTP connections.
iOS Project Configuration
1. Enable Keychain sharing in your Entitlements.plist
Update your Entitlements.plist changing the menu in the top right section to Entitlements Make sure that Keychaing Sharing switch is on
2. Update iOS projects Build Settings
Enable Bitcode: NO
Validate Workspace: YES
NOTE: If you're using Xcode 14 or above you may not need to update these settings, since these are now deprecated
3. Update Info.plist file with the following permissions:
- This permission is mandatory so Lens can scan and process your receipts:
<key>NSCameraUsageDescription</key>
<string>Scan documents</string>
- These permissions are mandatory if you support gallery backups/usage:
<key>NSPhotoLibraryAddUsageDescription</key>
<string>Back up your document images in your photo gallery</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Choose document images to process from your photo gallery</string>
- Optional. These permissions are required only if you want to improve uploading speed and vendor extraction accuracy:
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>Helps to identify places around you</string>
Android Project Configuration
1. Install Xamarin.Google.Android.Material
package
- Select
nugen.org
in the Package source dropdown - Select
Xamarin.Google.Android.Material
- Add this package to your Anroid .NET application
2. Update your AndroidManifest.xml
file
- Open your
AndroidManifest.xml
with the Source Code Editor - Update the content of the file to match the code sample below
- Add the
xmlns:tools="http://schemas.android.com/tools"
in the<matifest>
tag - Add
<uses-sd>
tag, that specifies the required Android SDK Versions - Add
tools:replace="android:allowBackup">
to the<manifest.application>
tag - If your
<manifest.application>
tag hasandroid:usesCleartextTraffic
, make sure to addandroid:usesCleartextTraffic
to thetools:replace
section (Optional)
Your minimal version of the AndroidManifest.xml
file should look like:
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools">
<application android:allowBackup="true" android:icon="@mipmap/appicon" android:label="@string/app_name" android:roundIcon="@mipmap/appicon_round" android:supportsRtl="true" tools:replace="android:allowBackup">
</application>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-sdk android:minSdkVersion="23" android:targetSdkVersion="33"/>
</manifest>