iOS 禁用蓝牙时的信标区域监控

iOS Beacon Region Monitoring when Bluetooth is disabled

我知道 iOS 允许基于 iBeacon 的后台区域监控,但我找不到指示用户是否必须启用蓝牙的文档?

如果从控制中心禁用了蓝牙,它还能工作吗? 我觉得如果用户禁用了蓝牙,这几乎没用。

是的,需要启用蓝牙。您如何回应它被禁用是特定于应用程序的。

此 link(位置和地图编程指南):https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/LocationAwarenessPG/RegionMonitoring/RegionMonitoring.html

就场景以及您可能如何处理它们提供了一些指导。

In iOS 7.0 and later, always call the isMonitoringAvailableForClass: and authorizationStatus class methods of CLLocationManager before attempting to monitor regions. (In OS X v10.8 and later and in previous versions of iOS, use the regionMonitoringAvailable class instead.) The isMonitoringAvailableForClass: method tells you whether the underlying hardware supports region monitoring for the specified class at all. If that method returns NO, your app can’t use region monitoring on the device. If it returns YES, call the authorizationStatus method to determine whether the app is currently authorized to use location services. If the authorization status is kCLAuthorizationStatusAuthorized, your app can receive boundary crossing notifications for any regions it registered. If the authorization status is set to any other value, the app doesn’t receive those notifications.