---
title: "setServiceStatus(_:channelUUID:completionHandler:)"
framework: pushtotalk
role: symbol
role_heading: Instance Method
path: "pushtotalk/ptchannelmanager/setservicestatus(_:channeluuid:completionhandler:)"
---

# setServiceStatus(_:channelUUID:completionHandler:)

Sets the service connection status.

## Declaration

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

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

## Parameters

- `status`: The service status.
- `channelUUID`: The channel identifier.
- `completionHandler`: The completion handler.

## Discussion

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: func setServiceStatus(_ status: PTServiceStatus, channelUUID: UUID) async throws For information about concurrency and asynchronous code in Swift, see Calling Objective-C APIs Asynchronously. The default value for the service status is PTServiceStatus.ready. Set the appropriate service status if your network connection experiences an issue. The system reflects your service status in the user interface.
