Submit A Job
A job is a Smile ID complete process from Selfie and ID Card Capture to the submission to the servers and response from the server this guide describes how to send information from device to server.

SIDConfig

SIDConfig

This is the core part of a Smile ID job configuration which has information on how information should be sent and has 7 main methods
This is the core part of a Smile ID job configuration which has information on how information should be sent and has 7 main methods
1.setRetryOnfailurePolicy
Takes a parameter of class RetryOnFailurePolicy which is described below
1
//instantiate the class
2
RetryOnFailurePolicy retryOnFailurePolicy = new RetryOnFailurePolicy();
3
4
//set the number of times a retry should be attempted before giving up
5
retryOnFailurePolicy.setRetryCount(10);
6
7
//set the spacing in milliseconds between consecutive retries
8
retryOnFailurePolicy.setRetryTimeout(TimeUnit.SECONDS.toMillis(15));
Copied!
2.setMode setSmileIdNetData
Takes a parameter of the enum SIDConfig.Mode described below
1
//auth type jobs eg job type 2 and job type 8
2
SIDConfig.Mode.AUTHENTICATION
3
4
//enroll/register type jobs eg 1 and 4
5
SIDConfig.Mode.ENROLL
Copied!
3. setSmileIdNetData
Takes a parameter of the class SIDNetData described below
1
//for the test environment
2
SIDNetData data = new SIDNetData(<Context>, SIDNetData.Environment.TEST);
3
4
//for the prod environment
5
SIDNetData data = new SIDNetData(<Context>, SIDNetData.Environment.PROD);
Copied!
4. setGeoInformation
Takes a parameter of class GeoInfos described below
1
//instantiate the class
2
GeoInfos infos = new GeoInfos();
3
4
//sets the accuracy of the location in meters
5
infos.setAccuracy(accuracy);
6
7
//sets the altitude
8
infos.setAltitude(altitude);
9
10
//sets the latitude
11
infos.setLatitude(latitude);
12
13
//sets the longitude
14
infos.setLongitude(longitude);
15
16
//sets the last updated elapsed time
17
infos.setLastUpdate(lastUpdate);
18
19
//confirms the permissions have been granted or not
20
infos.setGeoPermissionGranted(mGeoPermissionGranted);
Copied!

5. setSIDMetadata

Takes a parameter of class SIDMetadata which is is an object used to send two different kinds of metadata the first one being the User id information and partner parameters which can be associated with jobs to instantiate the metadata object you do the below
1
//Instantiation
2
SIDMetadata metadata = new SIDMetadata();
3
4
//To get the user id information
5
SIDUserIdInfo userIdInfo = metadata.getSidUserIdInfo();
6
7
//To get the partner parameters
8
PartnerParams params = metadata.getPartnerParams();
Copied!
For more information on this checkout this guide

5. setJobType

Takes an integer parameter and sets the job type for more information on this checkout this guide on job types
6. useIdCard
Takes a boolean parameter confirming if this job has an id card image associated with it

7. (Optional) Set a callback url

From version 6.4.2 there is added functionality to set custom callback using the SDK, this can be done by using the SIDNetData class. After setting the other settings in this class then call the methodsetCallBackUrl as in the example below
If the call back URL is not set from the SDK it will always default to the setting on the backend.
More information on callback URL can be found here
1
SIDNetData data = new SIDNetData();
2
....//other SIDNetData settings
3
data.setCallBackUrl(https://example.com/callback);
Copied!

SIDConfig SUMMARY

1
SIDConfig sidConfig = new SIDConfig.Builder(this)
2
.setRetryOnfailurePolicy(getRetryOnFailurePolicy())
3
.setMode(SIDConfig.Mode.ENROLL)
4
.setSmileIdNetData(data)
5
.setGeoInformation(infos)
6
.setSIDMetadata(metadata)
7
.setJobType(jobType)
8
.useIdCard(useIdCard)
9
.build();
Copied!

Submit The Job

1
//Instantiate SIDNetworkRequest object to send
2
SIDNetworkRequest mSINetworkrequest = new SIDNetworkRequest(this);
3
...
4
...
5
...
6
//submit the job
7
mSINetworkrequest.submit(sidConfig);
Copied!
Last modified 1mo ago