-
Notifications
You must be signed in to change notification settings - Fork 354
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
Initialize callback is only called once and not on every BT status change. #343
Comments
I no longer have a 5.* device, but this is working fine on my Nexus 5X and Samsung Tab A running 6.*. Can you try using the example app that comes with the Angular wrapper? That's the quickest way to rule out custom code issues. |
I'm having this issue as well on my Galaxy S7 running Android 6.0.1. Oddly, it used to work just fine and I haven't modified the plugin or my initialize code at all, so I'm guessing it's a state that's possible to get into but whose cause is unclear. If anyone encounters and resolves this, please post here :) UPDATE: Just tried with the same app running on iOS 10 and the callback fires for each state change. I wrote the code using my phone as the test device so it certainly used to work. UPDATE TWO: When I don't use my app code, the callback does fire each time. I'm very confused. Here's the code I used to test in the chrome console vs my app code:
I can't think why the request object would change anything but I'll try it without and report back. And yes, |
Are you always calling initialize multiple times? That may be leading to an inconsistent state. |
I wrote a wrapper for the
I turned all of the calls I use into promises so this particular piece of code receives the result of "isInitialized" and handles it accordingly. :) In any case, I can confirm it's not an issue with the plugin; I'm able to test in an isolated environment and observe proper functionality on 7 devices. I only posted here to get feedback from others in case they observed it as well. |
When I call the initialize function, the callback is called as expected, but when I disable or enable Bluetooth, it's not called again. I tried enabling BT using the device settings and using the
enable()
function, disabling only using the device settings.I'm using the following code:
And the following device:
The text was updated successfully, but these errors were encountered: