Re: [web-nfc] Need ability to cancel a message push

The assumption/use case is that the user wants to send data through 
NFC, press a button, the page sets up the (selected) data for the push
 message, starts the timer, and the user has a given time window to do
 the touch gesture, depending on what the page sets. It is unlikely 
the user gets distracted, since Web NFC only works when the page is in
 focus, the display is on, etc. If the user switches apps to do 
something else during the time window of the expected gesture, NFC 
functionality is stopped and the timer will likely expire. If the user
 just daydreams for a few seconds, forgets what s/he wanted, then 
touch the phone to another tag or device while the same page is open 
and in focus, then it was her/his decision and we should not try to 
fix that from the API :).

However, if the page wants to show a button for canceling the push, 
then we may need a cancelPush() for clarity's sake, though in practice
 it's a race too, difficult to guarantee the "cancel" semantics and in
 fact no better than its ugly equivalent of
```adapter.pushMessage(null, { timeout: 0});```
So we may have that as a syntactic sugar.


-- 
GitHub Notif of comment by zolkis
See https://github.com/w3c/web-nfc/issues/45#issuecomment-138214303

Received on Monday, 7 September 2015 07:24:27 UTC