chariotsolutions / phonegap-nfc

PhoneGap NFC Plugin
MIT License
706 stars 564 forks source link

NullReferenceException thrown by calling "proximityDevice.PublishBinaryMessage(type, data.AsBuffer())" method #66

Closed yves-s closed 11 years ago

yves-s commented 11 years ago

I just called the "share" method and got an "NullReferenceException" thrown. My System Specification is:

The error message: $exception {System.NullReferenceException: Object reference not set to an instance of an object. at Cordova.Extension.Commands.NfcPlugin.publish(String type, String args) at Cordova.Extension.Commands.NfcPlugin.shareTag(String args)} System.Exception {System.NullReferenceException}

don commented 11 years ago

I think Windows handles this different from Android. On windows you might need to call nfc.share when another device is in range, similar to the way nfc.write works. e.g. in the callback handler for reading a tag.

phonegap-nfc should handle this better and call the error callback when things go wrong

I'll try and duplicate this and improve the code.