Coder Social home page Coder Social logo

fkirc / capacitor-nfc-plugin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from adrynov/capacitor-nfc-plugin

0.0 1.0 0.0 5.22 MB

Read and write NFC tags

Ruby 2.50% Java 22.61% Objective-C 1.06% Swift 9.10% JavaScript 3.40% TypeScript 28.00% Kotlin 25.36% HTML 1.87% CSS 6.08%

capacitor-nfc-plugin's Introduction

Capacitor NFC Plugin

Native Capacitor plugin to read NFC tags.

To install the plugin in your project, run:

npm install --save capacitor-nfc@latest

Supported Platforms

  • Android
  • iOS (Sorry, I do not have nor plan to acquire an iPhone. iOS contributions are welcome.)

Android Notes

This API requires the following permission be added to your AndroidManifest.xml:

<uses-permission android:name="android.permission.NFC" />
<uses-feature android:name="android.hardware.nfc" android:required="true" />

iOS Notes

Specify the reason for your app to use the device’s NFC reader in Info.plist:

Name: Privacy - NFC Scan Usage Description Key: NFCReaderUsageDescription

Example

import { Plugins } from '@capacitor/core';
const { NFC } = Plugins;

class NFCExample {

  async checkNfcStatus() {
     if (Capacitor.isPluginAvailable('NFC')) {
      const status = NFC.getStatus();
      console.log('NFC is enabled', status);

      if (status !== 'enabled') {
        NFC.showSettings();
      }
    }
  }

}

API

getStatus

Checks whether NFC is enabled and turned on.

getTagInfo

(TODO) Returns information about the touched NFC tag.

showSettings

Opens a settings page to allow the user to enable NFC.

NFC.showSettings();

capacitor-nfc-plugin's People

Contributors

adrynov avatar fkirc avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.