LogoLogo
  • Welcome!
  • GETTING STARTED
    • Signing Up
    • Choose a Product
    • Choose an Integration Option
    • Run Your First Test Job
    • Complete Your KYC
    • Fund Your Wallet
    • Go Live!
    • Pricing
  • SUPPORTED ID TYPES & DOCUMENTS
    • For Individuals (KYC)
      • Using ID Number
        • Supported Countries
          • Côte d'Ivoire
            • National ID (without Photo)
            • Resident ID (without Photo)
          • Ghana
            • Ghana Card
            • Passport
            • Voter's ID
          • Kenya
            • Alien Card
            • KRA Pin
            • National ID
            • National ID (without Photo)
            • Passport
            • Tax Information
          • Nigeria
            • Bank Account
            • BVN
            • NIN V2
            • NIN Slip Verification
            • V_NIN (Virtual NIN)
            • Phone Number
            • Voter's ID
          • South Africa
            • National ID
            • National ID (without Photo)
            • Phone Number
          • Uganda
            • National ID (without Photo)
            • Basic KYC in Uganda
          • Zambia
            • Bank Account
            • TPIN
          • Zimbabwe
            • National ID (without Photo)
        • Test Data
          • Customising Sandbox Test Data
        • ID Number Regex
        • Visual Samples of Supported ID Types
      • Using Document Image
        • Continents
          • Africa
          • Asia and the Middle East
          • Europe
          • North America
          • Oceania
          • South America
    • For Businesses (KYB)
      • Supported Countries
        • Nigeria
          • Business Registration
          • Tax Information
        • Kenya
          • Business Registration
        • South Africa
          • Business Registration
      • ID Number Regex
  • PRODUCTS
    • For Individuals (KYC)
      • AML Check
        • AML News Media
      • Basic KYC
      • Biometric KYC
      • Digital Address Verification
      • Document Verification
        • Document Verification
        • Enhanced Document Verification
      • Electronic Signature
      • Enhanced KYC
      • Phone Number Verification
      • SmartSelfie™ Authentication
      • SmartSelfie™ Compare
      • Smile Secure
    • For Businesses (KYB)
      • Business Verification
  • Integration Options
    • Mobile
      • Getting Started
      • Products
        • Biometric KYC
        • BVN Consent
        • Document Verification
        • Enhanced Document Verification
        • Enhanced KYC
        • SmartSelfie™ Enrollment and Authentication
        • Enhanced SmartSelfie™ Enrollment And Authentication
      • Customization
        • UI Components
      • Offline Mode
      • Release Notes
        • Android Release Notes
        • iOS Release Notes
        • Flutter Release Notes
        • React Native Release Notes
    • No-Code
      • Smile Links
        • Link FAQs
        • Rest API
    • Server to Server
      • Ruby
        • Installation
        • Signature
        • Products
          • Basic KYC
          • Enhanced KYC
          • Biometric KYC
          • Document Verification
          • SmartSelfie™ Authentication
          • KYB - Business Verification
          • AML Check
        • Generate Token for Web Integration
        • Utilities
      • Python
        • Installation
        • Signature
        • Products
          • Basic KYC
          • Enhanced KYC
          • Biometric KYC
          • Document Verification
          • SmartSelfie™ Authentication
          • Business Verification
        • Generate Token for Web Integration
        • Utilities
      • Java
        • Release Notes
        • Installation
        • Signature
        • Products
          • Basic KYC
          • Enhanced KYC
          • Biometric KYC
          • Document Verification
          • SmartSelfie™ Authentication
        • Generate Token for Web Integration
        • Utilities
      • Node.js
        • Installation
        • Signature
        • Products
          • Basic KYC
          • Enhanced KYC
          • Biometric KYC
          • Document Verification
          • Enhanced Document Verification
          • SmartSelfie™ Authentication
          • Business Verification
        • Generate Token for Web Integration
        • Utilities
      • PHP
        • Installation
        • Signature
        • Products
          • Basic KYC
          • Enhanced KYC
          • Biometric KYC
          • Document Verification
          • SmartSelfie™ Authentication
        • Generate Token for Web Integration
        • Utilities
    • Rest API
      • Signing your API Request
        • Using Signature
      • Products
      • Postman Collection
      • Utilities
    • Web / Mobile Web
      • Web Integration
        • Installation
        • Usage
        • End User Consent
        • Support
      • Javascript SDK
        • Installation
        • Usage
        • Migration
        • Deprecated Version
          • Installation
          • Usage
          • Notes
          • Support
  • FURTHER READING
    • FAQs
      • What are your support hours?
      • How do I set up a callback?
      • How to re-enroll, deactivate or delete a user?
      • Add or remove team members
      • What are top-level keys?
      • What are partner_params?
      • How do job types map to the new product names?
      • Is there an API I can use to monitor my wallet balance?
      • Is there an API I can query to check the availability status of an ID type?
      • How do I integrate Smile ID in other countries or query other ID types?
      • What are the image types I can upload to Smile ID?
      • Why aren't Kenyan IDs returning images for some IDs queried?
      • Why are some of my bank verification requests returning 'ID authority unavailable'?
      • How can I look up a specific user's data?
      • Selfie best-practices
      • Document capture best-practices
      • What happens under the hood?
      • Guide to the user consent screen
      • What is code 2302?
      • Using the Demo App and Scanning QR codes
    • Job status
    • KYC receipts
    • Result codes
      • Error codes
    • Securing your account with two-factor authentication (2FA)
    • Security Overview
    • Troubleshooting
      • Troubleshooting error 2204 & 2205 - "You're not authorized to do that"
      • Why is my Web API job taking so long?
      • Image capture issues on web client
