chariotsolutions / phonegap-nfc

PhoneGap NFC Plugin
MIT License
706 stars 564 forks source link

BB10: error thrown on nfc.write() #64

Closed MatthewGeomax closed 11 years ago

MatthewGeomax commented 11 years ago

Using cordova 2.3, along with plugin 0.4.2 on BB10 simulator and DevAlpha .

Calling nfc.write([ndef]) inside an event handler throws the following:

Error: Status=7 Message=Action not found: writeTag cordova-2.3.0.js:1036

don commented 11 years ago

The documentation was incorrect.

BB10 does not support nfc.write yet since it's not implemented for Webworks.

I plan on adding more BB10 features as they are added to Webworks.

MatthewGeomax commented 11 years ago

I started a discussion on the webworks forums regarding writing tags. Native writing is still unsupported, but the share interface through invoke can be seen in the example here https://github.com/blackberry/BB10-WebWorks-Community-Samples/blob/master/nfc/ndefTagReading

It does not simulate properly in the latest device sim either, throwing an "INVOKE_NO_TARGET_ERROR" when share is attempted. If you do incorporate the writing and need a test on device, let me know.

don commented 11 years ago

For writing I'd need to use the Native SDK like I do for BB7 http://developer.blackberry.com/native/reference/bb10/nfc_libref/topic/nfc_write_ndef_message_to_tag.html

I'll consider using the Native SDK, but I'm hope that webworks will add writing soon.

I've created issue #69 to implement nfc.share(), I have most of the NDEF encoding written in JS already so hopefully it will be straight forward.