> For the complete documentation index, see [llms.txt](https://docs.1kosmos.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.1kosmos.com/mobile-sdk/native/android/api-reference/classes/rfidscannerhelper.md).

# RFIDScannerHelper

public class RFIDScannerHelper extends IRFIDResponseListener.

↳ package com.onekosmos.blockid.sdk.

* This helper class handles RFID scanning (E-Passport Chip).

### Constructor

**public** RFIDScannerHelper (@NonNull Context context, @NonNull IRFIDResponseListener listener)

Creates an object of RFIDScannerHelper.

| Parameter | Description                                                                          |
| --------- | ------------------------------------------------------------------------------------ |
| context   | Context: Application's context on top of which the RFID scanning feature will start. |
| listener  | IRFIDResponseListener The block to execute after the response is received.           |

***

**public** RFIDScannerHelper (Context context, boolean isDataRequiredOnFail, IRFIDResponseListener listener)

Creates an object of RFIDScannerHelper. The scanner will throw an error if the document has already expired. If the document expires before gracePeriod, the scanner will complete the scan and return an advisory error.

| Parameter            | Description                                                                                                        |
| -------------------- | ------------------------------------------------------------------------------------------------------------------ |
| context              | Context: Application's context on top of which the RFID scanning feature will start.                               |
| isDataRequiredOnFail | boolean: Indicates if the scanning failed, SDK must return the passport document data. The default value is false. |
| listener             | IRFIDResponseListener The block to execute after the Passport document scanning is completed.                      |

***

**public** RFIDScannerHelper (Context context, boolean isDataRequiredOnFail, int expiryDateGracePeriod, IRFIDResponseListener listener)

Creates an object of RFIDScannerHelper . The scanner will throw an error if the document has already expired. If the document expires before gracePeriod, the scanner will complete the scan and return an advisory error.

| Parameter             | Description                                                                                                        |
| --------------------- | ------------------------------------------------------------------------------------------------------------------ |
| context               | Context: Application's context.                                                                                    |
| isDataRequiredOnFail  | boolean: Indicates if the scanning failed, SDK must return the passport document data. The default value is false. |
| expiryDateGracePeriod | int: Number of days to allow as grace period ahead of Passport document expiry.                                    |
| listener              | IRFIDResponseListener The block to execute after the Passport document scanning is completed.                      |

***

**public** RFIDScannerHelper (Context context, int expiryDateGracePeriod, IRFIDResponseListener listener)

Creates an object of RFIDScannerHelper . The method does not return the data in case Passport document scanning is failed. The scanner will throw an error if the document has already expired. If the document expires before gracePeriod, the scanner will complete the scan and return an advisory error.

| Parameter             | Description                                                                                   |
| --------------------- | --------------------------------------------------------------------------------------------- |
| context               | Context: Application's context.                                                               |
| expiryDateGracePeriod | int: Number of days to allow as grace period ahead of Passport document expiry.               |
| listener              | IRFIDResponseListener The block to execute after the Passport document scanning is completed. |

### Method Summary

| Function                                                                           | Type | Description                                                                                                                                                                                                                                                  |
| ---------------------------------------------------------------------------------- | ---- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| onNewIntent(Tag tag)                                                               | void | <p>- Once RFID chip is detected, activity will get RFID chip data in Override method onNewIntent(Intent intent).<br>- Call below code and send tag back to Passport Scanner Helper.<br>Tag tag = intent.getExtras().getParcelable(NfcAdapter.EXTRA\_TAG)</p> |
| startRFIDScanning(LinkedHashMap\<String, Object> dataObject, long rfidScanTimeOut) | void | Start Passport document's RFID scanning with custom defined timeout.                                                                                                                                                                                         |
| startRFIDScanning(LinkedHashMap\<String, Object> dataObject)                       | void | Start Passport document's RFID scanning with default timeout of 15 seconds.                                                                                                                                                                                  |
| stopRFIDScanning()                                                                 | void | Stop Passport document's RFID scanning                                                                                                                                                                                                                       |

### Method Details

**onNewIntent**

**public void** onNewIntent(Tag tag)

* Once RFID chip is detected, activity will get RFID chip data in Override method onNewIntent(Intent intent).
* Call below code and send tag back to RFIDScanner Helper.

Tag tag = intent.getExtras().getParcelable(NfcAdapter.EXTRA\_TAG)

| Parameter |          |
| --------- | -------- |
| tag       | Tag: tag |

***

**startRFIDScanning**

**public void** startRFIDScanning(LinkedHashMap\<String, Object> dataObject, long rfidScanTimeOut)

* Starts Passport document's RFID scanning with custom defined timeout.

| Parameter       |                                                 |
| --------------- | ----------------------------------------------- |
| dataObject      | LinkedHashMap\<String, Object>: Document Object |
| rfidScanTimeOut | long: Scanning Timeout duration                 |

***

**startRFIDScanning**

**public void** startRFIDScanning(LinkedHashMap\<String, Object> dataObject)

Start Passport document's RFID scanning with default timeout of 15 seconds.

| Parameter  |                                                 |
| ---------- | ----------------------------------------------- |
| dataObject | LinkedHashMap\<String, Object>: Document Object |

***

**stopRFIDScanning**

**public void** stopRFIDScanning()

Stop Passport document's RFID scanning.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.1kosmos.com/mobile-sdk/native/android/api-reference/classes/rfidscannerhelper.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
