How do I send messages using Shareplay
Asked on 01/25/2025
1 search
To send messages using SharePlay, you can utilize the group session messenger to synchronize state with other participants. This is part of the session controller class, which manages interactions with the current SharePlay group session. The session controller is responsible for tracking and synchronizing all of the app state during a given SharePlay session. It stores the session itself and uses a group session messenger to synchronize state with other participants.
For more detailed information on how to implement this, you can refer to the session titled "Customize spatial Persona templates in SharePlay" from WWDC 2024. You can find relevant details starting at the SharePlay on visionOS chapter.

Customize spatial Persona templates in SharePlay
Learn how to use custom spatial Persona templates in your visionOS SharePlay experience to fine-tune the placement of Personas relative to your app. We’ll show you how to adopt custom spatial Persona templates in a sample app with SharePlay, move participants between seats, and test your changes in Simulator. We’ll also share best practices for designing custom spatial templates that will make your experience shine.

Enhance the immersion of media viewing in custom environments
Extend your media viewing experience using Reality Composer Pro components like Docking Region, Reverb, and Virtual Environment Probe. Find out how to further enhance immersion using Reflections, Tint Surroundings Effect, SharePlay, and the Immersive Environment Picker.

Meet TabletopKit for visionOS
Build a board game for visionOS from scratch using TabletopKit. We’ll show you how to set up your game, add powerful rendering using RealityKit, and enable multiplayer using spatial Personas in FaceTime with only a few extra lines of code.