Presenting Screens

The SDK provides different pathways to presenting the same screens to avoid a stringent user experience whilst integrating

Step 1 : Call Smile UI

Call the required screen or screens as per the example below

SIDCaptureManager.Builder(delegate: <delegate>, captureType: <CaptureType>)

The above will call a screen as per the CaptureType specified and you have 4 options to choose from

CaptureType.SELFIE Will show the selfie screen then the review screen before sending the results back to your application

CaptureType.ID_CAPTURE Will show the ID card capture screen then send results back to your application

CaptureType.SELFIE_AND_ID_CAPTURE Will show the selfie screen then the review screen and then the id card capture screen before sending the results back to your application CaptureType.ID_CAPTURE_AND_SELFIE Will show the id card capture screen then the selfie screen then the review screen and before sending the results back to your application.

Step 2: Get Results Using from the delegate

The delegate will have a two methods which are called from when the capture is either complete or there has been an error

SIDCaptureManagerDelegate

Success

func onSuccess(tag:String,selfiePreview:UIImage?,idFrontPreview:UIImage?,idBackPreview:UIImage?)
  • Tag String:this is either the tag supplied to the manager or if none was supplied this is an autogenerated tag from the SDK identifying the job

  • selfiePreview:UIImage? This is the image from the preview capture which is shown on the review screen only will be returned if there was a selfie capture specified

  • idFrontPreview:UIImage? This is the front of document capture and only will be returned if there was a id document front capture is specified

  • idBackPreview:UIImage? This is the front of document capture and only will be returned if there was a id document back capture is specified

Error

func onError(tag:String,sidError:SIDError)
  • Tag String:this is either the tag supplied to the manager or if none was supplied this is an autogenerated tag from the SDK identifying the job

  • sidError:SIDError: The failure reason

Possible values for error are

SIDError.UNABLE_TO_CAPTURE_ID_CARD_IMAGE

SIDError.UNABLE_TO_CAPTURE_SELFIE_PREVIEW_IMAGE

SIDError.UNABLE_TO_CAPTURE_FRONT_OF_ID

SIDError.UNABLE_TO_CAPTURE_BACK_OF_ID

SIDError.ID_CAPTURE_CLOSED

Last updated