文档模板:v0.4.2
react-native-ble-manager
本项目基于 react-native-ble-manager 开发。
该第三方库的仓库已迁移至 Gitcode,且支持直接从 npm 下载,新的包名为:@react-native-ohos/react-native-ble-manager,版本所属关系如下:
| 三方库名称 | 三方库版本(npm地址) | 发布信息 | 支持RN版本 | Autolink | 编译API版本 | 社区基线版本 | 源码地址 |
|---|---|---|---|---|---|---|---|
| @react-native-ohos/react-native-ble-manager | ~ 12.2.0(开发中) | Gitcode Releases | 0.82.* | 是 | API12+ | 12.2.2 | br_rnoh0.82 |
| @react-native-ohos/react-native-ble-manager | ~ 12.1.7 | Gitcode Releases | 0.77.* | 否 | API12+ | 12.1.5 | br_rnoh0.77 |
| @react-native-oh-tpl/react-native-ble-manager | <= 11.5.3@deprecated | Github Releases(deprecated) | 0.72.* | 否 | API12+ | 11.5.2 | sig |
简介
react-native-ble-manager 是用于 React Native 的蓝牙低功耗(BLE)通信管理库。
支持扫描、连接外围设备,获取外围设备的服务与特征,以及特征的读取、写入、开启通知等操作。
下载安装
进入到工程目录并输入以下命令:
npm
# RN 0.72
npm install @react-native-oh-tpl/react-native-ble-manager
# RN 0.77/0.82
npm install @react-native-ohos/react-native-ble-manager
yarn
# RN 0.72
yarn add @react-native-oh-tpl/react-native-ble-manager
# RN 0.77/0.82
yarn add @react-native-ohos/react-native-ble-manager