Friday, July 8, 2016

How to be notified when the user deny fitness data?

Leave a Comment

I can check if the user authorized fitness data using -[CMMotionActivityManager queryActivityStartingFromDate:toDate:toQueue:withHandler:] and check for an error (CMErrorNotAuthorized or CMErrorMotionActivityNotAuthorized) in the handler.

If the user go to Privacy settings and deny my app, the app is killed and when I relaunch it, everything works fine.

If the user go to Privacy settings and deny fitness data globally, the app is not killed and the check using the method above does not report any error !

I have to target iOS 8 so I can't use +[CMSensorRecorder isAuthorizedForRecording].

Have you any reliable way of solving this problem ? It is quite annoying to have a nice API for location authorization but not for this one!

1 Answers

Answers 1

Accordingly to Apple's docs, + (BOOL)isAuthorizedForRecording is only available on in iOS 9.0 and later, so you can not use it on iOS8.

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment