Socket
Socket
Sign inDemoInstall

react-native-ble-manager

Package Overview
Dependencies
Maintainers
1
Versions
161
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-ble-manager - npm Package Compare versions

Comparing version 2.3.0 to 2.4.0

12

BleManager.js

@@ -23,2 +23,14 @@ 'use strict';

readRSSI(peripheralId) {
return new Promise((fulfill, reject) => {
bleManager.readRSSI(peripheralId, (error, rssi) => {
if (error) {
reject(error);
} else {
fulfill(rssi);
}
});
});
}
write(peripheralId, serviceUUID, characteristicUUID, data, maxByteSize) {

@@ -25,0 +37,0 @@ if (maxByteSize == null) {

2

package.json
{
"name": "react-native-ble-manager",
"version": "2.3.0",
"version": "2.4.0",
"description": "A BLE module for react native.",

@@ -5,0 +5,0 @@ "main": "BleManager",

@@ -64,2 +64,5 @@ # react-native-ble-manager

```
##Note
Android API >= 23 require the ACCESS_COARSE_LOCATION permission to scan for peripherals.
React Native >= 0.33 natively support PermissionsAndroid like in the example.

@@ -74,3 +77,5 @@ ##Basic Example

TouchableHighlight,
NativeAppEventEmitter
NativeAppEventEmitter,
Platform
PermissionsAndroid
} from 'react-native';

@@ -96,2 +101,18 @@ import BleManager from 'react-native-ble-manager';

.addListener('BleManagerDiscoverPeripheral', this.handleDiscoverPeripheral );
if (Platform.OS === 'android' && Platform.Version >= 23) {
PermissionsAndroid.checkPermission(PermissionsAndroid.PERMISSIONS.ACCESS_COARSE_LOCATION).then((result) => {
if (result) {
console.log("Permission is OK");
} else {
PermissionsAndroid.requestPermission(PermissionsAndroid.PERMISSIONS.ACCESS_COARSE_LOCATION).then((result) => {
if (result) {
console.log("User accept");
} else {
console.log("User refuse");
}
});
}
});
}
}

@@ -98,0 +119,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc