One Logo Pool Ball
GroupActivities · IOS API REFERENCE

GroupActivityMetadata

struct · iOS 15.0+ · SDK 27.1

struct GroupActivityMetadata

Text and image content that describes an activity to potential participants. Use a `GroupActivityMetadata` structure to store user-facing information about a specific activity your app suggests. Metadata information includes the title of the activity, an image that corresponds to the activity, and a fallback URL for users who don't have your app. For example, a movie-watching activity might include the poster of the specific movie a participant suggests. The system uses the provided metadata to generate invitations for other participants. Create a `GroupActivityMetadata` structure in the ``GroupActivity/metadata`` property of your custom ``GroupActivity`` subclass. Populate the new structure with the relevant data for your activity.

Members (25)

get · iOS 15.0+

experience

TypeScript
get experience(): (GroupActivityMetadata_Experience) | null
Swift declaration
var experience: GroupActivityMetadata.Experience? { get set }
set · iOS 15.0+

experience

TypeScript
set experience(value: (GroupActivityMetadata_Experience) | null)
Swift declaration
var experience: GroupActivityMetadata.Experience? { get set }
get · iOS 15.0+

fallbackURL

TypeScript
get fallbackURL(): (string) | null
Swift declaration
var fallbackURL: URL?

A URL that offers participants a way to identify or join the activity from a web browser. Use this property to provide fallback behavior for users who don't have your app installed on their device. For example, if your app runs only on iOS, use this property to supply activity-related information for users on a Mac. When your app isn't available, the system opens the specified URL in Safari. > Important: Make sure that the URL in this property eventually leads to a webpage with the same content as the activity. Safari automatically synchronizes media playback for listen-together and watch-together experiences.

set · iOS 15.0+

fallbackURL

TypeScript
set fallbackURL(value: (string) | null)
Swift declaration
var fallbackURL: URL?

A URL that offers participants a way to identify or join the activity from a web browser. Use this property to provide fallback behavior for users who don't have your app installed on their device. For example, if your app runs only on iOS, use this property to supply activity-related information for users on a Mac. When your app isn't available, the system opens the specified URL in Safari. > Important: Make sure that the URL in this property eventually leads to a webpage with the same content as the activity. Safari automatically synchronizes media playback for listen-together and watch-together experiences.

get · iOS 15.0+

previewImage

TypeScript
get previewImage(): (_CoreGraphics_CGImage) | null
Swift declaration
var previewImage: CGImage?

The image to display for the current activity. Use this property to specify an image for the activity. For example, you might display a movie poster for a movie-watching activity. The system scales the image as needed and displays it with the rest of the activity information.

set · iOS 15.0+

previewImage

TypeScript
set previewImage(value: (_CoreGraphics_CGImage) | null)
Swift declaration
var previewImage: CGImage?

The image to display for the current activity. Use this property to specify an image for the activity. For example, you might display a movie poster for a movie-watching activity. The system scales the image as needed and displays it with the rest of the activity information.

get · iOS 18.0+

lifetimePolicy

TypeScript
get lifetimePolicy(): GroupActivityMetadata_LifetimePolicy
Swift declaration
var lifetimePolicy: GroupActivityMetadata.LifetimePolicy

Determines how an activity can be ended. Most activities can be left or ended independently by any participant. For example, a game being played together or a TV show being watched together doesn't depend on a particular participant to be able to continue for everyone else. Some activities, though, might depend on the initiator's presence in the activity for it to continue. For example, the initiator might be sharing a photo that belongs to them, or a file from their device. Setting ``lifetimePolicy`` to ``LifetimePolicy/endsWhenInitiatorLeaves`` in these cases would ensure that the activity ends when the initiator leaves.

set · iOS 18.0+

lifetimePolicy

TypeScript
set lifetimePolicy(value: GroupActivityMetadata_LifetimePolicy)
Swift declaration
var lifetimePolicy: GroupActivityMetadata.LifetimePolicy

Determines how an activity can be ended. Most activities can be left or ended independently by any participant. For example, a game being played together or a TV show being watched together doesn't depend on a particular participant to be able to continue for everyone else. Some activities, though, might depend on the initiator's presence in the activity for it to continue. For example, the initiator might be sharing a photo that belongs to them, or a file from their device. Setting ``lifetimePolicy`` to ``LifetimePolicy/endsWhenInitiatorLeaves`` in these cases would ensure that the activity ends when the initiator leaves.

get · iOS 15.0+

localizedTitle

TypeScript
get localizedTitle(): (string) | null
Swift declaration
var localizedTitle: String? { get set }
set · iOS 15.0+

localizedTitle

TypeScript
set localizedTitle(value: (string) | null)
Swift declaration
var localizedTitle: String? { get set }
get · iOS 15.0+

localizedSubtitle

TypeScript
get localizedSubtitle(): (string) | null
Swift declaration
var localizedSubtitle: String? { get set }
set · iOS 15.0+

localizedSubtitle

TypeScript
set localizedSubtitle(value: (string) | null)
Swift declaration
var localizedSubtitle: String? { get set }
get · iOS 17.0+

sceneAssociationBehavior