Powered by GitBook
On this page
  • Import the Library
  • Submit the Job
  • Events
  • Get Results

Was this helpful?

  1. Integration Options
  2. Mobile
  3. React Native (deprecated)

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

import RnSmileId from "rn-smile-id";

Submit the Job

const result = await RnSmileId.submitJob(
  callbackUrl: string, // optional, pass '' when not available
  geoInfo: object, // optional, pass {} when not available
  idInfo: object, // optional, pass {} when not available
  isProduction: boolean,
  jobStatusPollingTimeoutMillis: number // optional, pass 0 when not available
  jobType: number,
  partnerParams: object, // optional, pass {} when not available
  tag: string,
);
  • 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 a job_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.

{
  "job_id": "<YOUR JOB ID>",
  "user_id": "<YOUR USER ID>",
  "...": "..."
}
  • idInfo: (Optional) Mandatory for document verification but used as needed for job type Enhanced KYC + SmartSelfie. The object is described below:

{
  "allow_re_enroll": true, // allow the user to be re-enrolled, do not pass if the user has not been enrolled
  "country": "<country>",
  "email": "<email>",
  "first_name": "<firstName>",
  "id_number": "<idNumber>",
  "id_type": "<idType>",
  "last_name": "<lastName>",
  "middle_name": "<middleName>",
  "...": "..."
}
  • geoInfo: (Optional) Used if you need to record geo-location information associated with the job.

{
  "accuracy": number,
  "altitude": number,
  "isGeoPermissionGranted": boolean,
  "lastUpdate": string,
  "latitude": number,
  "longitude": number
}
  • 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

import { NativeEventEmitter, NativeModules } from "react-native";

Setup the Emitter

const eventEmitter = new NativeEventEmitter(
  NativeModules.SIDReactNativeEventEmitter,
);

Listen to the Upload Event

eventEmitter.addListener("UploadListener", (event) => {
  console.log(event.status);
});

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

eventEmitter.addListener("UploadListener", (event) => {
  console.log(event.status);
});

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 11 months ago

Was this helpful?

callbackUrl: (Optional) Sets the URL to send the callback results to. For more information on the callback URL, please read .

here