All Projects → nfcim → flutter_nfc_kit

nfcim / flutter_nfc_kit

Licence: MIT license
Flutter plugin to provide NFC functionality on Android and iOS, including reading metadata, read & write NDEF records, and transceive layer 3 & 4 data with NFC tags / cards

Programming Languages

dart
5743 projects
swift
15916 projects
kotlin
9241 projects
ruby
36898 projects - #4 most used programming language
HTML
75241 projects
objective c
16641 projects - #2 most used programming language

Projects that are alternatives of or similar to flutter nfc kit

react-native-status-keycard
React Native library to interact with Status Keycard using NFC connection
Stars: ✭ 20 (-83.19%)
Mutual labels:  nfc, nfc-tag
flutter-nfc
Flutter Android plugin for NFC
Stars: ✭ 14 (-88.24%)
Mutual labels:  nfc, flutter-plugin
TonUINO
Alternative TonUINO Firmware
Stars: ✭ 112 (-5.88%)
Mutual labels:  nfc, nfc-tag
NFCReaderWriter
NFCReaderWriter which supports to read data from NFC chips(iOS 11), write data to NFC chips(iOS 13) and read NFC tags infos(iOS 13) by iOS devices. Compatible with both Swift and Objective-C. I will appreciate you if give me a star on the top right of page.
Stars: ✭ 58 (-51.26%)
Mutual labels:  nfc, nfc-tag
Flutter Nfc Reader
Flutter NFC reader plugin for iOS and Android
Stars: ✭ 240 (+101.68%)
Mutual labels:  nfc, flutter-plugin
NFCSupport
Support library for NFC NDEF Records
Stars: ✭ 20 (-83.19%)
Mutual labels:  nfc, ndef
Plugin.NFC
A Cross-Platform NFC (Near Field Communication) plugin to easily read and write NFC tags in your application.
Stars: ✭ 113 (-5.04%)
Mutual labels:  nfc, ndef
nfc-laboratory
NFC signal and protocol analyzer using SDR receiver
Stars: ✭ 41 (-65.55%)
Mutual labels:  nfc, nfc-tag
FudiNFC
💳 NFC Reader And Writer using Android devices by @romellfudi
Stars: ✭ 44 (-63.03%)
Mutual labels:  nfc, nfc-tag
nfc-tags
No description or website provided.
Stars: ✭ 15 (-87.39%)
Mutual labels:  nfc, nfc-tag
nfsee
Read your Transit/Bank/ID cards on Android/iOS phone with NFSee App
Stars: ✭ 80 (-32.77%)
Mutual labels:  nfc, nfc-tag
expanding bottom bar
BottomNavigationBar for Flutter with expanding titles
Stars: ✭ 39 (-67.23%)
Mutual labels:  flutter-plugin
Open-Home-Automation
Open Home Automation with Home Assistant, ESP8266/ESP32 and MQTT
Stars: ✭ 905 (+660.5%)
Mutual labels:  nfc
nearby connections
Flutter plugin (android) for sharing bytes and files Offline, (Based on the android Nearby Connections API)
Stars: ✭ 64 (-46.22%)
Mutual labels:  flutter-plugin
flutter easyloading
✨A clean and lightweight loading/toast widget for Flutter, easy to use without context, support iOS、Android and Web
Stars: ✭ 1,021 (+757.98%)
Mutual labels:  flutter-plugin
flutter-app
Full Feature Todos Flutter Mobile app with fireStore integration.
Stars: ✭ 138 (+15.97%)
Mutual labels:  flutter-plugin
Some-Calendar
Custom calendar dialog widget for flutter with (multi select, single select, date range) mode
Stars: ✭ 69 (-42.02%)
Mutual labels:  flutter-plugin
flutter contest
Flutter project submitted on Flutter contest
Stars: ✭ 14 (-88.24%)
Mutual labels:  flutter-plugin
material-about
An about screen to use in your Mobile apps.
Stars: ✭ 37 (-68.91%)
Mutual labels:  flutter-plugin
ChameleonMini
The ChameleonMini is a versatile contactless smartcard emulator compliant to NFC. The ChameleonMini was first developed by KAOS. This is NOT the official repo for KAOS's ChameleonMini. For further information see the Getting Started Page
Stars: ✭ 350 (+194.12%)
Mutual labels:  nfc

