-startDeviceMotionUpdatesUsingReferenceFrame:toQueue:withHandler: silently fails

Originator:futuretap
Number:rdar://27369088 Date Originated:15-Jul-2016 11:36 AM
Status:Open Resolved:
Product:watchOS SDK Product Version:3.0b2
Classification:Other Bug Reproducible:Always
 
Sending -[CMMotionManager -startDeviceMotionUpdatesUsingReferenceFrame:toQueue:withHandler:] with any reference frame other than CMAttitudeReferenceFrameXArbitraryZVertical silently fails without returning an error to the completion handler.

I understand that the watch doesn't support other reference frames due to the lacking magnetometer but it should at least fail with an error (e.g. CMErrorNotAvailable) when the reference frame is not supported. 

Also it would be nice to indicate the supported reference frames in the documentation.

Comments

My response

Thanks, your tip using +availableAttitudeReferenceFrames was helpful!

I still think it would be appropriate to send an error to the callback handler. Would be easy to do and better than failing silently imo.

Apple Response

You should check available reference frames by using - [CMMotionManager availableAttitudeReferenceFrames:].

Documentation: https://developer.apple.com/library/watchos/documentation/CoreMotion/Reference/CMMotionManager_Class/index.html#//apple_ref/occ/clm/CMMotionManager/availableAttitudeReferenceFrames

You can use the result of this availability check to decide whether or not you can use the reference frame on the hardware type you are interested in.


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!