客观的C检,如果蓝牙可用性更改 [英] objective c check if Bluetooth Availability Changed

查看:136
本文介绍了客观的C检,如果蓝牙可用性更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题很简单:有什么办法,当用户启用或禁用iOS设备

The question is simple: Is there any way to get noticed when the users enables or disables bluetooth on a iOS device?

我在网上搜索,但只是发现了一些私人API's。

I searched the internet but just found some private API´s.

感谢您的帮助。

推荐答案

您可以使用蓝牙低耗能的(BTLE)接口。每当用户禁用/启用蓝牙设置,您将得到更新。检查<一个href=\"https://developer.apple.com/library/mac/documentation/CoreBluetooth/Reference/CBCentralManagerDelegate_Protocol/translated_content/CBCentralManagerDelegate.html#//apple_ref/occ/intfm/CBCentralManagerDelegate/centralManagerDidUpdateState%3a\"相对=nofollow> CBCentralManagerDelegate协议参考。当然,你也可以检查<一个href=\"https://developer.apple.com/library/ios/documentation/CoreBluetooth/Reference/CBCentralManager_Class/translated_content/CBCentralManager.html#//apple_ref/occ/instp/CBCentralManager/state\"相对=nofollow>状态

You can use Bluetooth Low Energy's (BTLE) interface. You will get updates whenever an user disables/enables Bluetooth in settings. Check the CBCentralManagerDelegate Protocol Reference. And of course you can also check the state

这篇关于客观的C检,如果蓝牙可用性更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