don/ionic-nfc-reader

scan rfid card result not 10 digit number

sabardotnet opened this issue · 1 comments

how to make result like when we scan rfid with scanner, result 10 digit number. thanks
why my result like these picturre ?
my code :
$scope.onNfc = function( nfcEvent )
{
console.log(nfcEvent);
// display the tag as JSON
var tag = nfcEvent.tag;
var tagId = nfc.bytesToHexString(tag.id);
alert(tagId);
}
$scope.onNfcSuccess = function (result)
{
alert('NFC listening');
}

		$scope.onNfcFail = function (result) {
			alert( 'NFC failed: ' + result );
		}
		nfc.addTagDiscoveredListener($scope.onNfc, $scope.onNfcSuccess, $scope.onNfcFail);		

nfc

don commented

If you want the tag id, use nfc.addTagDiscoveredListener. You'll get the tag id in the scan response. See the docs for more details about the data in the tag event.