GroupSession
class · iOS 15.0+ · SDK 27.1
final class GroupSession<ActivityType> where ActivityType : GroupActivityA session for an in-progress activity that synchronizes content among participant devices. A `GroupSession` object contains details about the user’s currently selected activity, its status, and its participants. When a participant engages in an activity, the system binds a session to that activity for you. You use the session object to synchronize your app’s activity-related content, including your app's UI. You don’t create `GroupSession` objects directly. Instead, the system creates sessions and makes them available to your app asynchronously. Use the `AsyncSequence` type returned by the ``GroupActivity/sessions()`` method of your activity to retrieve new sessions when they become available. Before the system can create a session object, your app must create a `GroupActivity` object and activate it. For information about how to configure group activities, see ``GroupActivity``. ### Start and Stop the Session When you receive a new session object, it’s initially in the ``State-swift.enum/waiting`` state. As soon as your app is ready to begin the associated activity, call the session’s ``join()`` method. Joining a session validates the connection and starts the synchronization process between the current device and other participants’ devices. If your app successfully joins the session, the session transitions to the ``State-swift.enum/joined`` state. When the user quits your app, or navigates away from the shared activity, call the session’s ``leave()`` method. Leaving a session gracefully transitions it to the ``State-swift.enum/invalidated(reason:)`` state, and informs the system that the user isn’t currently engaged in the activity.
Members (0)
This type has no directly callable members in this snapshot. See the framework’s skipped declarations for unsupported APIs.
Skipped declarations
1 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.
GroupSession.activity
This declaration needs Swift generic type arguments. (no canonical witness for ActivityType)