Issue with accelerometerUpdates() function in CMBatchedSensorManager

I recently updated my iPhone to iOS 17.0 (21A5248v) and my Apple Watch Series 8 to watchOS 10.0 (21R5275t). I'm working with the CMBatchedSensorManager and have confirmed that the authorizationStatus is authorized. Additionally, both isDeviceMotionSupported and isAccelerometerSupported properties return true.

However, when I call the startAccelerometerFetching() function shown below:

@available(watchOS 10.0, *)
func startAccelerometerFetching() async {
    do {
        for try await accelerometerList in batchedSensorManager.accelerometerUpdates() {
            accelerometerList.forEach { self.processAccelerometer($0) }
        }
    } catch let error as NSError {
        print("Encountered Error: \(error.userInfo) \(error.localizedDescription) -> \(error.code) \(error.localizedFailureReason)")
    }
}

I receive the following error message:

"Encountered Error: [:] The operation couldn’t be completed. (CMErrorDomain error 109.) -> 109 nil"

Does error code 109 correspond to CMErrorNotAvailable? How to solve this problem?

Replies

I posted a post with title: "How to use CMBatchedSensorManager" on how to use deviceMotionUpdates(), as there is no reply, so I fire a DTS and the support reply there is so far so solution on that. So I guess the api is remain not workable up to iOS 17 (21A5277j)

I guess you will work on iOS 17.0 (21A5319a) (beta 7) and watchOS 10.0 (21R5349b) (beta 7) as my code becomes no problem on these version. So it is only bug on early beta version.