Skip to main content

Incode Welcome Capture SDK Usage

Features​

Suppoted modules: ID/Passport capture and Selfie capture.

APIs perform local checks and auto-capture the photo when conditions are met.

Returns the captured photo through a callback.

API calls are completely decoupled (can be called in any order and any number of times).

License is verified on each app startup.

Doesn't perform any network operations except the license check call.

1. Initialize Welcome SDK​

Add the following line of code to your class that extends the MultidexApplication class.

@Override
public void onCreate() {
super.onCreate();
...
new IncodeWelcome.Builder(this, WELCOME_API_URL, WELCOME_API_KEY)
.setLoggingEnabled(loggingEnabled) // enable/disable logcat logs. logs are enabled by default
.setSdkMode(SdkMode.CAPTURE_ONLY) // enable CAPTURE_ONLY mode
.build();
...
}

WELCOME_API_URL and WELCOME_API_KEY will be provided to you by Incode.
Create an IncodeWelcome object using the Builder class and build() method.
Make sure to set SDK mode to SdkMode.CAPTURE_ONLY.
Optionally specify SSL Config for your own on-premise servers.
Optionally disable logs.
Call the build() method to create the IncodeWelcome singleton object.
You can use the following API calls only after the SDK has been initialized using the build().

Review the API Javadocs for complete specification of IncodeWelcome.Builder class.

2. Verify SDK license on each application cold start​

This call can be omitted. In that case license will be verified implicitly first time when you call any of the capture SDK APIs.

IncodeWelcome.getInstance().verifyApiKey(new IncodeWelcome.VerifyListener() {
@Override
public void onVerified() {
// License is verfied
}

@Override
public void onError() {
// License verification error occurred. Please make sure you have working internet connection and valid API key.
}
});

3. Perform capture SDK calls​

IncodeWelcome.getInstance().setSdkMode(com.incode.welcome_sdk.SdkMode.CAPTURE_ONLY);
try {
IdScan idScan = new IdScan.Builder()
.setShowIdTutorials(true)
.build();

OnboardingConfigV2 configV2 = new OnboardingConfigV2.OnboardingConfigBuilderV2()
.setFlowTag("ID scan section")
.addIDScan(idScan)
.build();

IncodeWelcome.getInstance().startOnboardingSection(this, null, configV2, new IncodeWelcome.OnboardingListenerV2() {
@Override
public void onIdValidationCompleted(IdValidationResult idValidationResult) {
// Use idValidationResult to read the result photos
}

@Override
public void onError(Throwable error) {
}

@Override
public void onUserCancelled() {
}

@Override
public void onOnboardingSectionCompleted(String flowTag) {
// ID scan section complete
}
}
);
} catch (ModuleConfigurationException e) {
e.printStackTrace();
}
IncodeWelcome.getInstance().setSdkMode(com.incode.welcome_sdk.SdkMode.CAPTURE_ONLY);
try {
SelfieScan selfieScan = new SelfieScan.Builder()
.setShowTutorials(true)
.build();

OnboardingConfigV2 configV2 = new OnboardingConfigV2.OnboardingConfigBuilderV2()
.setFlowTag("Selfie scan section")
.addSelfieScan(selfieScan)
.build();

IncodeWelcome.getInstance().startOnboardingSection(this, null, configV2, new IncodeWelcome.OnboardingListenerV2() {
@Override
public void onSelfieScanCompleted(SelfieScanResult selfieScanResult) {
// Use selfieScanResult to read the result photo
}

@Override
public void onError(Throwable error) {
}

@Override
public void onUserCancelled() {
}

@Override
public void onOnboardingSectionCompleted(String flowTag) {
// Selfie scan section complete
}
}
);
} catch (ModuleConfigurationException e) {
e.printStackTrace();
}