<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "tvOS: 15.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "GroupActivities",
  "identifier" : "/documentation/GroupActivities/GroupSessionMessenger/send(_:to:completion:)-9e0sn",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Group Activities",
      "GroupActivities"
    ],
    "preciseIdentifier" : "s:15GroupActivities0A16SessionMessengerC4send_2to10completionyx_AA12ParticipantsOys5Error_pSgctSeRzSERzlF"
  },
  "title" : "send(_:to:completion:)"
}
-->

# send(_:to:completion:)

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

```
final func send<Message>(_ value: Message, to participants: Participants = .all, completion: @escaping ((any Error)?) -> Void) 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
[`Participants.only(_:)`](/documentation/GroupActivities/Participants/only(_:)-swift.enum.case) option to specify a subset of participants.

`completion`

The handler block to call with the results of the delivery
attempt. The handler has no return value and takes a single
<doc://com.apple.documentation/documentation/Swift/Error> parameter.
The value of this parameter is `nil` if delivery succeeds; otherwise,
it contains an appropriate error object.

## 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.

---

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)