<!--
{
  "availability" : [
    "iOS: 17.0.0 -",
    "iPadOS: 17.0.0 -",
    "macCatalyst: 17.0.0 -",
    "macOS: 14.0.0 -",
    "tvOS: 17.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "GroupActivities",
  "identifier" : "/documentation/GroupActivities/GroupSessionJournal/add(_:metadata:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Group Activities"
    ],
    "preciseIdentifier" : "s:15GroupActivities0A14SessionJournalC3add_8metadataAC10AttachmentVx_q_tYaK16CoreTransferable0I0RzSeR_SER_r0_lF"
  },
  "title" : "add(_:metadata:)"
}
-->

# add(_:metadata:)

Adds the specified item and metadata to the journal and begins transferring the
data to the other participants’ devices so they can access it.

```
final func add<ItemType, MetadataType>(_ item: ItemType, metadata: MetadataType) async throws -> GroupSessionJournal.Attachment where ItemType : Transferable, MetadataType : Decodable, MetadataType : Encodable
```

## Parameters

`item`

The item to send to other session participants. The type
you specify must conform to the <doc://com.apple.documentation/documentation/CoreTransferable/Transferable>
protocol. For more information about creating transferable types,
see <doc://com.apple.documentation/documentation/CoreTransferable>.

`metadata`

Custom metadata to include with the item. Specify a
<doc://com.apple.documentation/documentation/Swift/Codable> type that contains
information to help your app interpret or process the item on other
devices. For example, you might include app-specific details that aren’t
part of the item’s intrinsic data format.

## Return Value

An attachment object you can remove by passing it to the [`remove(attachment:)`](/documentation/GroupActivities/GroupSessionJournal/remove(attachment:)) function.

## Discussion

Call this method when you want to send a file or codable data type to the
other participants of an activity. The method runs asynchronously and can return
before the upload operation finishes.

---

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)