Reputation: 6451
I'm creating an iOS 7 app that will react to nearby beacons. However, I need to consider users that have an iPhone 4 or any other device that will not detect beacons. How can I tell if the device my app is running on supports beacons?
Upvotes: 0
Views: 252
Reputation: 444
If you want to monitor or range for beacons you might want to check if monitoring is available via CoreLocation Framework - Here is the way to do it :
if (![CLLocationManager isMonitoringAvailableForClass:[CLBeaconRegion class]]) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Monitoring not available" message:nil delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles: nil]; [alert show]; return;
}
else{ //Monitoring is available }
Upvotes: 0
Reputation: 10251
you can use CBCentral manager state. If it is CBCentralManagerStateUnsupported
it doesn't support BLE.
Upvotes: 1