I have 3 immersive spaces, and I'm trying to "jump" between them. Whenever I go from a space to the next one I try to dismiss the current one by executing await dismissImmersiveSpace()
and right after await openImmersiveSpace(value: id)
. This is being performed inside of a Task,
run on the click of a button.
It seems like dismissImmersiveSpace
is released before the actual space has been completely removed, as the next immersive space does not open.
On the other hand, I added a manual waiting time between dismissing an immersive space and showing the next one, and everything seems to be working fine, which is why I suspect that this is a lifecycle issue of the dismissImmersiveSpace.
That being said, is there any way to listen to the actual state of the dismissed immersive space, so that I know when I can present the next one?
Is there any way around this without having to introduce a manual delay?