When is NSMotionUsageDescription shown?

I'm using CMMotionManager startDeviceMotionUpdatesUsingReferenceFrame: CMAttitudeReferenceFrameXTrueNorthZVertical and have set the NSMotionUsageDescription ("Privacy - Motion Usage Description") property in the info.plist. But I don't see a permissions popup.

I also don't see any mention of this in the app's section of the Settings app.

When is this usage description string used?

I wonder if there is some connection between the motion permission and the location permission, which I also use?

Answered by DTS Engineer in 802409022

I did notice that the text you've quoted doesn't include CMMotionManager, but I think I assumed that CMMotionManager was "obviously" included in "APIs that access the device's motion data", and that the docs were mentioning only the other less-obvious ones.

Sigh... actually I'm afraid that was a very busy day and I was jumping back and forth between to many things while writing your reply. In the message above I wrote:

Neither of those are really an issue with CMMotionActivityManager, which is primarily used for things like in app motion controls and which only really works in the foreground.

But that SHOULD have said:

Neither of those are really an issue with CMMotionManager, which is primarily used for things like in app motion controls and which only really works in the foreground.

In other words, CMMotionManager is the specific API I was describing there.

So - if I'm using CMMotionManager, and not any of the other listed APIs, do I need to include the usage description string to get approved? I've just had an update approved with the string present so including it unnecessarily doesn't seem to be an issue.

Yes, that's correct. I don't see any issue with including the string, but CMMotionManager does not currently require any privacy authorization.

__
Kevin Elliott
DTS Engineer, CoreOS/Hardware

I'm using CMMotionManager startDeviceMotionUpdatesUsingReferenceFrame: CMAttitudeReferenceFrameXTrueNorthZVertical and have set the NSMotionUsageDescription ("Privacy - Motion Usage Description") property in the info.plist. But I don't see a permissions popup.

I also don't see any mention of this in the app's section of the Settings app. When is this usage description string used?

So, the direct answer here is actually what's listed in the reference page for "NSMotionUsageDescription":

Important:
This key is required if your app uses APIs that access the device’s motion data, including CMSensorRecorder, CMPedometer, CMMotionActivityManager, and CMMovementDisorderManager. If you don’t include this key, your app will crash when it attempts to access motion data.

The common factor here is that all of these APIs provide some combination of very long terms (hours-> days) monitoring and/or return a level of data that is inherently sensitive to the user. Neither of those are really an issue with CMMotionActivityManager, which is primarily used for things like in app motion controls and which only really works in the foreground. In practical terms, it's obvious to the user that an app is "monitoring their motion" when the user interface is changing based on that motion.

I wonder if there is some connection between the motion permission and the location permission, which I also use?

Some what. CMAttitudeReferenceFrameXTrueNorthZVertical does require location services access (for the compass), which your location authorization will take care of.

__
Kevin Elliott
DTS Engineer, CoreOS/Hardware

Thanks for your reply. I did notice that the text you've quoted doesn't include CMMotionManager, but I think I assumed that CMMotionManager was "obviously" included in "APIs that access the device's motion data", and that the docs were mentioning only the other less-obvious ones.

In practical terms, it's obvious to the user that an app is "monitoring their motion" when the user interface is changing based on that motion.

Correct, but it's also obvious to the user that the app is accessing their location when it's flashing a blue spot on a map, yet I still get my apps rejected because my location usage string "doesn't include an example"!

So - if I'm using CMMotionManager, and not any of the other listed APIs, do I need to include the usage description string to get approved? I've just had an update approved with the string present so including it unnecessarily doesn't seem to be an issue.

I did notice that the text you've quoted doesn't include CMMotionManager, but I think I assumed that CMMotionManager was "obviously" included in "APIs that access the device's motion data", and that the docs were mentioning only the other less-obvious ones.

Sigh... actually I'm afraid that was a very busy day and I was jumping back and forth between to many things while writing your reply. In the message above I wrote:

Neither of those are really an issue with CMMotionActivityManager, which is primarily used for things like in app motion controls and which only really works in the foreground.

But that SHOULD have said:

Neither of those are really an issue with CMMotionManager, which is primarily used for things like in app motion controls and which only really works in the foreground.

In other words, CMMotionManager is the specific API I was describing there.

So - if I'm using CMMotionManager, and not any of the other listed APIs, do I need to include the usage description string to get approved? I've just had an update approved with the string present so including it unnecessarily doesn't seem to be an issue.

Yes, that's correct. I don't see any issue with including the string, but CMMotionManager does not currently require any privacy authorization.

__
Kevin Elliott
DTS Engineer, CoreOS/Hardware

But that SHOULD have said: ...

Ha, I didn't even notice that; I read it as you intended, not as you wrote it.

Looking again at the Core Motion docs front page, https://developer.apple.com/documentation/coremotion , it says:

Important

An iOS app must include usage description keys in its Info.plist file for the types of data it needs. If these keys aren’t present, the app crashes when you try to access the corresponding service. To access motion and fitness data, include NSMotionUsageDescription. To access the fall-detection service, include NSFallDetectionUsageDescription.

Would you agree that that should exclude CMMotionManager?

Would you agree that that should exclude CMMotionManager?

Yes, with a qualification. The system doesn't require NSMotionUsageDescription for CMMotionManager and never has, largely because the APIs typically used for things that aren't privacy sensitive (primarily, motion based app controls).

The qualifier here is that there have been cases where we have started requiring motion authorization on APIs that did not previously require authorization. From that perspective, I would probably include the string as an easy way to avoid any issues JUST in case the behavior here ever changed.

__
Kevin Elliott
DTS Engineer, CoreOS/Hardware

When is NSMotionUsageDescription shown?
 
 
Q