-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
event handler listener type incorrect #332
Comments
Sure, PR it up and we'll see. Without looking at the code what you're saying sounds correct, I'm just shocked something like this has gone so long without issue. |
Hello @kenjdavidson, Sorry for the inconvenience, but I am also facing an issue related to listening for any events returned from the Bluetooth device. The issue I'm encountering is as follows: I have configured Android settings and successfully connected to the desired Bluetooth device using the Therefore, if you notice any missing configurations or know the issue causing this, please provide feedback to help me resolve this problem. Initially, I thought it was a device issue, so I spent more than a week researching it but still couldn't find a solution, which is why I am writing here for your and everyone's understanding. This message is a bit long, so I hope you can take the time to read and understand it. I look forward to your prompt response. |
I think I am experiencing a similar issue. I have even created an issue -> #333 You can check it out. |
@ShaneZhengNZ I believe the appropriate fix is to actually return the correct |
@kenjdavidson I do have some time to provide the proper fix. lol. However, I am not very familiar with the native languages. It will take a bit longer, but I am keen to try. |
I just want to add that the same is true for onDeviceDiscovered as well. I didn't get around to report it but this is how I wrote in my code:
I guess others have done similar things so fixing this will break things. Which is fine as it is in line with what the API should be but maybe bump the version code a bit more to indicate it. |
Lol @ the vicious comment. Makes sense to bump the version. But I'm hoping someone opens a pr for the native module changes and will include this. Not sure bumping the version for just this when the workaround is fairly straight forward makes sense. Or maybe it is. Feel free to open a pr for it and I can release a fix. |
Mobile Device Environment
Provide a list of operating systems on which this issue is relevant.
Application Environment
Provide information about your development environment:
Describe the bug
As far as I am concerned, the event listener should receive event parameter with BluetoothDeviceEvent type, for example,
, but what I saw, my listener receives the device object (type BluetoothNativeDevice).
therefore, when I use 'event.device', it is undefined, I have to do something like
const device = event as unknown as BluetoothNativeDevice;
, so that I can usedevice.name
, otherwise, typescript is not happy for me to useevent.name
Expected behavior
type definition for the event handler should be
or change the native code to actually return BluetoothDeviceEvent (not BluetoothNativeDevice).
if you agree with me, I am happy to provide a PR depends on which option you think is most appropriate.
The text was updated successfully, but these errors were encountered: