flomio / cordova-plugin-flomio

Flomio SDK plugin for Cordova.
10 stars 8 forks source link

addConnectedDevicesListener returns an object instead of an array #28

Closed tylervz closed 6 years ago

tylervz commented 7 years ago

When I inspected the callback of addConnectedDevicesListener using Safari , I discovered that the result was an object instead of an array.

screen shot 2017-08-18 at 2 08 19 pm

I would like to have it return an array, like the README states. I am using the master branch of this plugin.

scottire commented 7 years ago

Ok, apologies for error in documentation. Why do you want it to be an Array if you don't mind me asking?

tylervz commented 7 years ago

If an array was being returned I would be able to tell whether an NFC reader just connected or whether one disconnected, based on the size of the array. Right now I'm getting the same result when the reader connects and when it disconnects, so I cannot notify the user "An NFC reader just connected" and "No NFC readers are connected".

scottire commented 7 years ago

let communicationStatus = updatedDevices["Communication Status"] Will tell you the status of the connect device. 0 means disconnected 1 means connected but not polling for tags 2 means connected and polling for tags

tylervz commented 7 years ago

Are you sure that's right? I'm getting 0 when the reader connects and I'm getting 2 when I turn off my phone's bluetooth.