MPuhakka / react-native-ble

Central role BLE for react native noble api surface

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

react-native-ble

Central role ble for react native. Technically a shim for the excellent noble

#install The depenency story on react native is still very incomplete so bear with me. From your existing react native project:

npm i --save react-native-ble

Next see the react native linking guide for visual instructions, but you need to open your project and from node_modules/react-native-estimote drag RNBLE.xcodeproj into your project file browser under Libraries. Then, navigate to your top level project and for your main target, click Build Phases and drag the RNBLE.a Product into the Link Binary With Libraries section. Finally, click the plus button and add CoreBluetooth.framework as well.

On Android, also see https://facebook.github.io/react-native/docs/native-modules-android.html#register-the-module in the paragraph starting "The package needs to be provided..." for the required edits to getPackages() in MainApplication.java.

#use See the noble api for usage

var noble = ('react-native-ble');

Better yet, as in the example, include as noble

var noble = ('noble');

And in your package json resolve noble to react native

  "browser": {
    "noble": "react-native-ble"
  },

This way you can shim all dependencies that might have been looking for noble too.

About

Central role BLE for react native noble api surface

License:MIT License


Languages

Language:Java 48.3%Language:Objective-C 33.4%Language:JavaScript 18.3%