Comments (10)
For more background, I can request state in an noblebindings.init, but it arrives before the component is created..
2015-10-01 13:31:21.200 [info][tid:com.facebook.React.JavaScript] 'calling RNBLE.getState'
2015-10-01 13:31:21.210 [info][tid:com.facebook.React.RNBLEQueue][RNBLE.m:61] getState
2015-10-01 13:31:21.233 [info][tid:com.facebook.React.JavaScript] 'stateChange poweredOn'
2015-10-01 13:31:21.236 [info][tid:com.facebook.React.JavaScript] 'Running application "BabelES6" with appParams: {"rootTag":1,"initialProps":{}}. __DEV__ === true, development-level warning are ON, performance optimizations are OFF'
2015-10-01 13:31:21.282 [warn][tid:com.facebook.React.JavaScript] 'devtools socket errored', [Error: The operation couldn’t be completed. Connection refused]
2015-10-01 13:31:21.334 [info][tid:com.facebook.React.JavaScript] 'peripheral discovered (7338CDAA-609D-F579-53C6-DCD965D11483 with address <unknown, unknown>, connectable true, RSSI -68:'
from react-native-ble.
@jacobrosenthal I've removed the bindings self "init"ing themselves pattern from noble and bleno. Now init
gets called externally in the Noble or Bleno constructor:
from react-native-ble.
Ill give it a shot today!
On Sat, Oct 3, 2015 at 6:30 PM, Sandeep Mistry [email protected]
wrote:
Noble
from react-native-ble.
Fixed in v0.0.5 Thanks!
from react-native-ble.
This is back again since I upgraded rn
https://github.com/jacobrosenthal/react-native-ble/blob/master/examples/BabelES6/index.ios.js#L18
from react-native-ble.
Using a super shitty hack to fix this for the moment.
e96a34f
Better ideas accepted
from react-native-ble.
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 Navigator
component. You may hit a scene where you want to search for stuff, and then all of a sudden cancel out of it, and then later on want to go back to it again. If I'm not mistaken, the current noble
pattern seems to indicate that you get to catch that Bluetooth state once and only in the beginning of the app's runtime. In a mobile app, I think you need to have the ability to request the Bluetooth state on-demand given the scenarios that I stated above. I think the noble
library needs to have a getState
method that a custom bindings needs to implement. For example,
// 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?
from react-native-ble.
I dont think it should be needed. noble.state is updated as the os emits the state changes.
from react-native-ble.
I thought you didn't want to depend on that state property to start Bluetooth operations.
from react-native-ble.
Were talking about 2 separate issues. A lot of existing code just waits for
a state change to do anything. We were always losing this initial state
change, and I wanted to support that existing code out of the box.
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]
wrote:
I thought you didn't want to depend on that state property to start
Bluetooth operations.—
You are receiving this because you modified the open/close state.
Reply to this email directly or view it on GitHub
#1 (comment)
from react-native-ble.
Related Issues (20)
- noble.state is `unsupported` on evey other launch (iOS) HOT 2
- Build Fail with RN v .0.40.0 'sendDeviceEventWithName:body:' is deprecated
- ios simulator app crashing with react-native-ble library installed HOT 2
- Error with running App with react-native-ble on Android in debug mode HOT 3
- Unable to resolve module 'url' HOT 6
- Evaluate react-native-ble-plx native code HOT 4
- noble.on is not a function HOT 2
- sendDeviceEventWithName:body is deprecated
- noble characteristic write error : 'Invalid parameter not satisfying: data != nil'
- Cannot subscribe to multiple characteristics HOT 3
- Cannot read property 'getState' of undefined HOT 2
- discoverIncludedServices not implemented for Android
- Can't read descriptor value
- Can't get characteristics list of a service HOT 3
- Crash on iOS HOT 4
- Eddystone protocol
- Different UUID format when running in my RN app and directly from noble/example/advertisement.js HOT 5
- List of characteristics are empty in service HOT 1
- Use Polidea's BLE for android and iOS under the hood
- How to advertise?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-ble.