简体   繁体   English

iOS Core Bluetooth没有断开连接通知

[英]iOS Core Bluetooth no disconnect notification

I'm developing an app using CoreBluetooth and I need to be notified if the bluetooth connection is lost. 我正在使用CoreBluetooth开发一个应用程序,如果蓝牙连接丢失,我需要收到通知。 I establish connection with many BLE devices, put the app into background mode and wait for disconnect notification. 我与许多BLE设备建立连接,将应用程序置于后台模式并等待断开连接通知。 The problem is I get didDisconnect method is invoked only if I push the off button on my BLE device but not when I get out of range. 问题是我只有在我的BLE设备上按下关闭按钮时才会调用didDisconnect方法,但是当我超出范围时则不会。 Do you have any idea why this could happen? 你知道为什么会这样吗?

Thanks in advance for your reply. 在此先感谢您的回复。

Devices don't disconnect automatically when they get away from each other. 设备在彼此远离时不会自动断开连接。 You have to do that by yourself. 你必须自己做。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM