我知道 iOS 允许基于 iBeacon 的后台区域监控,但我找不到指示用户是否必须启用蓝牙的文档?
如果从控制中心禁用蓝牙,它还能工作吗? 如果用户禁用了蓝牙,我觉得这几乎没用。
最佳答案
是的,需要启用蓝牙。您如何回应它被禁用是特定于应用程序的。
此链接(位置和 map 编程指南):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.
关于禁用蓝牙时的 iOS 信标区域监控,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29351920/