Hi,
I am implementing tracking posture of head using CMHeadphoneMotionManager. I am getting gyro data in foreground mode but when app move to Foreground then gyro data stop working.
Can anyone suggest me how to achieve gyro data in background.
Hi,
I am implementing tracking posture of head using CMHeadphoneMotionManager. I am getting gyro data in foreground mode but when app move to Foreground then gyro data stop working.
Can anyone suggest me how to achieve gyro data in background.
To continue receiving gyro data when your iOS app moves to the background, you need to enable background mode for your app. This can be done in the project's "Capabilities" section in Xcode.
In particular, you will need to enable the "Motion & Fitness" background mode to receive gyro data while your app is in the background. Additionally, you should also handle background tasks properly, such as starting and ending background tasks with the appropriate methods, and using appropriate background modes for your tasks, such as "background processing" or "background fetch".
Is this helpful? Cheers