npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-blemonitoringmanager

v1.0.9

Published

DLC 蓝牙工具

Downloads

17

Readme

react-native-BLEMonitoringManager

DLC 迪尔西 React native 蓝牙检测 SDK

1. 初始化 Setup

npm install --save react-native-BLEMonitoringManager
# --- or ---
yarn add react-native-BLEMonitoringManager

📌 记得添加蓝牙权限到 AndroidManifest.xml for android and Info.plist for iOS (Xcode >= 8). See iOS Notes or Android Notes for more details.

2. Using react-native link 链接到原生库

react-native link react-native-BLEMonitoringManager

注意事项 iOS


  1. 该静态文件不支持 bitcode, 在工程中 TARGETS -> Build Settings ->Build Options -> Enable Bitcode 设置为 NO
  2. 如果需要调试,请在真机上调试, libBLEManager 不支持模拟器上面的调试

注意事项 android

  1. Android 从 4.3 开始支持 BLE,所以需在 AndroidManifest.xml 中添加如下 配置

<uses-sdkandroid:minSdkVersion="18"/>
<uses-permissionandroid:name="android.permission.BLUETOOTH" />
<uses-permissionandroid:name=android.permission.BLUETOOTH_ADMIN" />
  1. 蓝牙功能需要用到一个关键服务 BleService,需在 AndroidManifest.xml 中添 加如下配置:

<service android:name="com.ble.ble.BleService" android:enabled="true"android:exported="false"/>
  1. 在android 6.0之后用到蓝牙搜索的时候是需要开启模糊定位权限的,模糊定位是一个危险权限,故需要用到谷歌官方推荐的方法来解决;在应用启动之后 应该马上请求 定位权限

async requestLocationPermission() {
try {
const granted = await       PermissionsAndroid.request(PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION, {
//第一次请求拒绝后提示用户你为什么要这个权限
title: '我要地址查询权限',
message: '没权限我不能工作,同意就好了'
});

if (granted === PermissionsAndroid.RESULTS.GRANTED) {
//用户同意定位成功 才可以开始搜索蓝牙
} else {
//用户拒绝定位  是不可能搜索到蓝牙设备的

}
} catch (err) {
// this.show(err.toString());
}
}