SensorKit - Questions about the startRecording() and data holding period

From the document https://developer.apple.com/documentation/sensorkit/srfetchrequest we know that "SensorKit places a 24-hour holding period on newly recorded data before an app can access it. This gives the user an opportunity to delete any data they don’t want to share with the app. A fetch request doesn’t return any results if its time range overlaps this holding period."

  1. Will this holding period reset each time when I called startRecording() ?

  2. Let's say I upgrade my app to a new version, do I need to call startRecording again to init the data collection process? will it be able to query the data collected from previous version's app ?

The hold period starts when an app has requested authorization for the first time.

If the request time range starts earlier than that, the fetch will silently fail.

The hold period will reset if the app is removed. Calling startRecording() or updating the app in place will not reset it.

If your development workflow includes deleting the app from the device and reinstaling (as opposed to just installing a new version over the old one), this will reset the authorization. If your intention is to reset the data, then delete the app first before installing the new version. Otherwise the new version will be able to access the data collected during the previous version (as long as the same sensors have been activated)

  1. If the user toggled the permission (turned off and turned on again) in Settings "Privacy & Security -> Research Sensor & Usage Data -> Optical Sensor -> apps and studies with access", will the holding period get reset ?

  2. The 24 hours holding period is counting from the calendar day 24:00 or the time startRecording() got called ?

  3. I tried the following step but got a empty export, any ideas why ?

  • Delete the app
  • Install the app from Xcode with dev profile
  • Called startRecording() and wait 24 hours exactly
  • During the 24 hours, I wore my watch for around 12 hours, and update the app in place(without change the Xcode build number) for couple times.
  • Export from system settings "Optical Sensor -> Export All Current Collected Data"
SensorKit - Questions about the startRecording() and data holding period
 
 
Q