Library Breakdown

This page is being constructed

API

protocol CaptureSelfieDelegate

func onComplete( previewUIImage : UIImage? ) onComplete is called by the CaptureSelfie object to tell the delegate when the capture selfie process is complete. All of the selfie frames and the full preview image have been captured. Parameters: previewUIImage The captured selfie image that can be displayed in the UI. func onError( sidError : SIDError ) onError is called by the CaptureSelfie object to tell the delegate when an error occurs when capturing a selfie. Parameters sidError Contains the type of error that is returned. The error message can be displayed as a string by using sidError.message.

class CaptureSelfiefunc setup( captureSelfieDelegate: self,userTag:SmileIDSingleton.DEFAULT_USER_TAG,lblPrompt: lblPrompt,previewView: previewView,useFrontCamera : Bool )

Initializes the CaptureSelfie object. Parameters

captureSelfieDelegate The delegate that is used to communicate back to the caller. userTag The custom user taglblPrompt Used to display prompts to the user such as “Smile”previewView Captures the selfie frames. useFrontCamera : Indicates whether the client has chosen to use the front or back camera. func start( screenRect : CGRect ) Starts frame capturing for the selfie frames and preview frame. Parameters screenRect The rectangle that contains the boundaries used by the camera func manualCapture( isManualCapture : Bool )

Parameters

isManualCapture : Tells the CaptureSelfie object to use the selfie image from the next captured frame.

class VideoPreviewViewUsed to capture a selfie frames.

protocol CaptureIDCardDelegatefunc

onComplete( previewUIImage : UIImage ) onComplete is called by the CaptureIDCard object to tell the delegate when the capture id card process is complete.

Parameters

previewUIImage The captured selfie image that can be displayed in the UI.

func onError( sidError : SIDError ){} onError is called by the CaptureIDCard object to tell the delegate when an error occurs when capturing an id card. Parameters

sidError Contains the type of error that is returned. The error message can be displayed as a string by using sidError.message.

class CaptureIDCard func setup( captureIDCardDelegate: self, previewView: previewView,userTag:SmileIDSingleton.DEFAULT_USER_TAG )Initializes the CaptureIDCard object.

Parameters

previewView Captures the id card image.userTag The custom user tag func start() Starts the id card capture process protocol SIDNetworkRequestDelegatefunc onComplete() onComplete is called by the SIDNetworkRequest object to tell the delegate when the entire upload process has completed. Completion can either be success or failed.func onError(sidError: SIDError) {}onError is called by the SIDNetworkRequest object to tell the delegate that an error occured in the authentication upload process. Parameters

sidError Contains the type of error that is returned. The error message can be displayed as a string by using sidError.message. func onAuthenticated( sidResponse : SIDResponse ) onAuthenticated is called by the SIDNetworkRequest object to tell the delegate when the upload process is complete for authentication.

Parameters

sidResponse Contains fields to check for success or failure, confidence value, and the partner parameters. func onEnrolled( sidResponse : SIDResponse ) onEnrolled is called by the SIDNetworkRequest object to tell the delegate when the upload process is complete for enrollment.

Parameters

sidResponse Contains fields to check for success or failure, confidence value, and the partner parameters. func onStartJobStatus() onStartJobStatus is called by the SIDNetworkRequest object to tell the delegate when the upload job status step starts. func onEndJobStatus() onEndJobStatus is called by the SIDNetworkRequest object to tell the delegate when the upload job status step ends. func onUpdateJobProgress( progress : Int ) Parameters

progress Contains the updated progress func onUpdateJobStatus( msg : String )onUpdateJobStatus is called by the SIDNetworkRequest object to tell the delegate about the upload job status retries. Parametersmsg Contains the job status details class SIDNetworkRequest func initialize()Initializes the SIDNetworkRequest object.func setDelegate( delegate : SIDNetworkRequestDelegate)Parametersdelegate Sets the callback delegate for the upload operations. func submit( sidConfig : SIDConfig ) Starts the upload process for a single user tag. Parameters sidConfig Contains the parameters necessary for performing the upload, such as the SIDNetworkURL and SIDConfig objects func submitAll( sidConfig : SIDConfig ) Starts the upload process for batch mode. Parameters sidConfig Contains the parameters necessary for performing the upload, such as the SIDNetworkURL and SIDConfig objects class SIDNetworkUtilsfunc isConnected() -> BoolReturns true if connected, false if not. class RetryOnFailurePolicyRetryOnFailurePolicy contains values that control how the upload is retried in case of failure.maxRetryCount : Controls the number of retries for uploading the job status. The default is 2.maxRetryTimeoutSec : Controls the time in between retries. The default is 5 seconds. These settings can be accessed using getter and setter methods : func setMaxRetryCount( maxRetryCount : Int ) func getMaxRetryCount() func setMaxRetryTimeoutSec( maxRetryTimeoutSec : Int ) func getMaxRetryTimeoutSec() class SIDNetDataSIDNetData contains the settings defined in SIDNetURL. These settings can be accessed using getter and setter methods :func setAuthToken( authToken : String )func getAuthToken() func setAuthUrl( authUrl : String )func getAuthUrl() func setPartnerUrl( partnerUrl : String )func getPartnerUrl() func setPartnerPort( partnerPort : String )func getPartnerPort() func setLambdaUrl( lambdaUrl : String )func getLambdaUrl() func setJobStatusUrl( jobStatusUrl : String )func getJobStatusUrl() func setSidAddress( sidAddress : String )func getSidAddress() func setSidPort( sidPort : String )func getSidPort() class SIDConfig contains the SIDNetData and the RetryOnFailurePolicy objects. It is sent as a parameter to the SIDNetworkRequest submit function.func build(userTag:SmileIDSingleton.DEFAULT_USER_TAG)The build function sets up the environment for the upload.ParametersuserTag: The custom user tag

