NFC Capture on Android
NFC capture on Android
Android has single method for starting NFC Capture while there are multiple options to start the NFC Capture on iOS.
If you're not capturing the NFC Data after the IDCapture, this process requires some parameters from the id itself.
All date formats must be in YYMMDD
.
For example, September 1st 1999
becomes 990901
.
Also you must stop the NFC listener after you are done with capturing NFC data.
const [isCaptureComplete, setCaptureComplete] = useState(false)
useEffect(() => {
if (isCaptureComplete) {
AmaniSDK.sharedInstance.androidNFCCapture()
}
}, [isCaptureComplete])
const startNFCCapture = useCallback(() => {
AmaniSDK.sharedInstance.androidNFCCapture.start({
// NVI Data goes here
}).then((captureSuccess) => {
// capture state
}).catch(err => {
console.log("capture error", err)
})
})
To upload you can call the upload method like this
const uploadCapturedData = useCallback(() => {
AmaniSDK.sharedInstance.androidNFCCapture.upload((uploadState) => {
// do something with upload state
})
}, [])