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

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

//instantiate the class
RetryOnFailurePolicy retryOnFailurePolicy = new RetryOnFailurePolicy();

//set the number of times a retry should be attempted before giving up 
retryOnFailurePolicy.setRetryCount(10);

//set the spacing in milliseconds between consecutive retries
retryOnFailurePolicy.setRetryTimeout(TimeUnit.SECONDS.toMillis(15));

2.setMode setSmileIdNetData

Takes a parameter of the enum SIDConfig.Mode described below\

//auth type jobs eg job type 2 and job type 8
SIDConfig.Mode.AUTHENTICATION

//enroll/register type jobs eg 1 and 4
SIDConfig.Mode.ENROLL

3. setSmileIdNetData

Takes a parameter of the class SIDNetData described below

//for the test environment 
SIDNetData data = new SIDNetData(<Context>, SIDNetData.Environment.TEST);

//for the prod environment 
SIDNetData data = new SIDNetData(<Context>, SIDNetData.Environment.PROD);

4. � setGeoInformation

Takes a parameter of class GeoInfos described below

//instantiate the class
GeoInfos infos = new GeoInfos();

//sets the accuracy of the location in meters
infos.setAccuracy(accuracy);

//sets the altitude
infos.setAltitude(altitude);

//sets the latitude
infos.setLatitude(latitude);

//sets the longitude
infos.setLongitude(longitude);

//sets the last updated elapsed time
infos.setLastUpdate(lastUpdate);

//confirms the permissions have been granted or not
infos.setGeoPermissionGranted(mGeoPermissionGranted);

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

//Instantiation
SIDMetadata metadata = new SIDMetadata();

//To get the user id information
 SIDUserIdInfo userIdInfo = metadata.getSidUserIdInfo();
 
//To get the partner parameters
PartnerParams params  = metadata.getPartnerParams();

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

SIDNetData data = new SIDNetData();
....//other SIDNetData settings
data.setCallBackUrl(https://example.com/callback);

SIDConfig SUMMARY

SIDConfig sidConfig = new SIDConfig.Builder(this)
        .setRetryOnfailurePolicy(getRetryOnFailurePolicy())
        .setMode(SIDConfig.Mode.ENROLL)
        .setSmileIdNetData(data)
        .setGeoInformation(infos)
        .setSIDMetadata(metadata)
        .setAllowNewEnroll(<true/false>) ==> will allow reuse of user ids
        .useEnrolledImage(<true/false>) ==> will allow to update enrolled selfie
        .setJobType(jobType)
        .useIdCard(useIdCard)
        .build();

�Submit The Job

//Instantiate SIDNetworkRequest object to send 
SIDNetworkRequest mSINetworkrequest = new SIDNetworkRequest(this);
...
...
...
//submit the job
mSINetworkrequest.submit(sidConfig);

Last updated