Enhanced KYC

Previously and also when sending job in the SDK this is set as job type 5

Running Enhanced KYC on the IOS SDK

  1. Get the ID information from your users

  2. Submit the Job to Smile ID

  3. Interpret your results

Get the ID information from your users

It is important that this information is gathered according to supported id types and required information as listed on this section. Please ensure that data is validated before sending information over to avoid unnecessary errors.

Submit the Job to Smile ID

//To get the user id information
var userIdInfo = SIDUserIdInfo()
 
//To get the partner parameters
var partnerParams = PartnerParams()

SIDMetadata is useful for information that needs to be sent to Smile ID, it provides a way of setting PartnerParams which are useful for sending job related information and SIDUserInfo which is useful for sending user id related information. Once instantiated please reuse the same instance per job but it's important to make sure this is not reused across jobs

Step 1.Set the User Identity Information to be validated

var userIdInfo = SIDUserIdInfo()
userIdInfo.setCountry(country : <String>); //String Alpha-2 country code
userIdInfo.setFirstName(firstName: <String#>); // String
userIdInfo.setLastName(lastName: <String>); // String
userIdInfo.setIdNumber(idNumber: <String>); // String
userIdInfo.setIdType(idType : <String>); // String

//Useful if there is anything which is not catered
//for by the strongly typed methods above so you can add
//for example dob as a key and the date as the value
userIdInfo.additionalValue( name : String, value : String );//String for both key and value
var partnerParams = PartnerParams()
partnerParams.setJobId(jobId: <#T##String#>)// unique identifier string per job
partnerParams.setUserId(userId: <#T##String#>)// unique identifier for the user information being processed
partnerParams.setAdditionalValue(key: <#T##String#>, val: <#T##Any#>)//string key and value
                                            // for anything etra which you may need associated with the job

Step 3:Create the config

//Set the environment which can be either
// SIDNetData.Environment.PROD or  SIDNetData.Environment.TEST
//

let sidNetData = SIDNetData(environment: SIDNetData.Environment.PROD)

// the instance of SIDNetworkRequest which is responsible for handling 
//api calls and callbacks to your app
let sidNetworkRequest = SIDNetworkRequest()
sidNetworkRequest.setDelegate(delegate: <SIDNetworkRequestDelegate>)// an instance of SIDNetworkRequestDelegate
//which has various callback methods to your app
sidNetworkRequest.initialize()

let sidConfig = SIDConfig()
sidConfig.setSmileIdNetData(data) //Environment information
sidConfig.setSidNetworkRequest( sidNetworkRequest : sidNetworkRequest )
sidConfig.setUserIdInfo(userIdInfo: <SIDUserIdInfo>) // set user id info
sidConfig.setPartnerParams(partnerParams: <PartnerParams>) //set partner params
sidConfig.setJobType(5);//int must be set to 5
sidConfig.build(userTag:<String>) Job identifier

Step 4: Submit the Job

sidConfig.getSidNetworkRequest().submit(sidConfig: sidConfig )

Step 5: Interpret your results

IDValidationResponse object will contain results returned from the api this contains strongly typed method to get the response as individual items or as json object or as a string, for more information on how to interpret results you can read more about result codes and responses in the Enhanced KYC section of the docs.

Last updated