<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "PushToTalk",
  "identifier" : "/documentation/PushToTalk/PTChannelManager/setServiceStatus(_:channelUUID:completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Push to Talk"
    ],
    "preciseIdentifier" : "c:objc(cs)PTChannelManager(im)setServiceStatus:forChannelUUID:completionHandler:"
  },
  "title" : "setServiceStatus(_:channelUUID:completionHandler:)"
}
-->

# setServiceStatus(_:channelUUID:completionHandler:)

Sets the service connection status.

```
func setServiceStatus(_ status: PTServiceStatus, channelUUID: UUID, completionHandler: (@Sendable ((any Error)?) -> Void)? = nil)
```

```
func setServiceStatus(_ status: PTServiceStatus, channelUUID: UUID) async throws
```

## Parameters

`status`

The service status.

`channelUUID`

The channel identifier.

`completionHandler`

The completion handler.

- `error`: An error, if any, that indicates the reason why the system couldn’t set the status of the service.

## Discussion

> Important:
> You can call this method from synchronous code using a completion handler, as shown on this page, or you can call it as an asynchronous method that has the following declaration:
> 
> ```swift
> func setServiceStatus(_ status: PTServiceStatus, channelUUID: UUID) async throws
> ```
> 
> For information about concurrency and asynchronous code in Swift, see <doc://com.apple.documentation/documentation/Swift/calling-objective-c-apis-asynchronously>.

The default value for the service status is [`PTServiceStatus.ready`](/documentation/PushToTalk/PTServiceStatus/ready). Set the appropriate service status if your network connection experiences an issue. The system reflects your service status in the user interface.

---

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)