---
title: "send(_:to:)"
framework: groupactivities
role: symbol
role_heading: Instance Method
path: "groupactivities/groupsessionmessenger/send(_:to:)-2a4ku"
---

# send(_:to:)

Sends a custom type asynchronously to other participants in the group session.

## Declaration

```swift
final func send<Message>(_ value: Message, to participants: Participants = .all) async throws where Message : Decodable, Message : Encodable
```

## Parameters

- `participants`: The recipients of the message. The default value of this parameter is the set of all active participants in the session. Use the doc://com.apple.GroupActivities/documentation/GroupActivities/Participants/only(_:)-swift.enum.case option to specify a subset of participants.

## Discussion

Discussion Use this method to send data that you package into a custom class or structure. The method encodes your custom structure’s type information, and delivers the data only to message sequences of the same type.

## See Also

### Sending data to the group

- [send(_:to:)](groupactivities/groupsessionmessenger/send(_:to:)-4o52m.md)
- [send(_:to:completion:)](groupactivities/groupsessionmessenger/send(_:to:completion:)-zufl.md)
- [send(_:to:completion:)](groupactivities/groupsessionmessenger/send(_:to:completion:)-9e0sn.md)
- [Participants](groupactivities/participants.md)
