Share ARWorldMap to multiple devices by storing on Backend server.

I want to map certain spots and store the mapping on backend server so that whenever other devices are on that spot location, the users can localize that spot and AR content is displayed accordingly. I extracted the ARWorldMap and store the archived data in a file and upload it on a server. I then downloaded the file on another device and unarchived the data to ARWorldMap and retrieved the object successfully. But when I assign this map to initialWorldMap of ARSessionConfiguration, the World tracking fails to initialize.

Can someone guide me if I'm doing anything wrong or what's the best way to achieve my requirements/use case.

Following this. Does anyone have any answer to this

By "world tracking fails to initialize", do you mean that the session is failing altogether with the session(_:didFailWithError:) callback? This would likely be an indicator that you are trying to load an invalid world map. Look out for errors during archiving and unarchiving the world map from a file, and make sure that the device on which you load the ARWorldMap is running the same iOS version as the one that saved the map.

Or do you mean that ARKit fails to relocalize to the map, i.e. the tracking state remains in .limited state with reason .relocalizing? This may happen if ARKit cannot match up the feature points in the map with those found in the real world. Potential reasons include:

  • The map was recorded at a different time of day or under different lighting conditions.
  • The environment has changed compared to when the map was recorded.
  • The map is not exhaustive or thorough enough (check the worldMappingStatus to be .mapped before saving the world map)
Share ARWorldMap to multiple devices by storing on Backend server.
 
 
Q