---
title: "add(_:metadata:)"
framework: groupactivities
role: symbol
role_heading: Instance Method
path: "groupactivities/groupsessionjournal/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.

## Declaration

```swift
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

Return Value An attachment object you can remove by passing it to the remove(attachment:) function.

## Discussion

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.

## See Also

### Uploading content to the session

- [add(_:)](groupactivities/groupsessionjournal/add(_:).md)
