0.2.2 • Published 2 years ago

rn-ble-pic v0.2.2

Weekly downloads
78
License
-
Repository
github
Last release
2 years ago

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

  1. In XCode, in the project navigator, right click LibrariesAdd Files to [your project's name]
  2. Go to node_modulesrn-ble-pic and add RNBlePic.xcodeproj
  3. In XCode, in the project navigator, select your project. Add libRNBlePic.a to your project's Build PhasesLink Binary With Libraries
  4. Run your project (Cmd+R)

Android

  1. 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 the getPackages() method
  1. 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')
  2. 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