WebAPI/WebNFC: Difference between revisions

Line 191: Line 191:


== When to use the APIs  ==
== When to use the APIs  ==
1. Gaia applications, in order to read NDEF messages from a passive tag (or) P2P phone, should declare 'nfc-ndef-discovered' in their manifest file.
1. Gaia applications, in order to read NDEF messages from a passive tag (or) P2P phone, should declare 'nfc-ndef-discovered' in their manifest file.This implies that the Gaia application shall be listed in activity picker whenever an NDEF message is about to be read. However, if the Gaia application wishes to perform write operation after reading, it can choose to do so by using the API 'writeNDEF()'. (provided user has picked the Nfc Application as his choice in the activity picker)
    This implies that the Gaia application shall be listed in activity picker whenever an NDEF message is about to be read. However, if the Gaia application wishes  
 
    to perform write operation after reading, it can choose to do so by using the API 'writeNDEF()'. (provided user has picked the Nfc Application as his choice  
2. In order to write NDEF message (No need to declare 'nfc-ndef-discovered' in its manifest file)
    in the activity picker)
 
a) In a P2P mode, Gaia applications shall register for 'onpeerready' as described above
2. In order to write NDEF message (No need to declare 'nfc-ndef-discovered' in its manifest file)
b) In Passive Tag mode, {{bug|937430}} is still under discussion.
    a) In a P2P mode, Gaia applications shall register for 'onpeerready' as described above
These APIs should be used if the application wants to bypass the normal activity picker. As you may also have noted , for these event handlers to be fired, the Nfc Gaia
    b) In Passive Tag mode, {{bug|937430}} is still under discussion.
application should be the top-visible / foreground application.
    These APIs should be used if the application wants to bypass the normal activity picker. As you may also have noted , for these event handlers to be fired, the Nfc Gaia
    application should be the top-visible / foreground application.


= Application Permissions =
= Application Permissions =
Confirmed users
118

edits