There are plenty of resources that allow to use CoreMotion, and in particular CMHeadphoneMotionManager on iOS, which is not the case on MacOS.
I have read here https://de