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 | - 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 Passport Scanner Helper. Tag tag = intent.getExtras().getParcelable(NfcAdapter.EXTRA_TAG) |
| 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.