Way to prevent save on pause during start up in iOS?

Include the following details (edit as applicable):

  • Issue category: Understanding ar session start-up
  • Device type & OS version: iOS
  • Issue Environment : On Device
  • Xcode version: 13.4.1
  • ARDK version: 2.0
  • Unity version: 2020.3.4

I have some data to save in my app that should save in iOS in the background when the app is paused (using OnApplicationPause with its bool). This works fine, except that the app pauses a lot during the normal course of start up and it’s not necessary to save the data then and this even causes a slow down in the start up process. I added a bool check called saveOnPause that starts out false and gets toggled to true on the ARSessionFactory.SessionInitialized event. This takes care of most of the unnecessary saves during start up pauses, but still misses one that appears to happen during the ARWorldTrackingTechnique, or maybe in response to the request for camera access. Is there something in the ARSessionFactory or the IARSession that I can access that would signal the end of start up when I can finally cue my app to begin saving on pauses? Thanks!

Hi Natalie, I’m in touch with our engineers on this issue and they’re looking for another solution. Thank you for your patience. I’ll post here as soon as we find something on this

Hi Natalie, our devs weren’t able to see the pausing behavior on startup in their environment but they did offer this as a workaround:

For the camera request, iOS auto surfaces the popup if camera permission has not yet been granted for the app. Unfortunately the IARSession.Ran event will get invoked before the permission dialog has closed, but the dev can listen for the first IARSession.FrameUpdated event to know when the ARSession has properly started running.

Please try listening for the first frameupdate of the session and let us know if that helps prevent the slowdown.