0

I have an iOS app that is connecting to a device using a ble. iOS 7 is working. After upgrading to iOS 8, the CBCentralManager is not finding any peripherals.

    case CBCentralManagerStatePoweredOn:
    {

        NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:FALSE], CBCentralManagerScanOptionAllowDuplicatesKey, nil];
        //NSArray *services = [NSMutableArray new];
        NSArray *services = @[[CBUUID UUIDWithString:@"0000FBB0-494C-4F47-4943-544543480000"], [CBUUID UUIDWithString:@"180A"]];
        [centralManager scanForPeripheralsWithServices:services options:options];

        break;
    }
Youssif Saeed
  • 11,789
  • 4
  • 44
  • 72
cgty
  • 1

1 Answers1

0

Try moving this code:

 NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:FALSE], CBCentralManagerScanOptionAllowDuplicatesKey, nil];
    //NSArray *services = [NSMutableArray new];
    NSArray *services = @[[CBUUID UUIDWithString:@"0000FBB0-494C-4F47-4943-544543480000"], [CBUUID UUIDWithString:@"180A"]];
    [centralManager scanForPeripheralsWithServices:services options:options];

into an Iba action and then call the action on CBCentralManagerStatePoweredOn

Jay
  • 97
  • 1
  • 2
  • 12