experience
TypeScriptget experience(): (GroupActivityMetadata_Experience) | nullSwift declarationvar experience: GroupActivityMetadata.Experience? { get set }struct · iOS 15.0+ · SDK 27.1
struct GroupActivityMetadataText 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.
get experience(): (GroupActivityMetadata_Experience) | nullSwift declarationvar experience: GroupActivityMetadata.Experience? { get set }set experience(value: (GroupActivityMetadata_Experience) | null)Swift declarationvar experience: GroupActivityMetadata.Experience? { get set }get fallbackURL(): (string) | nullSwift declarationvar 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 fallbackURL(value: (string) | null)Swift declarationvar 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 previewImage(): (_CoreGraphics_CGImage) | nullSwift declarationvar 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 previewImage(value: (_CoreGraphics_CGImage) | null)Swift declarationvar 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 lifetimePolicy(): GroupActivityMetadata_LifetimePolicySwift declarationvar lifetimePolicy: GroupActivityMetadata.LifetimePolicyDetermines 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 lifetimePolicy(value: GroupActivityMetadata_LifetimePolicy)Swift declarationvar lifetimePolicy: GroupActivityMetadata.LifetimePolicyDetermines 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 localizedTitle(): (string) | nullSwift declarationvar localizedTitle: String? { get set }set localizedTitle(value: (string) | null)Swift declarationvar localizedTitle: String? { get set }get localizedSubtitle(): (string) | nullSwift declarationvar localizedSubtitle: String? { get set }set localizedSubtitle(value: (string) | null)Swift declarationvar localizedSubtitle: String? { get set }get sceneAssociationBehavior(): SceneAssociationBehaviorSwift declarationvar sceneAssociationBehavior: SceneAssociationBehaviorCriteria 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 sceneAssociationBehavior(value: SceneAssociationBehavior)Swift declarationvar sceneAssociationBehavior: SceneAssociationBehaviorCriteria 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 supportsContinuationOnTV(): booleanSwift declarationvar supportsContinuationOnTV: BoolA 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 supportsContinuationOnTV(value: boolean)Swift declarationvar supportsContinuationOnTV: BoolA 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 preferredBroadcastOptions(): BroadcastOptionsSwift declarationvar preferredBroadcastOptions: BroadcastOptionsPreferences 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 preferredBroadcastOptions(value: BroadcastOptions)Swift declarationvar preferredBroadcastOptions: BroadcastOptionsPreferences 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 type(): GroupActivityMetadata_ActivityTypeSwift declarationvar type: GroupActivityMetadata.ActivityTypeThe type of shared experience.
set type(value: GroupActivityMetadata_ActivityType)Swift declarationvar type: GroupActivityMetadata.ActivityTypeThe type of shared experience.
get title(): (string) | nullSwift declarationvar 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 title(value: (string) | null)Swift declarationvar 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 subtitle(): (string) | nullSwift declarationvar 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 subtitle(value: (string) | null)Swift declarationvar 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.
static init(): GroupActivityMetadataSwift declarationinit()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.
No declarations were skipped in this snapshot.