Reputation: 23664
I have submitted 11 related (functionally identical) cordova apps just fine, with many iterations. Suddenly I get this rejection for one of them (an update) from apple:
Missing Info.plist key - This app attempts to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSContactsUsageDescription key with a string value explaining to the user how the app uses this data.
Missing Info.plist key - This app attempts to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSMotionUsageDescription key with a string value explaining to the user how the app uses this data.
I haven't added any functionality since the initial release. However, I noticed that a brand NEW app I just created automatically stuck in those Plist entries when ionic generated the Xcode project.
I thought that was because I was creating it with an iOS 9 target whereas all previous apps were created with an iOS 8 target.
My question is: Is this a sudden iOS 9 requirement? If I am using these things, how can I find out what in my app requires them?
I am concerned that these will show up to the user as permission requests or notices and that is undesirable.
Here is my plugin list:
com.dawsonloudon.videoplayer 1.0.0 "VideoPlayer"
com.passslot.cordova.plugin.passbook 0.1.0 "Passbook"
com.telerik.plugins.nativepagetransitions 0.6.5 "Native Page Transitions"
com.unarin.cordova.beacon 3.4.1 "Proximity Beacon Plugin"
cordova-plugin-app-event 1.2.0 "Application Events"
cordova-plugin-appavailability 0.4.2 "AppAvailability"
cordova-plugin-badge 0.7.2 "Badges"
cordova-plugin-bluetooth-serial 0.4.5 "Bluetooth Serial"
cordova-plugin-camera 2.1.1 "Camera"
cordova-plugin-console 1.0.7 "Console"
cordova-plugin-customurlscheme 4.1.5 "Custom URL scheme"
cordova-plugin-device 1.1.1 "Device"
cordova-plugin-facebook4 1.7.4 "Facebook Connect"
cordova-plugin-file 4.1.1 "File"
cordova-plugin-file-transfer 1.5.0 "File Transfer"
cordova-plugin-geolocation 2.1.0 "Geolocation"
cordova-plugin-google-analytics 0.8.1 "Google Universal Analytics Plugin"
cordova-plugin-inappbrowser 1.3.0 "InAppBrowser"
cordova-plugin-network-information 1.2.0 "Network Information"
cordova-plugin-splashscreen 3.2.1 "Splashscreen"
cordova-plugin-statusbar 2.1.2 "StatusBar"
cordova-plugin-vibration 2.1.0 "Vibration"
cordova-plugin-whitelist 1.0.0 "Whitelist"
cordova-plugin-x-socialsharing 5.1.1 "SocialSharing"
cordova-sqlite-storage 2.0.4 "Cordova sqlite storage plugin"
cordova.plugins.diagnostic 3.6.5 "Diagnostic"
ionic-plugin-keyboard 2.2.1 "Keyboard"
jaeger.Html5Video 1.2.2 "Html5Video"
org.nypr.cordova.hockeyappplugin 0.1.0 "Device"
org.nypr.cordova.nslogger-cocoalumberjack-connector-plugin 0.1.0 "Device"
pushwoosh-cordova-plugin 6.5.3 "Pushwoosh"
Upvotes: 1
Views: 3376
Reputation: 30366
Since iOS 10 it is compulsary to have a usage description in the .plist if your app is requesting the related functionality (see here).
Therefore many plugins now include these keys in one form or another, including some of the plugins in your list. For example cordova-plugin-camera enables NSCameraUsageDescription
to be specified via a plugin variable
and cordova-diagnostic-plugin sets default placeholders for many of these including NSMotionUsageDescription
.
However, having these keys in your .plist doesn't mean the messages they contain will automatically appear to users as permission requests. They will only be displayed when you call the relevant native iOS method via a plugin.
For example, in the case of NSMotionUsageDescription
, the message contained within will only be displayed if you call the diagnostic plugin function requestAndCheckMotionAuthorization().
App Store rejection occurs when an iOS app contains native calls to use functionality which requires a UsageDescription, but no such usage description key exists in the plist.
For example, in the case of NSMotionUsageDescription
, if your app contained a call to the native function CMMotionActivityManager.startActivityUpdatesToQueue
but didn't contain NSMotionUsageDescription
in the plist, your app would be rejected on uploading the binary to iTunes Connect.
I assume Apple uses some software which scans your app binary on upload to check for calls to the relevant API functions and that corresponding UsageDescription plist entries are present.
In the case of a native iOS app, you would simply remove (or not add) calls to API functions that your weren't using, i.e. you wouldn't include a call to CMMotionActivityManager.startActivityUpdatesToQueue
if your app didn't need to track motion.
However, in the case of a Cordova app, you are one step removed from the native code, which is included by installing plugins. For example, if you install cordova-diagnostic-plugin into your Cordova project, your app will contain a call to CMMotionActivityManager.startActivityUpdatesToQueue
because that is in the plugin code. It doesn't matter if your app actually calls the plugin API function which in turn calls that native function, the fact is it's present in your app's code. And therefore NSMotionUsageDescription
must be present in the .plist to prevent App Store rejection, hence why cordova-diagnostic-plugin adds a placeholder message for that key. But, as mentioned above, that permission request won't be present to the user unless you call requestAndCheckMotionAuthorization().
Note that you can customise the default UsageDescription messages added by plugins using cordova-custom-config - see here.
Upvotes: 2
Reputation: 98
You must add an attribute to info.plist which the key is NSContactsUsageDescription and the value is the text you are presenting the user explaining him why do you want access to this. Same for NSMotionUsageDescription.
Click the + sign information property list
Paste NSMotionUsageDescription and press enter
It will automatically become Privacy - Motion Usage Description. Do it for both and you are done.
I hope it helps!
Upvotes: 0