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

Tag is not NDEF compliant when publishing #153

Open
RsZoli opened this issue Oct 23, 2024 · 9 comments
Open

Tag is not NDEF compliant when publishing #153

RsZoli opened this issue Oct 23, 2024 · 9 comments

Comments

@RsZoli
Copy link

RsZoli commented Oct 23, 2024

Description

I'd like to "digitize" a simple printer card, when i read it it really barely has anything on it:

image

When i try to publish this read data i got the "Tag is not NDEF compliant" exception.
This is my code:

var tag = new TagInfo(_readCard.Identifier)
{
    Records =
    [
        new NFCNdefRecord
        {
            TypeFormat = NFCNdefTypeFormat.Mime,
            MimeType = "application/hu.rszoli.nfctest",
            Payload =_readCard.Identifier
        }
    ]
};

try
{
    CrossNFC.Current.PublishMessage(tag);
}
catch (Exception ex)
{
    await Toast.Make(ex.Message, ToastDuration.Short).Show();
}

What am i missing? I do not care any data but the Identifier read off the card, but i do not mind if its NDEF formatted, i just do not understand how to do this!

Steps to Reproduce

  1. Follow above...

Expected Behavior

Publish a tag with a single Identifier and nothing else on it

Actual Behavior

Tag is not NDEF compliant

Basic Information

  • Version with issue:
  • Last known good version:
  • IDE:
  • Platform Target Frameworks:
    • iOS:
    • Android:
    • UWP:
  • Nuget Packages:
  • Affected Devices:

Screenshots

Reproduction Link

@FaithfulDev
Copy link

I have little experience with this plugin, so this is just a random guess: Doesn't it say IsWritable = false? I would assume that means it was locked and can't be written to anymore.

@tentom
Copy link

tentom commented Oct 29, 2024

In addition to what FaithfulDev said it also says IsSupported = false so I would assume that it is not supported?

@RsZoli
Copy link
Author

RsZoli commented Oct 29, 2024

Thank you for your response! That is the data from the card that i have successfully read! I only need SerialNumber, nothing else, so the rest is irrelevant! I want to present the data to a NFC reader using my phone, instead of the card itself!

@Shaiken
Copy link

Shaiken commented Nov 5, 2024

have you succeeded?
i just want to exchange messages, android to android,
but click write tag button, nothing happened

@FaithfulDev
Copy link

FaithfulDev commented Nov 5, 2024

@RsZoli Did you verify if the tag you try to write to is actually NDEF compliant, meaning it's NDEF formatted and such?

EDIT: In case someone needs it: There are various apps that allow you to verify such things, I usually use NFC Tools (Android). The card needs to have a data format of NFC Forum Type 2 (or similar; that's NDEF).

image

@RsZoli
Copy link
Author

RsZoli commented Nov 5, 2024

@Shaiken Sadly, not yet!

@RsZoli
Copy link
Author

RsZoli commented Nov 5, 2024

@FaithfulDev No, because as i have mentioned before, "I want to present the data to a NFC reader using my phone, instead of the card itself!"
So i'm not trying to write any tag!

@FaithfulDev
Copy link

Oh, I apologize, I didn't read that correctly before.

What do you use on your phone to emulate being a tag? Something like HCE? I never used HCE before, but I don't think it's meant to be written to by another device. I only know it for emulating a tag to a reader (read-only).

I think for someone to help with your issue, it's important to understand how your phone is emulating being a tag.

@RsZoli
Copy link
Author

RsZoli commented Nov 10, 2024

@FaithfulDev Yes, i'm trying to do HCE exactly! I was under the assumption that writing a tag equals with presenting the same data to a reader, so from the reader's POV it should not matter if it reads the data off a passive tag or the phone, but clearly i have been wrong!

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

No branches or pull requests

4 participants