NFC Passport Reader
Scan passport and retrieve information using NFC technologies.
BiometridStandard.getInstance().startNfc(processCallback, nfcCustomization, scannerCustomization);a
ProcessCallback processCallback
Callback where result information is received.
NFCustomization? nfcCustomization
NFC activity text and color configurations
CaptureOptions? scannerCustomization
MRZ Code reader configurations
The standard method for reading passport information involves an MRZ code reader. This step is essential for securely connecting to the passport via NFC.
In case the MRZ data required was already obtained, the MRZ reading step mentioned above can be skipped when using the following method:
BiometridStandard.getInstance().startNfc(processCallback, documentMrz, scannerCustomization);a
ProcessCallback processCallback
Callback where result information is received.
MrzData documentMrz
Required document data to allow NFC scan.
NFCustomization? nfcCustomization
NFC activity text and color configurations
Implementation Example
class ExampleActivity extends AppCompatActivity implements InitializationCallback{
String TAG = getClass().getSimpleName();
String BIOMETRID_API_SERVER_URL = "your server URL";
String BIOMETRID_APP = "your app";
String BIOMETRID_CREDENTIAL = "your credential";
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
BiometridStandard.getInstance().init(
BIOMETRID_API_SERVER_URL ,
BIOMETRID_APP,
BIOMETRID_ONBIOMETRID_CREDENTIAL,
Language.English,
this);
}
@Override
public void initializationCallback(boolean status, @Nullable Errors errors) {
if(status) startNfc();
}
public void startNfc() {
BiometridStandard.getInstance().startNfc(
processCallback,
new NFCustomization(),
new CaptureOptions()
);
}
public void startNfcWithoutMRZReader() {
BiometridStandard.getInstance().startNfc(
processCallback,
new MrzData("document_number","birth_date","expiry_date"),
new NFCustomization()
);
}
private ProcessCallback processCalback = new ProcessCallback() {
@Override
public void nfcCallback(@Nullable NFCData document, @Nullable Errors errors) {
if (errors != null) {
Log.e(TAG, "nfcCallback -> error: " + errors.getMessage());
} else {
Log.d(TAG, "nfcCallback -> passport information: " + document.toString());
}
};
}
Callback params
Parameter
Description
EDocument? document
Contains the complete scanned passport information
Errors? errors
Contains detected errors
Was this helpful?