class SIDResponsegetResultText() -> [String]A text field containing result text returned from the sdk.

getConfidenceValue() -> IntReturns the confidence value.

isSuccess() -> Bool If true, the operation was successful. If false, the operation failed.

getPartnerParams() -> PartnerParamsThe partner parameters returned from the server.

class PartnerParamsgetUserId() -> StringGets the user id value for this partnersetUserId( userId : String )Sets the user id for this

partnerParametersuserId The user id to set

getJobId() -> StringGets the job id value

setJobId( jobId : String )Sets the job idParametersjobId The job id to set getJobType() -> IntGets the jobType

setJobType( jobType : Int )Sets the job typeParametersjobType The job type to set

getAdditionalValue( key : String ) -> AnyGets a custom value from the additional values dictionary by keyParameterskey The key used to get the corresponding value.

setAdditionalValue( key: String, value : Any ) Sets a custom value into the additional values dictionary by key.Parameterskey The key used to set the corresponding valuevalue

The value to set class SelfieCaptureConfigsetMaxFrameTimeout( maxFrameTimeout : Int )

Controls how many camera frames containing a detectable face should occur before the selfie capture process times out. After the timeout, the selfie capture process completes. The default value is 120 frames. The minimum value is 8.

ParametersmaxFrameTimeout : The maximum number of frames class SIDInfosManagerclearData( userTag : String )Clears all data for the given userTag.Parameters

userTag: The userTag to clear

hasSelfies( userTag : String ) -> BoolReturns a Bool value indicating if the given userTag has selfie images.

Parameters

userTag: The userTag to check

hasIdCard( userTag : String ) -> BoolReturns a Bool value indicating if the given userTag has an id card image.

Parameters

userTag: The userTag to check

getIdleTags() -> [String] Returns a list of userTags that have not been uploaded yet.

getLastEnrolledJobId() -> [String] Returns the last enrolled job id

getUserId() -> [String] Returns the user id from a previously enrolled user. This user id is available if the enroll operation was done on the same phone. It is overwritten each time an enroll operation is performed.

The SIDErrorSIDError class is an enum that contains the errors used by the Smile Identity SDK. To get the details of the error as a String, use the message field. For example : print ( sidError.message ) will print the error details, where sidError is an SIDError object.

The following is a list of error messages :

  1. Unable to initialize the selfie camera.

  2. Your device doesn't support a front facing selfie camera.

  3. Your device doesn't support a back facing camera.ID Card capture failed.

  4. ID Card picture callback failed.ID Card auto focus failed.ID Card touch focus failed.

  5. ID Card draw view failed.ID Card camera initialization failed.

  6. Unable to submit.Unable to submit.

  7. File packaging error.Failed to submit. Could not upload ZIP file.

  8. Failed to submit.

  9. Could not create ZIP file.

  10. Failed to submit.

  11. Failed to transmit to server.

  12. Failed to submit.

  13. Could not authorize.

  14. Failed to submit.

  15. Failed to transmit to server.

  16. Failed to submit.

  17. Could not authorize.

  18. Failed to authenticate.

  19. Could not verify.

  20. Some server error occurred, Please try again.

  21. Either operation is timed out or you cancelled the running operation.

  22. You need to SignUp again to continue.

  23. Either operation is timed out or you cancelled the running operation.

  24. Please try submitting again.

  25. Previous enroll failedEnroll failed

  26. Data packaging failed, no resources to package found, or operation has been canceled

  27. Previous enroll failed

  28. Packaging failed no selfie found

  29. No Selfie Found

  30. Job type requires an ID Card image.

  31. Authentication failed enroll not foundTransaction Failed, Retry AgainCannot execute operation,

  32. No job found for provided tagUnable to capture selfie image

  33. Unable to capture selfie preview image

  34. Unable to create selfie preview ui imageUnable to batch upload enroll tags.

  35. Not in enroll mode.

  36. An unknown error occurred.