Interactivity Issues Between Unity and SwiftUI in polyspatial v1.2.3 Sample-Mesh

Hello, I referred to the Sample-Meshing scene in polyspatial v1.2.3 for the interaction between Unity and SwiftUI, and I found that my application encountered the same issue as Sample-Meshing scene. Due to project privacy concerns, I will use Sample-Meshing scene for instruction.

  1. First, I opened the Sample-Meshing scene. At this stage, SwiftUI and the virtual scene are combined, which works correctly.

  2. Second, when I pressed the digital crown, the virtual scene disappeared, leaving only SwiftUI (actually, I was expecting SwiftUI to disappear or directly move to the effect of the third step).

  3. Third, when I pressed the digital crown again, SwiftUI became semi-transparent, and the icon interface appeared.

  4. Fourth, when I clicked the Sample program again, SwiftUI reappeared, but I couldn’t find any way to make the virtual scene show up again.

These are the phenomena I’ve observed. The effects I hope to achieve are:

  1. When pressing the digital crown, SwiftUI disappears or becomes semi-transparent, and the icon list is displayed in front.
  2. When the application is already running in the background, clicking the application should display the virtual scene.

This is a known issue with the sample. It should be solved in the next release but in the mean time you can find the solution I posted here:

the gist of it is that you need to manage / close the SwiftUI window when the app is backgrounded or closed (what is happening when you click the digital crown).

Hope this helps!

Thanks so much, it is solved using this way!