Install the Incode Onboarding Flutter SDK, configure the iOS and Android projects that consume it, and initialize the SDK. After initialization, see Common Implementation Patterns to start an onboarding session.
SDK variants
The SDK is distributed in several variants. Select a variant by pointing the ref field in your pubspec.yaml at the matching release branch (see Add the SDK to your project). Combined variants are not supported.
- Standard: The default variant. No modifier.
-vc: Streams the camera feed during Selfie and ID scan.-nfc: Reads data from a passport or ID chip via NFC.-l: Manipulates locally stored identities. Required for 1:NFaceAuthMode.localFace Login.-sna: Adds support for Silent Network Authentication. Note that it is only available starting from version 4.19.0.
Requirements
- Flutter 3.16 or higher (recommended)
- Flutter 1.20.0 minimum
Access prerequisites
The SDK is distributed from private Incode repositories, so access must be granted before installation succeeds. Contact your Incode representative to request both of the following for the GitHub account you will build with:
- Access to the
Incode-Technologies-Example-ReposGitHub organization, with GitHub authentication configured on your machine over SSH or HTTPS.flutter pub getresolves the SDK from a private Git repository, and iOS builds resolve the Incode CocoaPods podspec sources from the same organization. - A GitHub token with the
read:packagesscope for theandroid-omni-packagesregistry. This is the value that replacesGITHUB_TOKENin the Android setup step below. - If your iOS app builds with Swift Package Manager: a GitHub token with read access to the
Incode-Technologies-Example-Reposrepositories, stored in~/.netrc. See Swift Package Manager setup.
Add the SDK to your project
Add the SDK as a Git dependency in your pubspec.yaml. Use the block that matches the variant you need.
Standard variant
onboarding_flutter_wrapper:
git:
url: git@github.com:Incode-Technologies-Example-Repos/FlutterSampleApp.git
ref: release/[VERSION]
Camera streaming variant (-vc)
onboarding_flutter_wrapper:
git:
url: git@github.com:Incode-Technologies-Example-Repos/FlutterSampleApp.git
ref: release/[VERSION]-vc
NFC variant (-nfc)
onboarding_flutter_wrapper:
git:
url: git@github.com:Incode-Technologies-Example-Repos/FlutterSampleApp.git
ref: release/[VERSION]-nfc
Local identities variant (-l)
onboarding_flutter_wrapper:
git:
url: git@github.com:Incode-Technologies-Example-Repos/FlutterSampleApp.git
ref: release/[VERSION]-l
Silent Network Authentication variant (-sna)
onboarding_flutter_wrapper:
git:
url: git@github.com:Incode-Technologies-Example-Repos/FlutterSampleApp.git
ref: release/[VERSION]-sna
Replace [VERSION] in the ref field with the release branch name (for example, release/4.18.0). To use an older version, replace [VERSION] with the specific release branch (for example, release/4.2.0).
iOS setup
After adding the SDK to your project, complete the following iOS-specific setup steps.
The plugin supports both CocoaPods and Swift Package Manager. Flutter uses Swift Package Manager when it is turned on (the default from Flutter 3.44), and CocoaPods otherwise. Steps 1 to 4 are for CocoaPods; if your app uses Swift Package Manager, follow Swift Package Manager setup instead. Steps 5 and 6 apply to both.
1. Verify Git LFS is installed
The Incode iOS pods ship large binary assets through Git LFS. If Git LFS is not installed, those asset files are fetched as text pointers and the build fails later with an error that does not mention LFS. Install Git LFS and confirm it is active before running pod install:
git lfs install
git lfs version
2. Update the Podfile deployment target
In the ios folder, change your Podfile so it requires deployment target 15 or higher:
-platform :ios, '11.0'
+platform :ios, '15.0'
Also set the Runner target's iOS deployment target (IPHONEOS_DEPLOYMENT_TARGET) to 15.0 or higher in Xcode.
3. Add the Incode CocoaPods sources
At the top of the Podfile in the ios folder, add these source lines. CocoaPods uses them to resolve the Incode iOS pods, which requires the GitHub organization access described in Access prerequisites.
+ source 'https://cdn.cocoapods.org/'
+ source 'git@github.com:Incode-Technologies-Example-Repos/IncdDistributionPodspecs.git'
+ source 'git@github.com:Incode-Technologies-Example-Repos/IncodeBridgeCommonPodspecs.git'
4. Install pods
Run pod install within the ios folder:
pod install
5. Add permission entries to Info.plist
Add the permission entries required by the modules you plan to use:
IdScan,SelfieScan,DocumentScan,VideoSelfie(camera modules): requireNSCameraUsageDescription.Geolocationmodule: requiresNSLocationWhenInUseUsageDescription.VideoSelfiemodule voice consent step: requiresNSMicrophoneUsageDescription.NFCScanmodule: requiresNFCReaderUsageDescriptionandNSNFCUsageDescription.
6. Add the jailbreak detection URL schemes to Info.plist
The SDK checks whether known jailbreak tools are installed before it starts a flow. iOS only answers those checks for URL schemes the app declares in LSApplicationQueriesSchemes, so add the following entries to Info.plist. Without them the detection still runs, but it cannot use this check and the SDK logs a warning to the device console.
<key>LSApplicationQueriesSchemes</key>
<array>
<string>cydia</string>
<string>undecimus</string>
<string>sileo</string>
<string>zbra</string>
<string>filza</string>
<string>activator</string>
<string>installer</string>
<string>saily</string>
<string>xina</string>
<string>dopamine</string>
</array>
If your app already declares LSApplicationQueriesSchemes, keep the existing array and add only the entries from this list that are missing from it. Keep the combined list within Apple's limit: 50 entries when linked with iOS 15–26 SDKs, or 25 with iOS 27 and later. See Apple's query requirements.
Swift Package Manager setup
Use this instead of steps 1 to 4 above when your app builds its iOS plugins with Swift Package Manager. The plugin resolves the Incode iOS SDK and its iOS bridge library as Swift packages, in the same variant as the plugin version you added in Add the SDK to your project. No Incode CocoaPods sources or pod install are needed.
Use Flutter 3.41 or higher: the plugin's Swift package needs the
FlutterFrameworkpackage, which older versions don't create. Swift Package Manager is on by default from Flutter 3.44. On 3.41 to 3.43, turn it on:flutter config --enable-swift-package-managerGive Swift Package Manager access to the Incode repositories. The SDK binaries are downloaded from GitHub, so add a GitHub token with read access to the
Incode-Technologies-Example-Reposrepositories to~/.netrc:machine github.com login <github-user> password <token> machine api.github.com login <github-user> password <token>Build the app as usual, for example with
flutter runorflutter build ios. On the first build, Flutter adds the Swift packages to your Xcode project and resolves them.
To check which channel your build uses, open ios/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved: it lists incddistributionspm when the Incode SDK comes from Swift Package Manager. To go back to CocoaPods, run flutter config --no-enable-swift-package-manager and flutter clean, then follow steps 1 to 4 above.
Android setup
After adding the SDK to your project, complete the following Android-specific setup steps.
1. Update app/build.gradle
In app/build.gradle, enable multiDexEnabled and set the minimum API level. Use API level 23, or API level 24 if you are using the video streaming dependency. Set compileSdkVersion to 36, which the SDK requires.
android {
+ compileSdkVersion 36
defaultConfig {
…
multiDexEnabled true
minSdkVersion 23
}
}
Add the packaging exclusion required by the SDK's OkHttp 5.3.2 dependency:
android {
+ packaging {
+ resources {
+ excludes += ['META-INF/versions/9/OSGI-INF/MANIFEST.MF']
+ }
+ }
}
2. Configure the GitHub Packages repository
Modify your project's build.gradle to include the GitHub Packages repository. Replace GITHUB_TOKEN with the read:packages token from Access prerequisites.
allprojects {
repositories {
...
+ maven { url "https://jitpack.io" }
+ maven {
+ url = uri("https://maven.pkg.github.com/Incode-Technologies-Example-Repos/android-omni-packages")
+ credentials {
+ username = "incode-customers"
+ password = "GITHUB_TOKEN"
+ }
+ }
...
}
}
3. Set the Kotlin, AGP and Gradle versions
The SDK is compiled with Kotlin 2.2.21, so any module that compiles Kotlin source with the SDK on its classpath needs Kotlin Gradle plugin 2.2.21 or newer. compileSdk 36 additionally requires Android Gradle Plugin 8.9.1+ and Gradle 8.14.5+.
In android/settings.gradle:
plugins {
id "dev.flutter.flutter-plugin-loader"
+ id "com.android.application" version "8.9.1" apply false
+ id "org.jetbrains.kotlin.android" version "2.2.21" apply false
}
In android/gradle/wrapper/gradle-wrapper.properties:
+ distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.5-bin.zip
If you set the Kotlin plugin through a buildscript block instead:
buildscript {
+ ext.kotlin_version = '2.2.21'
dependencies {
...
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
4. Set the coroutines version (conditional)
The SDK requires kotlinx-coroutines 1.9.0 or newer. CameraX 1.6.1 pulls it in transitively, so no declaration is needed unless you pin coroutines explicitly:
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.9.0'
5. Add optional dependencies for Face Login (conditional)
If you plan to use 1:N Face Login with FaceAuthMode.local, add the following dependencies to your app/build.gradle:
com.incode.sdk:model-liveness-detection:[VERSION]: enables local liveness detection.com.incode.sdk:model-face-recognition:[VERSION]: enables local face recognition.
See Face Login for details on local authentication mode.
Release builds
No extra configuration is required for App Store or Google Play releases. The SDK reports the wrapper platform and version (for example Flutter [VERSION]) to the Incode dashboard, which is how a session is identified as coming from the Flutter SDK rather than a native integration. The markers carrying that information are protected against release-build stripping on both platforms:
- Android: the wrapper identity is read by reflection, which R8 cannot see. The plugin ships a keep rule via
consumerProguardFiles, and Gradle merges it into your app automatically, so the marker survivesminifyEnabled truewith shrinking and obfuscation. You do not need keep rules of your own. If your app replaces the merged consumer rules or runs a post-processing step that strips them, the dashboard will stop attributing sessions to Flutter. - iOS: the wrapper identity is exposed as Objective-C class metadata, which lives in a Mach-O section the linker never dead-strips and the App Store symbol-stripping step never removes. It is resolved through the Objective-C runtime rather than the symbol table, so stripped release archives still report correctly.
Update to the latest version
To update the SDK to the latest version, run one of the following:
flutter pub upgrade
or
flutter packages upgrade
With Swift Package Manager, the next flutter build ios or flutter run resolves the new iOS SDK version; in Xcode you can also use File → Packages → Update to Latest Package Versions. With CocoaPods, if the iOS SDK version was updated, also run the following inside your ios folder:
pod install --repo-update
pod update IncdOnboarding
Initialize the SDK
Initialize the SDK before calling any other SDK methods. Incode provides your apiKey and apiUrl.
IncodeOnboardingSdk.init(
apiKey: 'YOUR_API_KEY',
apiUrl: 'YOUR_API_URL',
testMode: false,
onError: (String error) {
IncodeSdkInitError? e = error.toIncodeSdkInitError();
switch (e) {
case IncodeSdkInitError.simulatorDetected:
print('Incode init failed, simulator detected: $IncodeSdkInitError.simulatorDetected');
break;
case IncodeSdkInitError.testModeEnabled:
print('Incode init failed, test mode enabled: $IncodeSdkInitError.testModeEnabled');
break;
default:
print('Incode init failed: $error');
break;
}
},
onSuccess: () {
// Update UI, safe to start Onboarding
print('Incode initialize successfully!');
},
);
Init parameters
The parameters most commonly set during initial integration are:
apiKey: String. Provided by Incode.apiUrl: String. Provided by Incode.testMode: bool. Set totruewhen running on a simulator.onSuccess: Callback invoked when initialization succeeds. Safe to start onboarding from here.onError: Callback invoked when initialization fails. Receives an error codeString; possible values are listed in theIncodeSdkInitErrorenum:simulatorDetected,testModeEnabled,invalidInitParams,configError, andunknown.
The SDK supports additional optional parameters for logging, SDK mode, security, and analytics. See init on the API Reference page for the full parameter list. Tutorial screens are configured per module with showTutorials — see Modules.
Initializing without an API key
To initialize the SDK without an apiKey, provide only the apiUrl to the init method, then configure your OnboardingSessionConfiguration with a token. See Token-Based Setup for details.