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

Documentation Request. #13

Open
farry19 opened this issue Jun 23, 2021 · 2 comments
Open

Documentation Request. #13

farry19 opened this issue Jun 23, 2021 · 2 comments

Comments

@farry19
Copy link

farry19 commented Jun 23, 2021

Can you provide the full documentation of the package, as i have gone through the samples but didn't understand how to write custom tags. e.g. vCard or other. Thanks

@whitedogg13
Copy link
Member

Hi @farry19 because this repo is an app, currently we don't have any plan to provide documentation.

Regarding vCard, you can try this code snippet:

async function writeVCard(value) {
  await NfcManager.requestTechnology(NfcTech.Ndef, {
    alertMessage: 'Ready to write some NDEF',
  });

  const {name, tel, org, email} = value;
  const vCard = `BEGIN:VCARD\nVERSION:2.1\nN:;${name}\nORG: ${org}\nTEL;HOME:${tel}\nEMAIL:${email}\nEND:VCARD`;
  const bytes = Ndef.encodeMessage([
    Ndef.record(Ndef.TNF_MIME_MEDIA, 'text/vcard', [], vCard),
  ]);

  await NfcManager.ndefHandler.writeNdefMessage(bytes);
  NfcManager.cancelTechnologyRequest();
}

Hope that helps!

@nurfync
Copy link

nurfync commented Jul 7, 2021

hi , i want to try this app and clone it , so i have a mifare card,
when i try to write a text or mail there is an error pop up like "NFC Error Error: unsupported tag api"
why do i get this ? is something wrong about my card?

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

3 participants