Instance Method

add(_:)

Publishes a service and any of its associated characteristics and characteristic descriptors to the local GATT database.

Declaration

func add(_ service: CBMutableService)

Parameters

service

The service you want to publish.

Discussion

When you add a service to the database, the peripheral manager calls the peripheralManager(_:didAdd:error:) method of its delegate object. If the service contains any included services, you must publish them first.

See Also

Adding and Removing Services

func remove(CBMutableService)

Removes a specified published service from the local GATT database.

func removeAllServices()

Removes all published services from the local GATT database.

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