michaelthedeveloper
michaelthedeveloper

Reputation: 237

How can I check whether or not Motion & Fitness is enabled on an iOS device?

I know how to check whether or not Motion & Fitness is available on the user's device using CMMotionActivityManager.isActivityAvailable(), and I know how to check whether or not Motion & Fitness permission has been granted to the app using CMMotionActivityManager.authorizationStatus() == .authorized, but I need to be able to check whether or not the user has Motion & Fitness enabled on their device via their Settings -> Privacy -> Motion & Fitness. Is this possible?

Upvotes: 1

Views: 1724

Answers (1)

andykent
andykent

Reputation: 184

You want CMMotionActivityManager.authorizationStatus() == .restricted although the Apple docs could be clearer around this.

Additionally from my testing the authorizationStatus stays restricted until the App is re-launched which confuses things further. You will need to inform users to re-launch the App after toggling the setting.

Upvotes: 1

Related Questions