Generated from iOS SDK 27.1. Availability is shown on each declaration; permissions and entitlements still apply.
Functions and constants
method · iOS 15.0+makeAsyncIterator
TypeScriptmakeAsyncIterator(): GroupSessionMessenger_Messages_Iterator<number>
Swift declarationfunc makeAsyncIterator() -> GroupSessionMessenger.Messages<Message>.Iterator
Creates the asynchronous iterator that produces elements of this
asynchronous sequence.
- Returns: An instance of the `AsyncIterator` type used to produce
elements of the asynchronous sequence.
method · iOS 15.0+next
TypeScriptnext(): Promise<([number, GroupSessionMessenger_MessageContext]) | null>
Swift declarationmutating func next() async -> GroupSessionMessenger.Messages<Message>.Element?
Asynchronously advances to the next element and returns it, or ends the
sequence if there is no next element.
- Returns: The next element, if it exists, or `nil` to signal the end of
the sequence.
get · iOS 17.0+sceneSessionIdentifier
TypeScriptget sceneSessionIdentifier(): (string) | null
Swift declarationfinal var sceneSessionIdentifier: String? { get }
The persistent identifier of the session's associated scene.
Use this property to determine which of your app's scenes belongs
with this session. You can configure a ``GroupActivity`` object
with a ``SceneAssociationBehavior`` type that tells the system
how to associate the activity with one of your app's scenes.
After matching the activity to a specific scene, the system places
the scene identifier in this property.
method · iOS 15.0+showNotice
TypeScriptshowNotice(event: GroupSessionEvent): void
Swift declarationfinal func showNotice(_ event: GroupSessionEvent)
Posts an event to the system, which displays the information in
the system UI.
Call this method to update the system's UI with information
about session-related events. For example, a music-listening app
might post an event to notify the group that a participant stopped
playback. The system displays the event information
only on the current device, and doesn't forward events to other devices.
- Parameters:
- event: The event to display in the system UI.
getdescription
TypeScriptget description(): string
Swift declarationfinal var description: String { get }
A textual representation of this instance.
Calling this property directly is discouraged. Instead, convert an
instance of any type to a string by using the `String(describing:)`
initializer. This initializer works with any type, and uses the custom
`description` property for types that conform to
`CustomStringConvertible`:
struct Point: CustomStringConvertible {
let x: Int, y: Int
var description: String {
return "(\(x), \(y))"
}
}
let p = Point(x: 21, y: 30)
let s = String(describing: p)
print(s)
// Prints "(21, 30)"
The conversion of `p` to a string in the assignment to `s` uses the
`Point` type's `description` property.
get · iOS 15.0+localParticipant
TypeScriptget localParticipant(): Participant
Swift declarationfinal var localParticipant: Participant { get }
The participant on the current device.
Use this property to differentiate the participant on the current device from
participants on other devices.
get · iOS 15.0+activeParticipants
TypeScriptget activeParticipants(): Array<Participant>
Swift declaration@Published<Set<Participant>> final var activeParticipants: Set<Participant> { get }
The set of participants currently engaged in the activity.
This property reflects the set of people invited to a group session and currently
engaged in the shared activity on their device. Members who join the conversation
over FaceTime but don't join the shared activity aren't active participants.
As people join or leave the activity, the session object updates the set of active
participants. To detect changes to this property, configure a subscriber.
Each ``Participant`` object corresponds to a joined session on a device. If a single
person joins the activity from two devices simultaneously, the set contains a
separate ``Participant`` object for each device.
get · iOS 18.0+isLocallyInitiated
TypeScriptget isLocallyInitiated(): boolean
Swift declarationfinal let isLocallyInitiated: Bool
A Boolean value that is true if the current session was created by the local participant.
get · iOS 15.0+$activeParticipants
TypeScriptget $activeParticipants(): _Combine_Published_Publisher<Array<Participant>>
Swift declarationfinal var $activeParticipants: Published<Set<Participant>>.Publisher { get }
method · iOS 15.0+requestForegroundPresentation
TypeScriptrequestForegroundPresentation(): void
Swift declarationfinal func requestForegroundPresentation()
Tells the system that your app needs to be in the foreground to continue an activity.
Call this method if your app is in the background and can't start the activity
without the participant's assistance. For example, you might call the
method if your app requires the participant's credentials to play back a
shared media file. Don't call this method if you're able to start the activity
without assistance. When you call this method, the system asks the participant
to continue the activity in your app.
To create a smoother user experience, the system might launch your app in
the background when starting an activity. Apps can start activities in
either the foreground or background, but you might configure your app
differently when in the background. For example, when in the background,
you play media files in a picture-in-picture window instead of a fullscreen
interface. This method lets you notify the user when a background solution
isn't possible.
The session must be in the ``State-swift.enum/waiting`` or ``State-swift.enum/joined``
state when you call this method. If it isn't, this method does nothing.
get · iOS 15.0+id
TypeScriptget id(): string
Swift declarationfinal let id: UUID
The unique identifier of the current session.
The system assigns a globally unique identifier to each session.
This identifier is valid only for the lifetime of the session object.
method · iOS 15.0+end
TypeScriptend(): void
Swift declarationfinal func end()
Ends the activity for the entire group and stops the transfer
of synchronized data.
Call this method to end the activity for all participants.
When you call this method, the session transitions to the ``State-swift.enum/invalidated(reason:)``
state and stops the delivery of session-related updates. After ending
the session, you can't join it again.
Don't call this method on a session already in the ``State-swift.enum/invalidated(reason:)`` state.
method · iOS 15.0+join
TypeScriptjoin(): void
Swift declarationfinal func join()
Starts the shared activity on the current device.
Call this method to begin the delivery of synchronized data
to the current device. Typically, you call this method when your app
is ready to engage in an activity. For example, call it
when you present your app’s UI for the activity. When your app
successfully joins the session, the session changes the value in its
``state-swift.property`` property to ``State-swift.enum/joined``.
get · iOS 15.0+originator
TypeScriptget originator(): Participant
Swift declarationlet originator: Participant
The participant that initiated the event.
get · iOS 15.0+ · Deprecated in iOS 15.0localizedDescription
TypeScriptget localizedDescription(): string
Swift declarationvar localizedDescription: String { get }
A localized description of the event
method · iOS 15.0+leave
TypeScriptleave(): void
Swift declarationfinal func leave()
Leaves the current activity and stops receiving synchronized data.
When you call this method, the session transitions to the ``State-swift.enum/invalidated(reason:)``
state and stops the delivery of session-related updates. Call this method
when the user dismisses your app’s activity-related UI.
Don't call this method on a session already in the ``State-swift.enum/invalidated(reason:)`` state.
get · iOS 15.0+state
TypeScriptget state(): GroupSession_State<SDKHandle>
Swift declaration@Published<GroupSession<ActivityType>.State> final var state: GroupSession<ActivityType>.State { get }
The current state of the session.
Use this property to get the current state value, or configure a subscriber
to detect changes to the value. To change the state of a session, call
the ``join()`` and ``leave()`` methods.
If a failure occurs or the session ends, the session object transitions to the
``State-swift.enum/invalidated(reason:)``state. If the session ends because of
an error, it provides information about that error.
get · iOS 15.0+$state
TypeScriptget $state(): _Combine_Published_Publisher<GroupSession_State<SDKHandle>>
Swift declarationfinal var $state: Published<GroupSession<ActivityType>.State>.Publisher { get }
method · iOS 15.0+makeAsyncIterator
TypeScriptmakeAsyncIterator(): GroupSession_Sessions_Iterator<SDKHandle>
Swift declarationfunc makeAsyncIterator() -> GroupSession<ActivityType>.Sessions.Iterator
Creates the asynchronous iterator that produces elements of this
asynchronous sequence.
- Returns: An instance of the `AsyncIterator` type used to produce
elements of the asynchronous sequence.
method · iOS 15.0+next
TypeScriptnext(): Promise<(GroupSession<SDKHandle>) | null>
Swift declarationmutating func next() async -> GroupSession<ActivityType>?
Asynchronously advances to the next element and returns it, or ends the
sequence if there is no next element.
- Returns: The next element, if it exists, or `nil` to signal the end of
the sequence.
get · iOS 15.0+$activity
TypeScriptget $activity(): _Combine_Published_Publisher<SDKHandle>
Swift declarationfinal var $activity: Published<ActivityType>.Publisher { get set }
set · iOS 15.0+$activity
TypeScriptset $activity(value: _Combine_Published_Publisher<SDKHandle>)
Swift declarationfinal var $activity: Published<ActivityType>.Publisher { get set }
method · iOS 15.0+postEvent
TypeScriptpostEvent(event: GroupSession_Event<SDKHandle>): void
Swift declarationfinal func postEvent(_ event: GroupSession<ActivityType>.Event)
Posts an event to the system, which displays the information in
the system UI.
Call this method to update the system's UI with information
about session-related events. For example, a music-listening app
might post an event to notify the group that a participant added
a song to a shared playlist. The system displays the event information
only on the current device. It doesn't forward events to other devices.
- Parameters:
- event: The event to display in the system UI.