A G
A G

Reputation: 41

CMMotionActivityManager - authorizationStatus "refresh"

I am checking the authorizationStatus() of CMMotionActivityManager when "Fitness Tracking" status is disabled in phone's Settings > Privacy > Motion & Fitness. I get a correct status of "restricted" for system wide restrictions.

When I enable the "Fitness Tracking", and bring my app back to foreground from background, the authorizationStatus() still returns "restricted". If I swipe-out/terminate the application and relaunch, it then changes the authorization status.

Is there a way to refresh the authorizationStatus() when bringing the app from background to foreground.

Thanks!

Upvotes: 3

Views: 964

Answers (1)

Jason Silver
Jason Silver

Reputation: 756

I came across the same issue and this behavior happens only before the user grants permission for motion data to your app. Once your app has given permission the first time THEN if the motion permission is toggled on device level, iOS will terminate your app (but if and only if your app has given permission at some point). So once you give permission your app will appear in the motion permission list (see image below) and if so then iOS will terminate when the switch is toggled.

enter image description here

Upvotes: 0

Related Questions