Native iOS SDK has different ways to start NFC Capture, but on the native Android you can only start with some fields that can found on the MRZ of the ID.
Get the NFC module from the AmaniSDK
class after you called the initAmani method with correct parameters. See usage
If you want to use the NFC data as NFC Document, use this module. If you want to Anything related to IDCapture, including the NFC data must be called from the id capture.
Before using the any methods below use the setType method to give the type of the document.
// Example type, ask Amani for the required type
AmaniSDK.sharedInstance.iOSNFCCapture.setType("XXX_NF_0");
Starting with image of the back of the ID.
You can start the NFC Capture on iOS with the already captured back side of the ID.
const startNFCWithBackImage = useCallback((imageData: string) => {
AmaniSDK.sharedInstance.iOSNFCCapture
.startWithImageData(image)
.then((captureSuccess) => setNFCCaptureSuccess(captureSuccess))
.catch((err) => console.error("nfcCapture error", err));
}, []);
Starting with NVI Data
If you asked user for the some information can be found on ID, such as document number, date of birth and the expirity date of the id, you can use this method to start the nfc capture process.
const startNFCWithNVIData = useCallback((nviData: NVIData) => {
AmaniSDK.sharedInstance.iOSNFCCapture
.startWithNVIData(nviData)
.then((captureSuccess) => setNFCCaptureSuccess(captureSuccess))
.catch((err) => console.error("nfcCapture error", err));
}, []);
Starting with MRZ Capture
We can also start the capture process with mrz capture.
const startWithMRZCapture = useCallback(() => {
AmaniSDK.sharedInstance.iOSNFCCapture
.startWithMRZCapture()
.then((captureSuccess) => setNFCCaptureSuccess(captureSuccess))
.catch((err) => console.error("nfcCapture error", err));
}, []);
Uploading the captured data
To upload the captured data, simply call the upload method of this module.
AmaniSDK.sharedInstance.iOSNFCCapture
.startWithMRZCapture()
.then((uploadState) => setNFCUploadState(uploadState));