New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

cordova-plugin-nfc-id

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cordova-plugin-nfc-id

A Cordova plugin for reading the ID of NFC tags

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

NFC-ID-Plugin for Cordova

This plugin enables Cordova applications to read the ID of NFC tags on Android devices. It provides a simple interface for capturing the NFC tag ID, allowing React-based Cordova apps to utilize NFC technology easily.

Features

  • Read NFC tag IDs.
  • Simple JavaScript interface for interaction from React components.
  • Android platform support.

Installation

To install the plugin into your Cordova project, run the following command in your project directory:

cordova plugin add cordova-plugin-nfc-id

Usage

To use the plugin in your Cordova project, follow these steps:

  • Make sure your app is running on an actual Android device with NFC capabilities.
  • Add the following code to your app's main JavaScript or TypeScript file:
document.addEventListener('deviceready', function() {
    cordova.plugins.NFCIDPlugin.readNFC(
        function(result) {
            console.log('NFC Tag ID:', result);
        },
        function(error) {
            console.error('Error reading NFC tag:', error);
        }
    );
});

This code sets up an event listener that calls the readNFC method when the device is ready. The readNFC method triggers reading the NFC tag when one is detected.

API

readNFC(success, error)

  • success: A callback function that is called with the NFC tag ID as its argument when an NFC tag is successfully read.
  • error: A callback function that is called with an error message if the reading fails.

Platform Support

This plugin supports only the Android platform as of now.

Keywords

FAQs

Package last updated on 07 May 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc