npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

cordova-nfcv-plugin

v0.1.0

Published

Ionic2 service for communicating with NfcV tags

Downloads

5

Readme

cordova-nfcv-plugin

Cordova plugin for reading and writing to NFC tags using NfcV protocol (with support for Ionic2+)

Installation:

Requirements: Make sure you have a working environment for Ionic2+ project or for Cordova project before installing the plugin.

Ionic2+:

ionic plugin add https://github.com/valentiniljaz/cordova-nfcv-plugin

Cordova (without Ionic2+)

cordova plugin add https://github.com/valentiniljaz/cordova-nfcv-plugin

Configuration:

Plugin configuration is done by changing values in NfcVHandler class (src/android/NfcVHandler.java).

Some NFC tags might not support NDEF:

  • READ_NDEF: Prevent reading NDEF if tag does not support it.
  • NDEF_BLOCK_ADDR: Address of the first block that contains NDEF message encoded with TLV (T = type; L = length; V = value). See attached datasheet 02 (chapters: 3.2 and 4.1) for more info.

The following values should be the same for any tag. If not, you should change to the appropriate values:

  • CMD_READ: Code for read command (default: 0x20).
  • CMD_WRITE: Code for write command (default: 0x21).
  • CMD_FLAGS: Each request specifies some flags (default: 0x02 - High data rate). See attached datasheet 01 (chapter: 19.1) for more info.

Usage:

NfcV.init: function (success, error));

Initializes plugin. In most cases not even required, since every request also initializes the adapter.

  • success - Function returns "NFC_INIT_OK"
  • error - Check error flags below

NfcV.checkNfcVAvailability: function (success, error));

Check if Nfc hardware is available.

  • success - Function returns "NFC_CHECK_OK"
  • error - Check error flags below

NfcV.addNdefListener: function (success, error));

Get notified when ever new device is discovered. Ndef message is sent in event data.

  • success - If listener added it returns "NDEF_LISTENER_ADDED"
  • error - Check error flags below

You need to add document.addEventListener to be notified when a new device is discovered.

document.addEventListener('NdefTag', (event) => {
    console.log('Ndef', JSON.parse(event.ndef));
}, true);

NfcV.addNdefListener();

NfcV.startListening: function (success, error));

Starts listening for new "ACTION_TECH_DISCOVERED" intent.

  • success - When intent recieved it returns "NFC_INTENT_ACTIVE"
  • error - Check error flags below

NfcV.stopListening: function (success, error));

It disables foreground dispatch. Intents are no longer received.

  • success - It returns "NFC_STOP"
  • error - Check error flags below

NfcV.transceive: function (request, success, error));

It is used to dispatch any kind of request against a NFC tag. Request object has to include a full request: flags, block_addr and any data.

  • success - It returns response from the request. If it is a read request it returns the read data. If it is a write request it returns write response.
  • error - Check error flags below

NfcV.readBlock: function (blockAddr, success, error));

Reads one block from blockAddr.

  • success - It returns bytes read from block at blockAddr along with response flags
  • error - Check error flags below

NfcV.writeBlock: function (blockAddr, blockData, success, error));

Writes blockData into one block at blockAddr.

  • success - It returns bytes from write response (error flag and any error code)
  • error - Check error flags below

ERRORs

  • E_NO_NFC - NFC is not supported
  • E_NFC_DISABLED - NFC is not enabled
  • E_NULL_TAG - Tag returned NULL
  • E_ADDR_TOO_LONG - Block addr is too long (more than 2 bytes)

Datasheets

  • Datasheet 01: Specs for M24LR04E-R (01__Specs__M24LR04E-R)
    • chapters: 19, 20, 26
  • Datasheet 02: Using M24LR04E-R (02__Using__M24LR04E-R)
    • chapters: 3, 4

AndroidManifest.xml

Add the following intent filters inside activity:

<intent-filter>
    <action android:name="android.nfc.action.NDEF_DISCOVERED" />
    <category android:name="android.intent.category.DEFAULT" />
    <data android:mimeType="text/plain" />
</intent-filter>
<intent-filter>
    <action android:name="android.nfc.action.TECH_DISCOVERED" />
</intent-filter>
<meta-data android:name="android.nfc.action.TECH_DISCOVERED" android:resource="@xml/nfc_tech_filter" />

nfc_tech_filter

Create new file within platforms/android/res/xml/nfc_tech_filter.xml:

<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
    <tech-list>
        <tech>android.nfc.tech.NfcV</tech>
    </tech-list>
</resources>

Ionic2+ service: NfcvService

More about Ionic2+ support ...