Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ios): fix sendMiFareCommand parameter and return value #84

Merged
merged 2 commits into from
Apr 18, 2024

Conversation

m1ga
Copy link
Contributor

@m1ga m1ga commented Apr 17, 2024

With the help of the react-native module: https://github.com/revtel/react-native-nfc-manager/blob/main/ios/NfcManager%2BMifare.m I was able to fix sendMiFareCommand to read out different memory banks from a mifare ultralight tag.

Issue
Calling mifare.sendMiFareCommand({data: [0x30,0x05]}) will run 3000 inside the module so it will always read the first memory block. The 2nd parameter didn't change anything.
Also the return event didn't include the actual data.

Screenshot_20240417-120904
only the yellow part is read.

Fix
Using the methods from the react-native module I was able to convert the array to the correct parameter to read different memory slots.
Returning the hex value to the app.

ti.nfc-iphone-4.1.1.zip

@m1ga
Copy link
Contributor Author

m1ga commented Apr 17, 2024

I wasn't able to move the two new function to the TiNfcUtilities file. It works like this but I think it would be cleaner to have them in there. If some can move them there it would be great.

Copy link
Contributor

@hansemannn hansemannn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect, thanks!

@hansemannn hansemannn merged commit 7f72b46 into master Apr 18, 2024
1 check passed
@m1ga m1ga deleted the iosMifare branch April 18, 2024 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants