有人可以确认这一点或指向我更多的信息/文件吗?
更具体一点 – 当我的应用程序(中央)转换到后台和主屏幕时,它会继续按预期发现外围设备,但是当我按下“睡眠/唤醒”按钮从而锁定设备时,它会停止发现我的外围设备.该应用程序没有崩溃或任何事情……事实上,当我解锁设备(返回主屏幕)时,它恢复发现外围设备而无需将其恢复到前台.我也明白,BLE在后台不太频繁地被触发,但在我的情况下,我在锁定状态下观看它超过一个小时并且它从未触发发现,但是一旦我解锁它就恢复正常.
我正在寻找一种解决方案,当设备(作为中央运行)被锁定时,我也能够发现外围设备.
谢谢你的帮助!
-H
更新中…
发现了一篇有趣的帖子,我想分享:http://web.archiveorange.com/archive/v/lBeBkjSSTe5jAan6ufTX
特别是观察(Brian Fudge)很有意思……
A scanning device that is locked does not report any iOS peripherals that are also locked.
On some devices,like iPhone 5 and 5S,you only need to press the home button on the peripheral for the scanner to succeed and
peripherals to be reported.On other devices,like iPad and iPod Touch,you have to press the home button and unlock the peripheral for the scanner to succeed and
peripherals to be reported.A non-iOS device,such as an rMBP,can scan iOS peripherals that are in the background and locked.
All iOS devices can scan hardware peripherals (such as a health tracker) while the iOS device is in the background and locked.