TypeScript
get sceneAssociationBehavior(): SceneAssociationBehavior
Swift declaration
var sceneAssociationBehavior: SceneAssociationBehavior

Criteria the system uses to direct an activity to a specific scene of your app. An app with multiple <doc://com.apple.documentation/documentation/swiftui/scene> types typically uses each scene for a different purpose. For example, you might use one scene type for your app’s documents, and a different scene type for tool palettes, information windows, and other content. When a group activity starts, the system uses the information in this property to deliver the activity to the appropriate scene. On some platforms, the system also adds a custom indicator to the scene to let people know that SharePlay is active. Assign a value to this property to specify the scene-selection behavior for your app. If you don’t specify a value for this property, the system adopts the ``SceneAssociationBehavior/default`` scene association behavior.

set · iOS 17.0+

sceneAssociationBehavior

TypeScript
set sceneAssociationBehavior(value: SceneAssociationBehavior)
Swift declaration
var sceneAssociationBehavior: SceneAssociationBehavior

Criteria the system uses to direct an activity to a specific scene of your app. An app with multiple <doc://com.apple.documentation/documentation/swiftui/scene> types typically uses each scene for a different purpose. For example, you might use one scene type for your app’s documents, and a different scene type for tool palettes, information windows, and other content. When a group activity starts, the system uses the information in this property to deliver the activity to the appropriate scene. On some platforms, the system also adds a custom indicator to the scene to let people know that SharePlay is active. Assign a value to this property to specify the scene-selection behavior for your app. If you don’t specify a value for this property, the system adopts the ``SceneAssociationBehavior/default`` scene association behavior.

get · iOS 15.0+

supportsContinuationOnTV

TypeScript
get supportsContinuationOnTV(): boolean
Swift declaration
var supportsContinuationOnTV: Bool

A Boolean value that indicates whether your app supports activity continuation on an Apple TV. The default value of this property is `false`. Set it to `true` to allow participants to continue the activity on Apple TV.

set · iOS 15.0+

supportsContinuationOnTV

TypeScript
set supportsContinuationOnTV(value: boolean)
Swift declaration
var supportsContinuationOnTV: Bool

A Boolean value that indicates whether your app supports activity continuation on an Apple TV. The default value of this property is `false`. Set it to `true` to allow participants to continue the activity on Apple TV.

get · iOS 15.0+

preferredBroadcastOptions

TypeScript
get preferredBroadcastOptions(): BroadcastOptions
Swift declaration
var preferredBroadcastOptions: BroadcastOptions

Preferences for how to present audio and video on the main communication channel. Use this property to request special handling of the audio and video on the FaceTime call. For example, you might request video mirroring to simplify activities that involve left-right movement. The system respects your preferences when possible, but may override those preferences if system- or user-specific settings are present. The default value of this property is an empty set.

set · iOS 15.0+

preferredBroadcastOptions

TypeScript
set preferredBroadcastOptions(value: BroadcastOptions)
Swift declaration
var preferredBroadcastOptions: BroadcastOptions

Preferences for how to present audio and video on the main communication channel. Use this property to request special handling of the audio and video on the FaceTime call. For example, you might request video mirroring to simplify activities that involve left-right movement. The system respects your preferences when possible, but may override those preferences if system- or user-specific settings are present. The default value of this property is an empty set.

get · iOS 15.0+

type

TypeScript
get type(): GroupActivityMetadata_ActivityType
Swift declaration
var type: GroupActivityMetadata.ActivityType

The type of shared experience.

set · iOS 15.0+

type

TypeScript
set type(value: GroupActivityMetadata_ActivityType)
Swift declaration
var type: GroupActivityMetadata.ActivityType

The type of shared experience.

get · iOS 15.0+

title

TypeScript
get title(): (string) | null
Swift declaration
var title: String?

The localized string to display as the title of your activity. Use this string as the main description of the activity, and localize it for the current device. The system displays this string prominently when it presents the activity to the participant.

set · iOS 15.0+

title

TypeScript
set title(value: (string) | null)
Swift declaration
var title: String?

The localized string to display as the title of your activity. Use this string as the main description of the activity, and localize it for the current device. The system displays this string prominently when it presents the activity to the participant.

get · iOS 15.0+

subtitle

TypeScript
get subtitle(): (string) | null
Swift declaration
var subtitle: String?

The localized string that provides additional information about the activity. Use this string to provide additional descriptive information about the activity. For example, specify the season and episode information for a television-watching activity. Localize the string for the current device. The system displays this string along with the title in the system UI.

set · iOS 15.0+

subtitle

TypeScript
set subtitle(value: (string) | null)
Swift declaration
var subtitle: String?

The localized string that provides additional information about the activity. Use this string to provide additional descriptive information about the activity. For example, specify the season and episode information for a television-watching activity. Localize the string for the current device. The system displays this string along with the title in the system UI.

init · iOS 15.0+

init

TypeScript
static init(): GroupActivityMetadata
Swift declaration
init()

Creates a new instance for storing descriptive information about an activity. After you create a new ``GroupActivityMetadata`` structure, assign values to its properties and deliver it to the system from the ``GroupActivity/metadata`` property of your custom ``GroupActivity`` type.

Skipped declarations

No declarations were skipped in this snapshot.

All GroupActivities types →