Does WorldTrackingProvider.addAnchor work in the simulator?

First, I start add the provider to the session:

do {
   if WorldTrackingProvider.isSupported {
      try await session.run([worldTracking])
      print("World Tracking Provider Started.")
   } else {
      print("World Tracking not supported >.>")
    }
} catch {
   print("ARKitSession error:", error)
}

Then I try to add a world anchor:

    var task: Task<Void, Never>?
    func trackAnchor(_ anchor: WorldAnchor) {
        task = Task {
            do {
                try await self.worldTracking.addAnchor(anchor)
                print("Added anchor to tracking provider!")
            } catch {
                print("Error: \(error)")
            }
        }
    }

The awaited call never finishes. A breakpoint is not hit and errors are not thrown.

As such, when the app is quit and restarted, the system does not recover the tracked world anchor.

Any ideas?

Replies

Hi J0hn,

I have the same issue here. Despite I cannot give you a fix to your problems, you known at least that you are not alone ;-)

My guess is that it is related to authorisations that are not very well supported as it is advertised by the docs.

I will post an update if/when I find a way to ke this work