Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

MozNFCPeer

This API is available on Firefox OS for privileged or certified applications only.

NFCPeer は、他のNFC対応デバイスと相互作用するピアツーピア (P2P)インターフェイスを提供します。これは NDEF メッセージの送信と、ファィル送信に使われます。

メソッド

MozNFCPeer.sendFile()
sendFile() sends files to other NFC-enabled devices. This should be called inside a mozNFC.onpeerfound() event callback.  This method is available in certified apps only.
MozNFCPeer.sendNDEF()
sendNDEF() sends NDEF Messages to other NFC-enabled devices. This should be called inside a mozNFC.onpeerfound() event callback.

サンプル

navigator.mozNfc.onpeerfound = function (evt) {
  var peer = evt.peer;
  // ndef is an instance of MozNDEFRecord contains the shared data, like URL.
  peer.sendNDEF([ndef]);
};

仕様

The NFC implementation in Gecko follows the NFC Forum specifications.

ブラウザ互換性

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support

未サポート

未サポート 未サポート 未サポート 未サポート
Feature Android Firefox Mobile (Gecko) Firefox OS (Gecko) IE Phone Opera Mobile Safari Mobile
Basic support 未サポート 未サポート 2.0 moz [1] 未サポート 未サポート 未サポート

[1] Available in privileged apps as of Firefox OS 2.2; certified-only before that.

こちらも見よ

ドキュメントのタグと貢献者

 このページの貢献者: hamasaki, Uemmra3
 最終更新者: hamasaki,