An object that manages and advertises peripheral services exposed by this app.
- iOS 6.0+
- macOS 10.9+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
- Core Bluetooth
Core Bluetooth uses
CBPeripheral objects to manage published services within the local peripheral’s Generic Attribute Profile (GATT) database and to advertise these services to central devices (represented by
CBCentral objects). While a service is in the database, any connected central can see and connect to it. That said, if your app hasn’t specified the
bluetooth-peripheral background mode, the contents of its services become disabled when it’s in the background or in a suspended state. In this scenario, any remote central trying to access the service’s characteristic value or characteristic descriptors receives an error.
Before you call
CBPeripheral methods, the peripheral manager object must be in the powered-on state, as indicated by the
CBPeripheral. This state indicates that the device (your iPhone or iPad, for instance) supports Bluetooth low energy and that its Bluetooth is on and available for use.