Running your First Job

  1. Make the ViewController be a delegate for the upload callbacks

    class MyUploadResultViewController: UIViewController,
  2. Create a method that creates a SIDConfig object. SIDConfig, SIDNetData, and SIDNetworkRequest are implemented in the Smile Identity SDK. SIDNetURL is defined in the application. It contains specific definitions for the urls that are used in for the upload.

    class SIDNetURL

    SIDNetURL contains values that are app specific.




    The URL to the Smile ID Partners Authorisation Server - performs business logic before running a job *Note this is not the callback URL


    The port used for for the Authorisation Server


    The endpoint Smile ID will hit in order to get Authorisation to kick off a job


    The endpoint Smile ID uses to return Job Status


    Currently unused. The value is bundled with the configuration parameters and uploaded with the metadata.


    Currently unused. The value is bundled with the configuration parameters and uploaded with the metadata

    User id, job id, job type and custom parameters can be set in the partnerParams.

    RetryOnFailurePolicy can be customized. See the API documentation below for details.

    The function has a userTag parameter. userTag is the custom user tag. In this example, it is send the default user tag value that is defined in the SmileIDSingleton. For example, here is a function that creates an SIDConfig object.

    SIDConfig object.func createConfig() -> SIDConfig {
    let sidNetworkRequest = SIDNetworkRequest()
    sidNetworkRequest.setDelegate(delegate: self)
    let sidNetData = SIDNetData();
    sidNetData.setAuthToken( authToken :SIDNetUrl.AUTH_TOKEN )
    sidNetData.setPartnerUrl(partnerUrl:SIDNetUrl.PARTNER_URL )
    sidNetData.setPartnerPort( partnerPort :SIDNetUrl.PARTNER_PORT )
    sidNetData.setLambdaUrl( lambdaUrl:SIDNetUrl.LAMBDA_URL )
    sidNetData.setJobStatusUrl( jobStatusUrl:SIDNetUrl.JOB_STATUS_URL )
    sidNetData.setSidAddress( sidAddress :SIDNetUrl.SID_ADDRESS )
    sidNetData.setSidPort( sidPort :SIDNetUrl.SID_PORT )
    let sidConfig = SIDConfig()
    sidConfig.setSidNetworkRequest( sidNetworkRequest :sidNetworkRequest )
    sidConfig.setSidNetData( sidNetData : sidNetData )
    sidConfig.setRetryOnFailurePolicy( retryOnFailurePolicy:
    getRetryOnFailurePolicy() )
    let partnerParams = PartnerParams()
    if( isEnrollMode ){
    sidConfig.setIsEnrollMode( isEnrollMode: true )
    sidConfig.setUseIdCard( useIdCard: hasId )
    sidConfig.setIsEnrollMode( isEnrollMode : false )
    partnerParams.setJobType(jobType: jobType )
    sidConfig.setPartnerParams( partnerParams :
    partnerParams )
    return sidConfig
  3. To start the send the Job to Smile ID, add the following lines. For example, this could added into an IBAction method for a button.

    let sidConfig = createConfig() userTag:SmileIDSingleton.DEFAULT_US
    ER_TAG )
    try sidNetworkRequest!.submit( sidConfig:
    sidConfig )

  4. Implement the SIDNetworkRequestDelegate callbacks