[BETA] NFC Scan - Integration & Usage Guide
Prerequisites​
- An ICAO 9303 compliant travel document to scan the NFC chip in.
NOTE​
While any ICAO 9303 document could theoretically be scanned, the tutorials in the module assume the document is a Passport booklet.
Integration​
In your module-level app/build.gradle
, add the Incode library for NFC alongside any required dependencies. See the Library Dependencies section for more info.
Usage​
To add the NFC Scan module to the flow, simply:
1) Create a new NfcScan
module with its Builder
class:
- Java
- Kotlin
NfcScan nfcScan = new NfcScan.Builder()
.setShowNfcSymbolConfirmationScreen(true/false)
.setProcessNfcData(true/false)
.build()
val nfcScan = NfcScan.Builder()
.setShowNfcSymbolConfirmationScreen(true/false)
.setProcessNfcData(true/false)
.build()
2) Add it to a FlowConfig.Builder
:
- Java
- Kotlin
flowConfigBuilder.addNfcScan(nfcScan);
flowConfigBuilder.addNfcScan(nfcScan)
3) Add this callback to your IncodeWelcome.OnboardingListener
:
- Java
- Kotlin
@Override
public void onNfcScanCompleted(@NonNull NfcScanResult nfcScanResult) {
// NFC scan completed. Process result.
}
override fun onNfcScanCompleted(nfcScanResult: NfcScanResult) {
// NFC scan completed. Process result.
}
Methods for NfcScan.Builder()
:​
setShowNfcSymbolConfirmationScreen()
: Iftrue
, a screen asking the user if their document contains an NFC chip will be shown. If disabled, it's recommended to handle this case yourself to prevent a user without an NFC symbol on their passport from getting stuck. Default istrue
.setProcessNfcData()
: Iftrue
, the data read from the NFC chip will be used to validate identity. How it's used depends on how theFaceMatch
module is configured. Default istrue
.
Returning result of the module is an NfcScanResult
object which contains:​
resultCode
: AResultCode
indicating if scanning succeeded, or a known issue caused it to not succeed. See the Javadoc for more info.compositeCheckDigit
: AChar
representing the digit used to check the integrity of all the data in the MRZ of the document.dateOfBirth
: AString
in "yyMMdd" format of the date of birth of the document owner.dateOfBirthCheckDigit
: AChar
representing the digit used to check the integrity of thedateOfBirth
field.dateOfExpiry
: AString
in "yyMMdd" format of the document's expiration date.dateOfExpiryCheckDigit
: AChar
representing the digit used to check the integrity of thedateOfExpiry
field.documentCode
: AString
representing what type of ICAO 9303 compliant document this is. For example, a passport booklet is "TD3". Can be one of: TD1-3, MRVA, or MVRB.documentNumber
: AString
representing the 9 most significant digits of the passport number, CIC, etc.documentNumberCheckDigit
: AChar
representing the digit used to check the integrity of thedocumentNumber
field.gender
: AString
representing the gender of the document owner. Can be one of:MALE
,FEMALE
,UNKNOWN
, orUNSPECIFIED
.issuingStateOrOrganization
: AString
containing the 3 Letter Code of which authority issued this document. For example, for US Passports, this code is: "USA".nationality
: AString
= AString
containing the 3 Letter Code of the document owner's nationality. For example, for UK Passports, this code is: "GBR".optionalData1
: AString
with the contents of the first optional data for TD-1 and 3 style MRZs.optionalData2
: An optionalString
with the contents of the second optional data for TD-1 style MRZs only.personalNumber
: AString
with the personal number of the document owner if it's encoded inoptionalData1
.personalNumberCheckDigit
: An optionalChar
representing the digit used to check the integrity of thepersonalNumber
field. This is only populated ifdocumentCode
is "TD3".primaryIdentifier
: AString
representing the primary means of identifying the document. Typically, this is the document owner's last name.secondaryIdentifier
: AString
representing secondary means of identifying the document. Typically, this is the document owner's other names besides the last.secondaryIdentifierComponents
: AnArray<String>
of all the individual names that make up thesecondaryIdentifier
. For example, if the document owner's name is "John Jacob Jingleheimer Schmidt", thesecondaryIdentifierComponents
would be this array:["John", "Jacob", "Jingleheimer"]
.faceBitmap
: ABitmap
of the image found on the NFC chip. See the Android documentation for more info.
Face Match and NFC Scanning:​
If NfcScan.Builder().setProcessNfcData()
is set to true
, the data read from the NFC chip will be processed on the backend and can be used in the FaceMatch
module. Moreover, when NFC data is available on the backend, 2 new FaceMatch.MatchTypes
become available on top of the default ID_SELFIE
type:
NFC_SELFIE
: Compares the image from the NFC chip to the Selfie taken in theSelfieScan
module.NFC_3_WAY
: Compares the cropped ID image from theIdScan
module, to the image from the NFC chip, as well as the Selfie taken in theSelfieScan
module.
License​
Copyright 2023 Incode Technologies. All rights reserved.