Job Submission
The job submission method sends the information to the Smile ID servers for processing and returns results when done. To improve UX, there are event-based callbacks during this process.
Import the Library
Submit the Job
tag: Required. If this job type involves a selfie, it must be a tag that has already captured a job before this method is called.
jobType: Required. Must be a valid job type as listed on the products page on the left.
isProduction: Required. Boolean value (true or false). If false, the jobs will be sent to sandbox; if true, jobs will be sent to production.
partnerParams: (Optional) A JavaScript object as shown below. This object can have a
user_id
and/or ajob_id
, all of which, if not passed, will be autogenerated. It can also take other parameters that you may need back to identify the job, as long as they do not conflict with the reserved keys_job_id
,user_id
,job_type
.
idInfo: (Optional) Mandatory for document verification but used as needed for job type Enhanced KYC + SmartSelfie. The object is described below:
geoInfo: (Optional) Used if you need to record geo-location information associated with the job.
callbackUrl: (Optional) Sets the URL to send the callback results to. For more information on the callback URL, please read here.
jobStatusPollingTimeoutMillis: (Optional) Pass 0 if not needed. This will be the time to wait for job status polling. Note that if set to a smaller number, this will return a complete false result from job status, and results will be delivered to the callback.
Events
During the processing of the job, the SDK provides different events to signify the stage where the job is currently at.
The SIDReactNativeEventEmitter
provides these events and is accessible via the following steps:
Import the NativeModules Component
Setup the Emitter
Listen to the Upload Event
This will return an integer wrapped in a string signifying how much of the zip file has been uploaded, represented as a percentage relative to the file size.
Listen to the Completion Event
This will return a status of "done" when the upload is finished.
Get Results
The method will return a result accessible in our example as result.result
. This object is documented in the return value section of your chosen product type under the products section on the left. The most important of these is the result.ResultCode, which shows the state and result from the job you have just run.
Last updated