<!--
{
  "availability" : [
    "iOS: 6.0.0 -",
    "iPadOS: 6.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.9.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreBluetooth",
  "identifier" : "/documentation/CoreBluetooth/CBPeripheralManager/add(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Core Bluetooth"
    ],
    "preciseIdentifier" : "c:objc(cs)CBPeripheralManager(im)addService:"
  },
  "title" : "add(_:)"
}
-->

# add(_:)

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

```
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:)`](/documentation/CoreBluetooth/CBPeripheralManagerDelegate/peripheralManager(_:didAdd:error:)) method of its delegate object. If the service contains any included services, you must first publish them.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)