ios 蓝牙状态判断

2019-11-29 16:15:46 +08:00
 Ocsap

iOS 蓝牙有三种状态: 一种是蓝色,可连接状态 一种是灰色,不连接状态 一种是斜线,关闭状态

问题是,后两者都是 CBManagerStatePoweredOff

有什么方法可以判断区分后两个状态吗?

9037 次点击
所在节点    iDev
3 条回复
fruitscandy
2019-11-29 20:49:56 +08:00
白底那个是从控制中心关闭的,非彻底
灰色那个是从设置里面关闭的,彻底
Ocsap
2019-12-03 10:31:05 +08:00
@fruitscandy 是的,,,怎么用代码判断
QiuZH
2020-12-04 13:27:39 +08:00
CBManagerState 里面有应该就有,没有就没办法了吧
* @constant CBManagerStateUnknown State unknown, update imminent.
* @constant CBManagerStateResetting The connection with the system service was momentarily lost, update imminent.
* @constant CBManagerStateUnsupported The platform doesn't support the Bluetooth Low Energy Central/Client role.
* @constant CBManagerStateUnauthorized The application is not authorized to use the Bluetooth Low Energy role.
* @constant CBManagerStatePoweredOff Bluetooth is currently powered off.
* @constant CBManagerStatePoweredOn Bluetooth is currently powered on and available to use.

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/624352

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX