datalogic / cordova-plugin-datalogic

Cordova Plugin for Datalogic Android SDK
0 stars 7 forks source link

Plugin doestn work #13

Closed joel104 closed 4 years ago

joel104 commented 4 years ago

Hi,

i installed the plugin for my cordova project, with code i tried to do something simple like:

`var app = { // Application Constructor initialize: function() { document.addEventListener('deviceready', this.onDeviceReady.bind(this), false); }, onDeviceReady: function() { this.receivedEvent('deviceready'); }, // Update DOM on a Received Event receivedEvent: function(id) { console.log('Received Event: ' + id); barcodeManager.addReadListener( function(data) { alert("ok"); }, function(err) { alert("not ok"); } ); } };

app.initialize();`

But if i scan some barcode he doestn alert me, not with "ok" even with "not ok". So i think the doesnt trigger the addReadListener.

Have i done something wrong or do i have to configure something in my device? I use a Datalogic Memor 1 with Android 8.1.

Thanks

st33bz commented 4 years ago

I had the same issue at first. It's because you've spelled "Listener" correctly and the plugin developer did not. Try updating your method to "barcodeManager.addReadListner" and it should work fine.

codybrookshear commented 4 years ago

Hi @joel104, I think @st33bz is right. Unfortunately it's had to fix typos like that without risking breaking others code using it spelled incorrectly. Thanks!