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

パッケージ詳細v4.3.0

nfc_manager

Android および iOS での NFC 機能へのアクセスを提供する Flutter プラグインです。

AndroidiOS
30日間ダウンロード
10.1万
いいね数
532
Pub ポイント
160

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

flutter pub add nfc_manager

パッケージ概要

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

nfc_manager は、Android および iOS デバイスで NFC(近距離無線通信)機能にアクセスできるようにする Flutter プラグインです。開発者は NFC タグの読み取りと書き込み、近隣の NFC デバイスの検出、NDEF(NFC データ交換形式)メッセージの処理が可能になります。プラグインは複数のプラットフォーム間で一貫した API を提供し、Flutter アプリケーションへの NFC 機能の統合を簡素化します。タグ検出、読み取り、書き込み、バックグラウンド処理などのさまざまな NFC 操作をサポートしています。接触式決済システム、スマートポスター、アクセス制御、データ共有アプリに最適です。

用途

  • NFCタグの読み取り
  • NFCタグへのデータ書き込み
  • コンタクトレス決済の実装
  • スマートポスターの作成
  • アクセス制御システムの有効化

主な機能

  • クロスプラットフォームNFC対応
  • NDEFメッセージ処理
  • タグの検出と読み取り
  • バックグラウンドNFCスキャン
  • 一般的な NFC タスクのためのシンプルな API

適している対象

  • NFC操作を必要とするモバイルアプリ
  • コンタクトレスソリューションを開発する開発者
  • スマートカードまたはビーコンを使用するアプリ
  • Android および iOS の両方をターゲットにしたプロジェクト

注意事項

  • NFCハードウェアを搭載したデバイスが必要です
  • Androidに比べてiOSのNFC機能は限定的
  • 権限はユーザーによって付与される必要があります
  • すべてのAndroidデバイスが完全なNFC機能をサポートしているわけではありません

元の README

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

nfc_manager

A Flutter plugin providing access to NFC features on Android and iOS.

Setup

Android
iOS

Usage

Handling the Session
import 'package:nfc_manager/nfc_manager.dart';

// Check the availability of NFC on the current device.
NfcAvailability availability = await NfcManager.instance.checkAvailability();

if (availability != NfcAvailability.enabled) {
  print('NFC may not be supported or may be temporarily disabled.');
  return;
}

// Start the session.
NfcManager.instance.startSession(
  pollingOptions: {NfcPollingOption.iso14443}, // You can also specify iso18092 and iso15693.
  onDiscovered: (NfcTag tag) async {
    // Do something with an NfcTag instance...
    print(tag);

    // Stop the session when no longer needed.
    await NfcManager.instance.stopSession();
  },
);
Working with NfcTag

An NfcTag instance is typically not used directly. Instead, convert it to a platform-specific tag class by calling that class's static method from.

import 'package:nfc_manager/nfc_manager.dart';
import 'package:nfc_manager_ndef/nfc_manager_ndef.dart';

final Ndef ndef = Ndef.from(tag);

if (ndef == null) {
  print('This tag is not compatible with NDEF.');
  return;
}

// Do something with an Ndef instance...
print(ndef);

The following platform-specific tag classes are available:

Android only
  • NfcAAndroid
  • NfcBAndroid
  • NfcFAndroid
  • NfcVAndroid
  • IsoDepAndroid
  • MifareClassicAndroid
  • MifareUltralightAndroid
  • NfcBarcodeAndroid
  • NdefAndroid
  • NdefFormatableAndroid
iOS only
  • FeliCaIos
  • MiFareIos
  • Iso15693Ios
  • Iso7816Ios
  • NdefIos
Cross-platform abstractions (separate packages)

カテゴリー

依存関係

依存関係一覧 2 件

  • meta^1.17.0
  • ndef_record^1.4.2

ソースリポジトリ

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