Game Center breaks RealityView world tracking

Has anyone come across the issue that setting GKLocalPlayer.local.authenticateHandler breaks a RealityView's world tracking on iOS / iPadOS 18 beta 5?

I'm in the process of upgrading my app to make use of the much appreciated RealityView unification, using RealityView not only on visionOS but now also on iOS and iPadOS. In my RealityView, I enable world tracking on iOS like this:

content.camera = .worldTracking

However, device position and orientation were ignored (the camera remained static) and there was no camera pass-through. Then I discovered that the issue disappeared when I remove the line

GKLocalPlayer.local.authenticateHandler = { viewController, error in
    // ... some more code ...
}

So I filed FB14731139 and hope that it will be resolved before the release of iOS / iPadOS 18.

Still occurs with iOS and iPadOS 18.0 beta 7, Xcode 16 beta 6 😓

In beta 7, worldTracking has been renamed to spatialTracking, so the code is now: content.camera = .spatialTracking

I found that the issue is not limited to RealityView, it also occurs with ARView. I discovered this when I wrote an ARView wrapper as a possible workaround, but spatial tracking and camera feed of an ARView are also broken if GKLocalPlayer.local.authenticateHandler has been set:

struct RealityARView: UIViewRepresentable {
	var setupARContent: (RealityARView) -> Void
	private var anchor: AnchorEntity
	private var sessionConfig = ARWorldTrackingConfiguration()
	
	init(setupARContent: @escaping (RealityARView) -> Void) {
		self.setupARContent = setupARContent
		self.anchor = AnchorEntity(world: [0, 0, 0])
	}
	
	func makeUIView(context: Context) -> ARView {
		let arView = ARView(frame: .zero)
		arView.scene.addAnchor(anchor)
		arView.cameraMode = .ar
		arView.environment.background = .cameraFeed()
		sessionConfig.planeDetection = []
		arView.session.run(sessionConfig)
		setupARContent(self) // Call the content setup closure
		return arView
	}
	
	func updateUIView(_ uiView: ARView, context: Context) {
	}
	
	static func dismantleUIView(_ uiView: ARView, coordinator: ()) {
		uiView.session.pause()
	}
	
	public func add(_ entity: Entity) {
		anchor.addChild(entity)
	}
}

struct ImmersiveARView: View {
	var body: some View {
		RealityARView { content in
			var material = SimpleMaterial()
			material.color = .init(tint: .blue)
			
			let sphereMesh = MeshResource.generateSphere(radius: 0.1)
			let entity = ModelEntity()
			entity.components.set(ModelComponent(mesh: sphereMesh, materials: [material]))
			entity.position = [0.0, 0.0, -1.0]
			content.add(entity)
		}
	}
}
Game Center breaks RealityView world tracking
 
 
Q