パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v3.7.0

flutter_nfc_kit

Android、iOS、WebでNFC機能を提供し、メタデータの読み取り、NDEFレコードの読み書き、NFCタグ/カードとのレイヤー3およびレイヤー4データのトランセーブを含む

AndroidiOSWeb
30日間ダウンロード
8.6万
いいね数
280
Pub ポイント
160

パッケージをインストール

flutter pub add flutter_nfc_kit

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

flutter_nfc_kit は、Android、iOS、Web で NFC 機能を可能にするクロスプラットフォームの Flutter パッケージです。開発者は NDEF レコードの読み取り・書き込み、NFC タグからのメタデータへのアクセス、レイヤー 3 および 4 での低レベルなトランセイブ操作を実行できます。このパッケージは、非接触型データ交換、スマートタグとのインタラクション、NFC カードとの安全な通信など、幅広い NFC ケースに対応しています。プラットフォーム間で一貫した API を提供するため、Flutter アプリケーションに NFC 機能を統合しやすくなります。

用途

  • NDEFレコードの読み取りと書き込み
  • NFCタグメタデータにアクセスする
  • 低レベルのNFC通信を実行しています
  • コンタクトレス決済またはチケットングアプリの構築
  • スマートポスターのインタラクションを有効にする
  • NFC対応のIoTデバイスとの統合

主な機能

  • クロスプラットフォーム対応(Android、iOS、Web)
  • NDEFレコードの読み取りと書き込み
  • NFCタグからのメタデータ抽出
  • レイヤ3およびレイヤ4のトランシーブ機能
  • プラットフォーム間で一貫した API
  • リアルタイムNFCタグ検出

適している対象

  • NFCベースのモバイルアプリを開発する開発者
  • コンタクトレスデータ転送を必要とするアプリケーション
  • スマートデバイス相互作用システム
  • イベントチケットおよびアクセス制御ソリューション
  • IoTおよび組み込みシステム統合

注意事項

  • NFCハードウェアを搭載したデバイスが必要です
  • 権限は各プラットフォームで処理する必要があります
  • Webサポートは互換性のあるブラウザに限定されています
  • iOS ではバックグラウンドモードの構成が必要です
  • パフォーマンスはデバイスおよびタグの種類によって異なる場合があります
  • 高度なNFCプロトコルに対する限定的なサポート

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

Flutter NFC Kit

pub version Test 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 15693 (NFC-V)
  • R/W block / page / sector level data of tags complying with:
    • MIFARE Classic / Ultralight (Android only, MIFARE Classic Read & Write block for iOS)
    • ISO 15693 (iOS only)
  • transceive raw 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 all platforms. You are welcome to submit PRs to add support for any standard-specific operations.

This library uses ndef for NDEF record encoding & decoding.

Contributing

Please refer to CONTRIBUTING.md for more information.

Setup

Android

We have the following minimum version requirements for Android plugin:

  • Java 17
  • Gradle 8.9
  • Android SDK 24 (you must set corresponding jvmTarget in you app's build.gradle)
  • Android Gradle Plugin 8.7

To use this plugin on Android, you also need to:

iOS

This plugin now supports Swift package manager, and requires iOS 13+.

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

We provide simple code example and a example application.

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.

Operation Mode

We provide two operation modes: polling (default) and event streaming. Both can give the same NFCTag object. Please see example for more details.

Performance Optimization (Android)

For Android applications, you can optimize NFC tag detection performance using the androidReaderModeFlags parameter:

// Skip automatic NDEF discovery for ~500ms faster detection
// and disable platform sounds for custom feedback
const flags = 0x80 | 0x100; // FLAG_READER_SKIP_NDEF_CHECK | FLAG_READER_NO_PLATFORM_SOUNDS

final tag = await FlutterNfcKit.poll(
  androidReaderModeFlags: flags,
);

Common flags from NfcAdapter:

  • 0x80 - FLAG_READER_SKIP_NDEF_CHECK: Skip automatic NDEF discovery, improving detection speed by ~500ms
  • 0x100 - FLAG_READER_NO_PLATFORM_SOUNDS: Disable system beep/vibration for custom audio/haptic feedback

These flags are particularly useful for applications that:

  • Need fast tag detection (e.g., access control, fast payments)
  • Implement custom user feedback instead of system sounds
  • Use custom NDEF reading logic instead of automatic discovery

カテゴリー

依存関係

依存関係一覧 6 件

ソースリポジトリ

このパッケージを使用しているプロジェクト