Invoked when the peripheral manager's state is updated.
- iOS 6.0+
- macOS 10.9+
- tvOS 9.0+
- watchOS 4.0+
- Mac Catalyst 13.0+Beta
- Core Bluetooth
The peripheral manager whose state has changed.
You implement this required method to ensure that Bluetooth low energy is supported and available to use on the local peripheral device. Issue commands to the peripheral manager only when the state of the peripheral manager is powered on, as indicated by the
CBPeripheral constant. A state with a value lower than
CBPeripheral implies that advertising has stopped and that any connected centrals have been disconnected. If the state moves below
CBPeripheral, advertising has stopped and must be explicitly restarted. In addition, the local database is cleared and all services must be explicitly added again. For a complete list and discussion of the possible values representing the state of the peripheral manager, see the
CBPeripheral enumeration in