Protocol

CBPeripheralManagerDelegate

The delegate of a CBPeripheralManager object must adopt the CBPeripheralManagerDelegate protocol, a protocol consisting of numerous optional methods and one required method. The protocol’s optional methods are used by the delegate to verify publishing and advertising, and to monitor read, write, and subscription requests from remote central devices. The protocol’s required method, which indicates whether the peripheral manager is available, is called when the peripheral manager’s state is updated.

Declaration

@protocol CBPeripheralManagerDelegate

Topics

Monitoring Changes to the Peripheral Manager’s State

- peripheralManagerDidUpdateState:

Invoked when the peripheral manager's state is updated.

Required.

- peripheralManager:willRestoreState:

Invoked when the peripheral manager is about to be restored by the system.

Adding Services

- peripheralManager:didAddService:error:

Invoked when you publish a service, and any of its associated characteristics and characteristic descriptors, to the local Generic Attribute Profile (GATT) database.

Advertising Peripheral Data

- peripheralManagerDidStartAdvertising:error:

Invoked when you start advertising the local peripheral device’s data.

Monitoring Subscriptions to Characteristic Values

- peripheralManager:central:didSubscribeToCharacteristic:

Invoked when a remote central device subscribes to a characteristic’s value.

- peripheralManager:central:didUnsubscribeFromCharacteristic:

Invoked when a remote central device unsubscribes from a characteristic’s value.

- peripheralManagerIsReadyToUpdateSubscribers:

Invoked when a local peripheral device is again ready to send characteristic value updates.

Receiving Read and Write Requests

- peripheralManager:didReceiveReadRequest:

Invoked when a local peripheral device receives an Attribute Protocol (ATT) read request for a characteristic that has a dynamic value.

- peripheralManager:didReceiveWriteRequests:

Invoked when a local peripheral device receives an Attribute Protocol (ATT) write request for a characteristic that has a dynamic value.

Relationships

Inherits From

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software