0.2.2 • Published 2 years ago
rn-ble-pic v0.2.2
rn-ble-pic
Pre-requisites
Android API >= 21 IOS >= 10.0 ReactNative >= 0.50
Getting started
$ npm install rn-ble-pic --save
Mostly automatic installation
$ react-native link rn-ble-pic
Manual installation
iOS
- In XCode, in the project navigator, right click
Libraries
➜Add Files to [your project's name]
- Go to
node_modules
➜rn-ble-pic
and addRNBlePic.xcodeproj
- In XCode, in the project navigator, select your project. Add
libRNBlePic.a
to your project'sBuild Phases
➜Link Binary With Libraries
- Run your project (
Cmd+R
)
Android
- Open up
android/app/src/main/java/[...]/MainActivity.java
- Add
import com.blepic.RNBlePicPackage;
to the imports at the top of the file - Add
new RNBlePicPackage()
to the list returned by thegetPackages()
method
- Append the following lines to
android/settings.gradle
:include ':rn-ble-pic' project(':rn-ble-pic').projectDir = new File(rootProject.projectDir, '../node_modules/rn-ble-pic/android')
- Insert the following lines inside the dependencies block in
android/app/build.gradle
:compile project(':rn-ble-pic')
Usage
// get an instance of BLEPIC module
import BLEPIC from "rn-ble-pic";
// add peripheral name
BLEPIC.setPeripheralName(name: string);
// add services
BLEPIC.addService(serviceUUID: string, primary: boolean, serviceData: string);
// add characteristics to a service
BLEPIC.addCharacteristicToService(serviceUUID: string, charUUID: string, permissions: int, properties: int, data: string);
// start advertising
BLEPIC.startAdvertising();
// check if currently advertising or not
BLEPIC.isAdvertising();
// stop advertising
BLEPIC.stopAdvertising();
0.2.1
2 years ago
0.2.2
2 years ago
0.2.0
4 years ago
0.1.93
4 years ago
0.1.92
4 years ago
0.1.91
4 years ago
0.1.9
4 years ago
0.1.8
5 years ago
0.1.7
5 years ago
0.1.6
5 years ago
0.1.5
5 years ago
0.1.4
5 years ago
0.1.3
5 years ago
0.1.2
5 years ago
0.1.1
5 years ago
0.1.0
5 years ago
0.0.5
5 years ago
0.0.4
5 years ago
0.0.3
5 years ago
0.0.2
5 years ago
0.0.1
5 years ago
1.0.1
5 years ago
1.0.0
5 years ago