revtel / react-native-nfc-manager

React Native NFC module for Android & iOS
MIT License
1.33k stars 317 forks source link

I had a problem sending the 0xB3 custom command using the handler.customCommand function. #651

Closed ramazanerdogan closed 6 months ago

ramazanerdogan commented 1 year ago

Hello!

I'm using a build of type st25dv64k

For iOS operating systems, use theNfcManager.requestTechnology(NfcTech.Iso15693IOS) technology and for the password:

NfcManager.iso15693HandlerIOS.customCommand(
flags = number,
customCommandCode = number,
customRequestParameters= [] );

I am using the structure

I had a problem sending the 0xB3 custom command using the handler.customCommand function.

Here is my code, I can't see any error there, but my RN code only will give me that [error] message, without giving me any information about what is going on.

try {     const idBytes= [1,2,3,4,5,6,7,8]; const passwordBytes= [0,0,0,0,0,0,0,0]
          resp = await NfcManager.iso15693HandlerIOS.customCommand({
          flags = 0x02,
          customCommandCode = 0xb3,
          customRequestParameters = [
          0x02, 0xb3, 0x02, ...idBytes, 0x02, ...passwordBytes, ],        
        });

Giving me this error: Error [error] Could you help me out?

Thanks!

ramazanerdogan commented 1 year ago
try {     const idBytes= [1,2,3,4,5,6,7,8]; const passwordBytes= [0,0,0,0,0,0,0,0]
          resp = await NfcManager.iso15693HandlerIOS.customCommand({
          flags = 0x02,
          customCommandCode = 0xb3,
          customRequestParameters = [
          0x02, ...idBytes, 0x02, ...passwordBytes, ],        
        });

I tried the flags value 0x22.

I removed the first 2 parameters in customRequestParameters.

when i try this way i still get an error please help me @whitedogg13

jahir8a commented 10 months ago

Hi everyone,

I hope this helps somebody, in order for you to identify the error that nfc-manager is returning as an exception, you must use an "if" and "instanceof" to know what error has occurred based on the following exceptions:

For example if (ex instanceof NfcError.UserCancel) { //bypass } else if (ex instance of TagConnectionLost){ //do something }.

github-actions[bot] commented 7 months ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] commented 6 months ago

This issue was closed because it has been stalled for 5 days with no activity.