> For the complete documentation index, see [llms.txt](https://legacy-docs.usesmileid.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://legacy-docs.usesmileid.com/integration-options/mobile/react-native/job-submission.md).

# Job Submission

## Import the Library

```javascript
import RnSmileId from "rn-smile-id";
```

### Submit the Job

```javascript
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`.

```json
{
  "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:

```json
{
  "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.

```json
{
  "accuracy": number,
  "altitude": number,
  "isGeoPermissionGranted": boolean,
  "lastUpdate": string,
  "latitude": number,
  "longitude": number
}
```

* **callbackUrl**: (Optional) Sets the URL to send the callback results to. For more information on the callback URL, please read [here](/further-reading/faqs/how-do-i-setup-a-callback.md).
* **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

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

#### Setup the Emitter

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

#### Listen to the Upload Event

```javascript
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

```javascript
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.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://legacy-docs.usesmileid.com/integration-options/mobile/react-native/job-submission.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
