Closed homer-jay closed 6 years ago
Can this pull request be merged please, this is really an annoying bug.. Thx!
This fixes the symptom but causes 2 events to be fired causing problems when an app uses both addNdefListener and addMimeTypeListener. I think I've tracked this problem down. See https://github.com/chariotsolutions/phonegap-nfc/issues/217#issuecomment-394000926 for more details.
Thanks for the pull request. I'm closing this because the problem is fixed by #324
FIX for issue 217: addNdefListener not calling callback on first attempt
I don't know why the Intent contains the ACTION_NDEF_DISCOVERED when reading non-MIME NDEF records the first time. After the first read, the action contains the ACTION_TECH_DISCOVERED as expected.
Even if this behavior were not the plugin's fault, it does make sense to fire the "ndef" event when reading MIME records in adition to the "ndef-mime" event, because if we have registered a callback with
addNdefListener
, then we want to be called back on every subtype of NDEF record.