<!--
{
  "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/GroupActivity",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "Group Activities"
    ],
    "preciseIdentifier" : "s:15GroupActivities0A8ActivityP"
  },
  "title" : "GroupActivity"
}
-->

# GroupActivity

A type that can advertise your app’s activities to other participants.

```
protocol GroupActivity : Decodable, Encodable
```

## Overview

Adopt the `GroupActivity` protocol in custom app data structures that represent
your app’s shareable experiences. The protocol provides the system with the context
and metadata to start an activity-related session. For example,
the protocol defines the unique identity of the activity, and returns information
about the activity.

In addition to the protocol’s methods and properties, make sure your type
includes the information you need to start the activity. When a participant
accepts an activity, the system provides a copy of your activity type. You
must use that type to begin the activity. For example, use it to present
the appropriate UI for the activity and to load any required content.

To initiate an activity, create an instance of your custom type and call its
[`prepareForActivation()`](/documentation/GroupActivities/GroupActivity/prepareForActivation()) or [`activate()`](/documentation/GroupActivities/GroupActivity/activate()) method. You might call one of these
methods from a button in your app’s UI, or in response to other user actions.
If activation succeeds, the system advertises the activity on the current
FaceTime call.

When an activity begins, the system creates a [`GroupSession`](/documentation/GroupActivities/GroupSession) instance for the
activity and delivers it asynchronously to your app. Use the [`sessions()`](/documentation/GroupActivities/GroupActivity/sessions())
method to get the session and configure your app’s UI.

> Important: `GroupActivity` types must be <doc://com.apple.documentation/documentation/Swift/Codable>
> so that the system can serialize them and send them to other participant’s devices.

## Topics

### Specifying the activity details

[`activityIdentifier`](/documentation/GroupActivities/GroupActivity/activityIdentifier)

An app-defined string that uniquely identifies the activity.

[`metadata`](/documentation/GroupActivities/GroupActivity/metadata)

A description of the activity, and optional image to display to the user.

### Starting an activity immediately

[`prepareForActivation()`](/documentation/GroupActivities/GroupActivity/prepareForActivation())

Returns the participant’s preferred option for how to start the activity.

[`GroupActivityActivationResult`](/documentation/GroupActivities/GroupActivityActivationResult)

The result of preparing to start a custom activity.

[`activate()`](/documentation/GroupActivities/GroupActivity/activate())

Begins the activity immediately and creates a session for the app when
a FaceTime call is active.

### Receiving an activity-related session

[`sessions()`](/documentation/GroupActivities/GroupActivity/sessions())

Returns the sessions for this activity as an asynchronous sequence.

[`GroupActivity.Sessions`](/documentation/GroupActivities/GroupActivity/Sessions)

A type that provides asynchronous, sequential, iterated access to the
sessions for the activity.

### Transferring data types

[`transferRepresentation`](/documentation/GroupActivities/GroupActivity/transferRepresentation)

A default type that lets the system share your activity.



---

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)