WebAPI/WebNFC: Difference between revisions

Line 175: Line 175:
In P2P mode, there are two event listeners that can be registered by the applications.
In P2P mode, there are two event listeners that can be registered by the applications.


'''onpeerready''' : Fired when there is another nfc peer phone is close proximity (in its near-field) and if the Nfc application is top-most (visible) application.  
'''onpeerready''' : Fired when there is another nfc peer phone is close proximity (in its near-field) and if the registered Nfc application is top-most (visible) application.  
   Ex:- ''var nfcdom = window.navigator.mozNfc;
   Ex:- ''var nfcdom = window.navigator.mozNfc;
   nfcdom.onpeerready = function(event) {
   nfcdom.onpeerready = function(event) {
Line 181: Line 181:
   .
   .
   }''
   }''
'''onpeerlost''' : Fired when the fellow nfc peer has been taken away from its proximity (from its near-field) and if the Nfc application is top-most (visible) application.
'''onpeerlost''' : Fired when the fellow nfc peer has been taken away from its proximity (from its near-field) and if the registered Nfc application is top-most (visible) application.
   ''Ex:- var nfcdom = window.navigator.mozNfc;
   ''Ex:- var nfcdom = window.navigator.mozNfc;
   nfcdom.onpeerlost = function(event) {
   nfcdom.onpeerlost = function(event) {
Confirmed users
118

edits