3

I need detect the bluetooth really closed in control center in iOS.

But I try to find the APIs. In the delegate method can't detect the bluetooth really close in the control center.

 -(void) centralManagerDidUpdateState:(CBCentralManager *)central{
 switch (central.state) {
    case CBManagerStateUnknown:
         break;
    case CBManagerStateResetting:
         break;
    case CBManagerStateUnsupported:
         break;
    case CBManagerStateUnauthorized:
         break;
    case CBManagerStatePoweredOff:
         break;
    case CBManagerStatePoweredOn:    
        break;
    default:
        break;
}

}

When I disconnect bluetooth in this state (below photo), the bluetooth not really close, but the API will enter "CBManagerStatePoweredOff" switch case.

This state can't tell me the bluetooth really close(like in setting page bluetooth button switch closed)

enter image description here

How can I detect the state in the control center about the bluetooth.

Thank you very much.

dickfala
  • 3,246
  • 3
  • 31
  • 52

1 Answers1

-3

You have to implement delegate for CBCentralManager