• Skip to main content
  • Select language
  • Skip to search
MDN Web Docs
  • Technologies
    • HTML
    • CSS
    • JavaScript
    • Graphics
    • HTTP
    • APIs / DOM
    • WebExtensions
    • MathML
  • References & Guides
    • Learn web development
    • Tutorials
    • References
    • Developer Guides
    • Accessibility
    • Game development
    • ...more docs
B2G OS
  1. MDN
  2. Archive of obsolete content
  3. B2G OS
  4. B2G OS APIs
  5. MozNFC
  6. MozNFC.onpeerfound

MozNFC.onpeerfound

In This Article
  1. Syntax
  2. Properties

Non-standard
This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future.

The onpeerfound event handler of the MozNFC interface is called when a MozNFCPeer is detected.

The application has to be running on the foreground (decided by System app) to receive this event.

The default action of this event is to dispatch the event in System app again, and System app will run the default UX behavior (like vibration). So if the application would like to cancel the event, the application should call event.preventDefault() or return false in this event handler.

Syntax

attribute EventHandler onpeerfound;

Properties

peer : The NFCPeer object.

Document Tags and Contributors

Tags: 
  • API
  • Non-standard
  • Reference
  • Référence
 Contributors to this page: chrisdavidmills, lgarner, teoli, kscarfone, allstars.chh
 Last updated by: chrisdavidmills, Feb 27, 2017, 2:09:09 AM
See also
  1. Archive
  2. Related pages for Firefox OS
    1. MozAlarmsManager
    2. MozMobileNetworkInfo
    3. MozWifiP2pGroupOwner