react-native-ble-manager
Advanced tools
Comparing version 7.0.0 to 7.1.0
@@ -31,3 +31,4 @@ declare module 'react-native-ble-manager' { | ||
scanMode?: number; | ||
} | ||
reportDelay?: number; | ||
} | ||
@@ -34,0 +35,0 @@ export function scan(serviceUUIDs: string[], seconds: number, allowDuplicates?: boolean, options?: ScanOptions): Promise<void>; |
{ | ||
"name": "react-native-ble-manager", | ||
"version": "7.0.0", | ||
"version": "7.1.0", | ||
"description": "A BLE module for react native.", | ||
@@ -5,0 +5,0 @@ "main": "BleManager", |
@@ -9,4 +9,5 @@ # react-native-ble-manager | ||
## Requirements | ||
RN 0.40+ | ||
RN 0.60+ | ||
RN 0.40-0.59 supported until 6.7.X | ||
RN 0.30-0.39 supported until 2.4.3 | ||
@@ -22,73 +23,7 @@ | ||
``` | ||
After installing, you need to link the native library. You can either: | ||
* Link native library with `react-native link`, or | ||
* Link native library manually | ||
The library support the autolink feature. | ||
Both approaches are described below. | ||
### Link Native Library with `react-native link` | ||
##### Android - Update Manifest | ||
```shell | ||
react-native link react-native-ble-manager | ||
``` | ||
After this step: | ||
* iOS should be linked properly. | ||
* Android will need one more step, you need to edit `android/app/build.gradle`: | ||
```gradle | ||
// file: android/app/build.gradle | ||
... | ||
android { | ||
... | ||
defaultConfig { | ||
... | ||
minSdkVersion 19 // <--- make sure this is 19 or greater | ||
... | ||
} | ||
... | ||
} | ||
``` | ||
### Link Native Library Manually | ||
#### iOS | ||
- Open the node_modules/react-native-ble-manager/ios folder and drag BleManager.xcodeproj into your Libraries group. | ||
- Check the "Build Phases"of your project and add "libBleManager.a" in the "Link Binary With Libraries" section. | ||
#### Android | ||
##### Update Gradle Settings | ||
```gradle | ||
// file: android/settings.gradle | ||
... | ||
include ':react-native-ble-manager' | ||
project(':react-native-ble-manager').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-ble-manager/android') | ||
``` | ||
##### Update Gradle Build | ||
```gradle | ||
// file: android/app/build.gradle | ||
... | ||
android { | ||
... | ||
defaultConfig { | ||
... | ||
minSdkVersion 19 // <--- make sure this is 19 or greater | ||
... | ||
} | ||
... | ||
} | ||
dependencies { | ||
... | ||
compile project(':react-native-ble-manager') | ||
} | ||
``` | ||
##### Update Android Manifest | ||
```xml | ||
@@ -103,22 +38,5 @@ // file: android/app/src/main/AndroidManifest.xml | ||
##### Register React Package | ||
```java | ||
... | ||
import it.innove.BleManagerPackage; // <--- import | ||
##### iOS - Update Info.plist | ||
In iOS >= 13 you need to add the `NSBluetoothAlwaysUsageDescription` string key. | ||
public class MainApplication extends Application implements ReactApplication { | ||
... | ||
@Override | ||
protected List<ReactPackage> getPackages() { | ||
return Arrays.<ReactPackage>asList( | ||
new MainReactPackage(), | ||
new BleManagerPackage() // <------ add the package | ||
); | ||
} | ||
... | ||
} | ||
``` | ||
## Note | ||
@@ -129,3 +47,2 @@ - Remember to use the `start` method before anything. | ||
- Before write, read or start notification you need to call `retrieveServices` method | ||
- iOS >= 13 need `NSBluetoothAlwaysUsageDescription` key in `Info.plist` file | ||
@@ -185,2 +102,3 @@ ## Example | ||
- `scanMode` - `Number` - corresponding to [`setScanMode`](https://developer.android.com/reference/android/bluetooth/le/ScanSettings.Builder.html#setScanMode(int)) | ||
- `reportDelay` - `Number` - corresponding to [`setReportDelay`](https://developer.android.com/reference/android/bluetooth/le/ScanSettings.Builder.html#setReportDelay(long)) | ||
@@ -187,0 +105,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
2272
186126
639