0.2.2 • Published 4 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-picand addRNBlePic.xcodeproj - In XCode, in the project navigator, select your project. Add
libRNBlePic.ato 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
4 years ago
0.2.2
4 years ago
0.2.0
6 years ago
0.1.93
6 years ago
0.1.92
6 years ago
0.1.91
6 years ago
0.1.9
6 years ago
0.1.8
6 years ago
0.1.7
6 years ago
0.1.6
6 years ago
0.1.5
6 years ago
0.1.4
6 years ago
0.1.3
6 years ago
0.1.2
6 years ago
0.1.1
6 years ago
0.1.0
6 years ago
0.0.5
6 years ago
0.0.4
6 years ago
0.0.3
6 years ago
0.0.2
6 years ago
0.0.1
6 years ago
1.0.1
6 years ago
1.0.0
6 years ago