【问题标题】:Waking up a killed app using didEnterRegion and then scanning for peripherals using scanForPeripheralsWithServices使用 didEnterRegion 唤醒被杀死的应用程序,然后使用 scanForPeripheralsWithServices 扫描外围设备
【发布时间】:2015-01-03 02:01:47
【问题描述】:

我知道即使应用程序被终止,使用 iBeacons 的常用方法是使用 Monitoring(例如,监控由 UUID 定义的区域)并且当调用 didEnterRegion 时启动 iBeacons 的 Ranging(获取每个信标的主要和次要)。

有没有人尝试过运行 Corebluetooth scanForPeripheralsWithServices 而不是 Ranging? 这不会给出主要和次要 - iOS 从 Corebluetooth API 隐藏 iBeacon 标识符(uuid、主要和次要)。 但是,它可以提供非标准 iBeacon 宣传的其他信息(或周围的其他 BLE 外围设备),甚至可以让您连接到它们(在 5 秒内“唤醒”)。

谢谢

【问题讨论】:

  • 你做到了吗?

标签: ios bluetooth bluetooth-lowenergy core-bluetooth ibeacon


【解决方案1】:

是的,你说的绝对有可能。正如您所指出的,由于您无法访问信标标识符,因此您将不知道来自scanForPeripheralsWithServices 的回调中的哪个外围设备是触发区域进入事件的信标。但是,您当然可以在您的应用通过此事件启动到后台后短暂扫描这些设备。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-09-13
    • 1970-01-01
    • 2020-10-23
    相关资源
    最近更新 更多