I'm having trouble getting Core Bluetooth to discover peripherals on iOS 8. Same code works fine on iOS 7 device. Initially I thought it would be a permissions issue since I had been doing some iBeacon work and there are some changes in Core Location permissions on iOS 8. I couldn't find anything online that helped with that however. Here is a link to a sample project that works fine for me on iOS 7 but not on iOS 8:
https://github.com/elgreco84/PeripheralScanning
If I run this project on an iOS 7 device it will log advertisement data for a number of devices around me. On iOS 8 the only output I see is that the Central Manager state is "Powered On".
It isn't valid to start scanning for peripherals until you are in the 'powered on' state. Perhaps on your iOS7 device you are lucky with timing, but the code is still incorrect. Your centralManagerDidUpdateState:
should be
- (void)centralManagerDidUpdateState:(CBCentralManager *)central
{
switch (central.state)
{
case CBCentralManagerStateUnsupported:
{
NSLog(@"State: Unsupported");
} break;
case CBCentralManagerStateUnauthorized:
{
NSLog(@"State: Unauthorized");
} break;
case CBCentralManagerStatePoweredOff:
{
NSLog(@"State: Powered Off");
} break;
case CBCentralManagerStatePoweredOn:
{
NSLog(@"State: Powered On");
[self.manager scanForPeripheralsWithServices:nil options:nil];
} break;
case CBCentralManagerStateUnknown:
{
NSLog(@"State: Unknown");
} break;
default:
{
}
}
}
And remove the call to scanForPeripheralsWithServices
from didFinishLaunchingWithOptions