MobileChromeApps / cordova-plugin-chrome-apps-bluetooth

BSD 3-Clause "New" or "Revised" License
10 stars 11 forks source link

Events doesn´t trigger in Nexus 6 #2

Closed albertoparras closed 9 years ago

albertoparras commented 9 years ago

Hi I`m trying this code and the Events doesn´t trigger when I connect to a device: var app = { initialize: function() { this.bindEvents(); }, bindEvents: function() { document.addEventListener('deviceready', this.onDeviceReady, false); }, onDeviceReady: function() { app.receivedEvent('deviceready'); }, receivedEvent: function (id) { alert("Im ready!!") chrome.bluetooth.startDiscovery(app.Discover); chrome.bluetooth.getAdapterState(app.Adaptador); chrome.bluetooth.onDeviceAdded.addListener(app.Nuevo); chrome.bluetooth.onDeviceChanged.addListener(app.Conectado); chrome.bluetooth.getDevices(app.Dispositivos); }, Discover: function () { console.log("Start Discover") }, Adaptador: function (device){ console.log("Adaptador") console.log(device) }, Dispositivos: function (device){ console.log("Devices") console.log(device); }, Nuevo: function (device){ if (device.connected) { alert("Device Connected") } }, Conectado: function (device) { if (device.connected) { alert("Device Connected") } } };

I also find this error when I call the Start Discovery Function:

Attempt to invoke interface method 'int java.util.List.size()' on a null object reference.

Thanks in advanced for the help

s-azpiazu commented 9 years ago

Same problem here

agrieve commented 9 years ago

Published a new version with the fix to npm (1.1.4)