Flutter NFC Kit

pub version Build Example App

Yet another plugin to provide NFC functionality on Android, iOS and browsers (by WebUSB, see below).

This plugin's functionalities include:

  • read metadata and read & write NDEF records of tags / cards complying with:
    • ISO 14443 Type A & Type B (NFC-A / NFC-B / MIFARE Classic / MIFARE Plus / MIFARE Ultralight / MIFARE DESFire)
    • ISO 18092 (NFC-F / FeliCa)
    • ISO 15963 (NFC-V)
  • transceive commands with tags / cards complying with:
    • ISO 7816 Smart Cards (layer 4, in APDUs)
    • other device-supported technologies (layer 3, in raw commands, see documentation for platform-specific supportability)

Note that due to API limitations not all operations are supported on both platforms.

This library uses ndef for NDEF record encoding & decoding.

Setup

Thank nfc_manager plugin for these instructions.

Android

iOS

Web

The web version of this plugin does not actually support NFC in browsers, but uses a specific WebUSB protocol, so that Flutter programs can communicate with dual-interface (NFC / USB) devices in a platform-independent way.

Make sure you understand the statement above and the protocol before using this plugin.

Usage

Simple example:

import 'package:flutter_nfc_kit/flutter_nfc_kit.dart';
import 'package:ndef/ndef.dart' as ndef;

var availability = await FlutterNfcKit.nfcAvailability;
if (availability != NFCAvailability.available) {
    // oh-no
}

// timeout only works on Android, while the latter two messages are only for iOS
var tag = await FlutterNfcKit.poll(timeout: Duration(seconds: 10),
  iosMultipleTagMessage: "Multiple tags found!", iosAlertMessage: "Scan your tag");

print(jsonEncode(tag));
if (tag.type == NFCTagType.iso7816) {
    var result = await FlutterNfcKit.transceive("00B0950000", Duration(seconds: 5)); // timeout is still Android-only, persist until next change
    print(result);
}
// iOS only: set alert message on-the-fly
// this will persist until finish()
await FlutterNfcKit.setIosAlertMessage("hi there!");

// read NDEF records if available
if (tag.ndefAvailable){
  /// decoded NDEF records (see [ndef.NDEFRecord] for details)
  /// `UriRecord: id=(empty) typeNameFormat=TypeNameFormat.nfcWellKnown type=U uri=https://github.com/nfcim/ndef`
  for (var record in await FlutterNfcKit.readNDEFRecords(cached: false)) {
    print(record.toString());
  }
  /// raw NDEF records (data in hex string)
  /// `{identifier: "", payload: "00010203", type: "0001", typeNameFormat: "nfcWellKnown"}`
  for (var record in await FlutterNfcKit.readNDEFRawRecords(cached: false)) {
    print(jsonEncode(record).toString());
  }
}

// write NDEF records if applicable
if (tag.ndefWritable) {
  // decoded NDEF records
  await FlutterNfcKit.writeNDEFRecords([new ndef.UriRecord.fromUriString("https://github.com/nfcim/flutter_nfc_kit")]);
  // raw NDEF records
  await FlutterNfcKit.writeNDEFRawRecords([new NDEFRawRecord("00", "0001", "0002", "0003", ndef.TypeNameFormat.unknown)]);
}

// Call finish() only once
await FlutterNfcKit.finish();
// iOS only: show alert/error message on finish
await FlutterNfcKit.finish(iosAlertMessage: "Success");
// or
await FlutterNfcKit.finish(iosErrorMessage: "Failed");

A more complicated example can be seen in example dir.

Refer to the documentation for more information.

Error codes

We use error codes with similar meaning as HTTP status code. Brief explanation and error cause in string (if available) will also be returned when an error occurs.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].