Sending ARAnchors through synchronizationService

I'm having trouble getting MultipeerConnectivity working properly with RealityKit.


I currently have two devices connected to eachother via a MultipeerConnectivityService. I know they're connected because I can tell one device to send a sample Data chunk and the other device receives it.


I have done this by setting the arView.scene.synchronizationService to the MultipeerConnectivityService


I'm trying to follow the next step of creating an ARAnchor, adding to the the session as well as the scene found inside Building Apps with RealityKit, but after doing this nothing appears on the other device, and I'm watching the session(_:didAdd:) function, ARAnchors are showing to be added when scanning around the room, and when the device which taps to add the ARAnchor the same device shows it being added to the scene. However nothing appears on the other device in this function and nothing visual appears also.


Has anyone got this working for them? Ideally if apple releases the card flip game in the above link we'd have a nice small example of how we can get this to work, but I'm quite stuck for now…

Accepted Reply

Not sure what I was doing wrong here originally (possibly not enabling collaborative session), but I have since created a Swift Package on GitHub to achieve this really easily.

https://github.com/maxxfrazer/MultipeerHelper

Replies

Not sure what I was doing wrong here originally (possibly not enabling collaborative session), but I have since created a Swift Package on GitHub to achieve this really easily.

https://github.com/maxxfrazer/MultipeerHelper