简体   繁体   English

在 Android 上检测 iOS BLE 广告 - React Native BLE Advertiser

[英]Detecting iOS BLE advertising on Android - React Native BLE Advertiser

I've been using react-native-ble-advertiser to try and send string data (the broadcast uuid) between phones, I've managed to get these sharing compatabilities我一直在使用react-native-ble-advertiser尝试在手机之间发送字符串数据(广播 uuid),我设法获得了这些共享兼容性

  1. iOS to iOS 2-way iOS 转 iOS 2 路
  2. Android to Android 2-way Android 转 Android 2 路
  3. Android to iOS 1-way Android 转 iOS 1路

I'm wondering if perhaps I missed something for BLE as when I try to advertise on iOS I get the warning The advertisement key 'Manufacturer Data' is not allowed in CoreBluetooth however as I said I can detect iOS to iOS.我想知道当我尝试在 iOS 上做广告时,我是否错过了 BLE 的某些内容,我收到警告The advertisement key 'Manufacturer Data' is not allowed in CoreBluetooth但是正如我所说,我可以检测到 iOS 到 Z1BDF605908204DB1ZCBDF。 Is there any way to detect iOS on Android?有什么方法可以检测 Android 上的 iOS?

Below is my configuration taken from the example on the github link above.下面是我从上面的 github 链接上的示例中获取的配置。
The scanning and broadcasting is done at the same time, though I tested without this and still had the issue.扫描和广播是同时完成的,虽然我没有这个测试过,但仍然有问题。

const MANUF_DATA = [1, 0];
BLEAdvertiser.setCompanyId(0x4C);
BLEAdvertiser.broadcast(hash_uuid, MANUF_DATA, {
    advertiseMode: BLEAdvertiser.ADVERTISE_MODE_BALANCED,
    txPowerLevel: BLEAdvertiser.ADVERTISE_TX_POWER_MEDIUM,
    ...
})

BLEAdvertiser.scan(MANUF_DATA, {
    scanMode: BLEAdvertiser.SCAN_MODE_LOW_LATENCY,
})

Does anyone have experience with this package or know of a better way to transmit a string?有没有人有这个 package 的经验或者知道传输字符串的更好方法? Open to posting the native code from the package.打开从 package 发布本机代码。

Thanks.谢谢。

Contacted the package developer and it is a known issue with iOS and Apple blocking adjusting CoreBluetooth manufacturer data (the package needs this to scan properly)联系了 package 开发人员,这是 iOS 和 Apple 阻止调整 CoreBluetooth 制造商数据的已知问题(package 需要此才能正确扫描)

"Unfortunately, Apple keeps finding ways to break the advertiser. A few months ago, they started blocking the use of manufacturer data that makes the phone visible to Android and we have not been able to find a way around it yet." “不幸的是,Apple 一直在想方设法破坏广告商。几个月前,他们开始阻止使用制造商数据,使 Android 可以看到手机,我们还没有找到解决方法。”

Will continue to resolve this on my own and update if I get a solution or the package is updated:)如果我得到解决方案或 package 已更新,我将继续自行解决并更新:)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 与MiBand反应本机BLE - React Native BLE with MiBand 是否可以在 React-Native(iOS&Android) 中获得自己设备的 BLE Mac? - Is it possible to get BLE Mac of own device in React-Native(iOS&Android)? react-native-ble-plx:在 iOS 背景和暂停模式下的 BLE 扫描 - react-native-ble-plx: BLE Scanning in iOS Background & Suspended mode bleManager.startDeviceScan 不适用于 iOS react-native-ble-plx - bleManager.startDeviceScan not working on iOS react-native-ble-plx Raspberry pi 蓝牙未在基于 React-Native 的应用程序上检测到。 (使用 react-native-ble-magaer) - Raspberry pi bluetooth not detecting on React-Native based application. (Used react-native-ble-magaer) 在写入特征时反应本机 BLE 管理器(Android)状态代码 14 - React Native BLE Manager (Android) status code 14 on write to characteristic 读取制造商数据 BLE 设备 react-native-ble-plx - Read Manufacturer data BLE device react-native-ble-plx 在iOS上使用react-native和react-native-ble-plx时如何解决此错误? - How can I solve this error when using react-native and react-native-ble-plx on iOS? polidea BLE 解码本机反应中的特征值 - polidea BLE decode characteristic value in react native React Native:BLE,发现和广播(广告数据) - React Native : BLE, Discover & Broadcast (advertise data)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM