Skip to content

NFC Write Function Returns Unexpected Random Numbers #7

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

Open
Yugesh-Kumar-S opened this issue Mar 15, 2025 · 1 comment · May be fixed by #14
Open

NFC Write Function Returns Unexpected Random Numbers #7

Yugesh-Kumar-S opened this issue Mar 15, 2025 · 1 comment · May be fixed by #14

Comments

@Yugesh-Kumar-S
Copy link

NFC Write Function Returns Unexpected Random Numbers

Description:

When pressing the "Start transfer" button, the nfc_write() function executes but outputs an unexpected array of random numbers in the terminal instead of performing the expected NFC write operation. Additionally, an error occurs stating that NFC is not available.

Steps to Reproduce:

  1. Run the application using flutter run.

  2. Press the "Start transfer" button.

  3. Observe the terminal output.

Expected Behavior:

  • The nfc_write() function should correctly execute the NFC write process and confirm the transfer.

Actual Behavior:

  • Terminal logs an array of [255, 255, 255, ...] instead of expected data.

  • Error: PlatformException(404, NFC not available, null, null).

  • NFC does not function as intended.

Relevant Code:

In main.dart

ElevatedButton(
  onPressed: () {
    print('button pressed!');
    nfc_write();
  },
  child: Text('Start transfer'),
);
@kienvo
Copy link
Member

kienvo commented Mar 18, 2025

Hi @Yugesh-Kumar-S,

The error means the NFC is not enabled in the setting. We should have some way to notify users to enable it before using the app and/or before transferring.

@Yugesh-Kumar-S Yugesh-Kumar-S linked a pull request Mar 29, 2025 that will close this issue
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 a pull request may close this issue.

2 participants