NDEFReadingEvent: serialNumber property
  
  
   
   
   The serialNumber property of the NDEFReadingEvent interface returns the serial number of the device, which is used for anti-collision and identification, or an empty string if no serial number is available.
   
  Value
  
   A string containing the device's serial number.
   
  Examples
  
   This example shows how to create a convenience function that reads a single tag and then stops polling, saving battery life by cutting unneeded work. The example could easily be extended to time out after a given amount of milliseconds.
   
    
    const ndefReader = new NDEFReader();
function read() {
  return new Promise((resolve, reject) => {
    const ctlr = new AbortController();
    ctlr.signal.onabort = reject;
    ndefReader.addEventListener(
      "reading",
      (event) => {
        ctlr.abort();
        resolve(event);
      },
      { once: true },
    );
    ndefReader.scan({ signal: ctlr.signal }).catch((err) => reject(err));
  });
}
read().then(({ serialNumber }) => {
  console.log(serialNumber);
});
    
   
  Specifications
  
  Browser compatibility
  
   
    
     
      
        | 
       Desktop | 
       Mobile | 
      
      
        | 
       Chrome | 
       Edge | 
       Firefox | 
       Internet Explorer | 
       Opera | 
       Safari | 
       WebView Android | 
       Chrome Android | 
       Firefox for Android | 
       Opera Android | 
       Safari on IOS | 
       Samsung Internet | 
      
     
     
      
       serialNumber | 
       No | 
       No | 
       No | 
       No | 
       No | 
       No | 
       89 | 
       89 | 
       No | 
       63 | 
       No | 
       15.0 |