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

# setAccessoryButtonEventsEnabled(_:channelUUID:completionHandler:)

Maps supported accessory button events to actions that begin and end transmission.

## Declaration

```swift
func setAccessoryButtonEventsEnabled(_ enabled: Bool, channelUUID: UUID, completionHandler: (@Sendable ((any Error)?) -> Void)? = nil)
```

```swift
func setAccessoryButtonEventsEnabled(_ enabled: Bool, channelUUID: UUID) async throws
```

## Parameters

- `enabled`: A flag that accessory button events map to begin and end transmission actions. If your app doesn’t map these button events to transmission actions, you can disable them by setting the value to doc://com.apple.documentation/documentation/Swift/false.
- `channelUUID`: The unique channel identifier of the active participant.
- `completionHandler`: An error that indicates the reason why the system couldn’t set the supported accessory button events.

## 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 setAccessoryButtonEventsEnabled(_ enabled: Bool, channelUUID: UUID) async throws For information about concurrency and asynchronous code in Swift, see Calling Objective-C APIs Asynchronously.

## See Also

### Starting and stopping transmission

- [requestBeginTransmitting(channelUUID:)](pushtotalk/ptchannelmanager/requestbegintransmitting(channeluuid:).md)
- [stopTransmitting(channelUUID:)](pushtotalk/ptchannelmanager/stoptransmitting(channeluuid:).md)
