-
Notifications
You must be signed in to change notification settings - Fork 45
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
no initial stateChange #1
Comments
For more background, I can request state in an noblebindings.init, but it arrives before the component is created..
|
@jacobrosenthal I've removed the bindings self "init"ing themselves pattern from noble and bleno. Now |
Ill give it a shot today! On Sat, Oct 3, 2015 at 6:30 PM, Sandeep Mistry [email protected]
|
Fixed in v0.0.5 Thanks! |
This is back again since I upgraded rn |
Using a super shitty hack to fix this for the moment. Better ideas accepted |
We may need to consider the case that in a mobile app, even though there is Bluetooth functionality, you may never use it unless you hit a particular scene via the // noble.js
noble.prototype.getState = function(callback) {
if (callback) {
this.once('stateChange', callback);
}
this._bindings.getState();
};
// bindings.ios.js
nobleBindings.getState = function() {
// Calls the native module (we have it already)
RNBLE.getState();
}; Thoughts? |
I dont think it should be needed. noble.state is updated as the os emits the state changes. |
I thought you didn't want to depend on that state property to start Bluetooth operations. |
Were talking about 2 separate issues. A lot of existing code just waits for Secondly, yes you may check and or poll noble.state if you like. On Sun, May 1, 2016 at 8:22 PM, Richard Lai [email protected]
|
The existing bindings seem to just happen to catch the initial statechange, but with all the react setup that event is lost before we're all set up to catch it.
Currently I'm not waiting for a stateChange event, Im just scanning as soon as the app opens.
The text was updated successfully, but these errors were encountered: