Skip to main content

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.

ParameterDescription
contextContext: Application's context on top of which the RFID scanning feature will start.
listenerIRFIDResponseListener 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.

ParameterDescription
contextContext: Application's context on top of which the RFID scanning feature will start.
isDataRequiredOnFailboolean: Indicates if the scanning failed, SDK must return the passport document data. The default value is false.
listenerIRFIDResponseListener 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.

ParameterDescription
contextContext: Application's context.
isDataRequiredOnFailboolean: Indicates if the scanning failed, SDK must return the passport document data. The default value is false.
expiryDateGracePeriodint: Number of days to allow as grace period ahead of Passport document expiry.
listenerIRFIDResponseListener 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.

ParameterDescription
contextContext: Application's context.
expiryDateGracePeriodint: Number of days to allow as grace period ahead of Passport document expiry.
listenerIRFIDResponseListener The block to execute after the Passport document scanning is completed.

Method Summary​

FunctionTypeDescription
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)voidStart Passport document's RFID scanning with custom defined timeout.
startRFIDScanning(LinkedHashMap<String, Object> dataObject)voidStart Passport document's RFID scanning with default timeout of 15 seconds.
stopRFIDScanning()voidStop 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
tagTag: tag

startRFIDScanning​

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

  • Starts Passport document's RFID scanning with custom defined timeout.
Parameter
dataObjectLinkedHashMap<String, Object>: Document Object
rfidScanTimeOutlong: Scanning Timeout duration

startRFIDScanning​

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

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

Parameter
dataObjectLinkedHashMap<String, Object>: Document Object

stopRFIDScanning​

public void stopRFIDScanning()

Stop Passport document's RFID scanning.