Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-23925] iOS: App rejected because some <key> in the Info.plist aren't specified

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2016-10-04T08:32:04.000+0000
Affected Version/sRelease 5.5.0
Fix Version/sRelease 6.0.0
ComponentsiOS
Labelsn/a
Reporternicolomonili
AssigneeHans Knöchel
Created2016-09-19T08:55:51.000+0000
Updated2018-06-14T21:42:11.000+0000

Description

From SDK 5.5.0.G.A Titanium require some new keys in the Info.plist file https://www.appcelerator.com/blog/2016/09/ga-release-for-titanium-sdk-5-5-0-appcelerator-cli-5-5-0-appcelerator-studio-4-7-1/
<ios>
    <plist>
        <dict>
            <key>NSContactsUsageDescription</key>
            <string>Can we use to your contacts?</string>
            <key>NSCameraUsageDescription</key>
            <string>Can we use your camera?</string>
            <key>NSCalendarsUsageDescription</key>
            <string>Can we use your calendar?</string>
            <key>NSPhotoLibraryUsageDescription</key>
            <string>Can we save to your library?</string>
            <key>NSMicrophoneUsageDescription</key>
            <string>Can we use your microphone?</string>
        </dict>
    </plist>
</ios>
This is the (first) email that i received from iTunes Connect after the upload of an update of my app with *SDK 5.5.0.G.A*. I haven't included any of the previous keys because the app not use any of that functionality.
Dear developer,

We have discovered one or more issues with your recent delivery for "App Name". To process your delivery, the following issues must be corrected:

This app attempts to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSPhotoLibraryUsageDescription key with a string value explaining to the user how the app uses this data.

This app attempts to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSMicrophoneUsageDescription key with a string value explaining to the user how the app uses this data.

This app attempts to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSAppleMusicUsageDescription key with a string value explaining to the user how the app uses this data.

Once these issues have been corrected, you can then redeliver the corrected binary.

Regards,

The App Store team
Ok , after the first email i have update the Info.plist file adding the *NSPhotoLibraryUsageDescription* and the *NSMicrophoneUsageDescription* keys (i don't use any of this functionality). After the second upload , this is the email (second) that i received from iTunes Connect.
Dear developer,

We have discovered one or more issues with your recent delivery for "App Name". To process your delivery, the following issues must be corrected:

This app attempts to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSAppleMusicUsageDescription key with a string value explaining to the user how the app uses this data.

Once these issues have been corrected, you can then redeliver the corrected binary.

Regards,

The App Store team
Ok , after the second email i have update the Info.plist file adding the *NSAppleMusicUsageDescription* key (i don't use this functionality). After the third upload all is ok. So : - Some keys seem to be required (NSMicrophoneUsageDescription and NSPhotoLibraryUsageDescription), even if the feature is not used - Add in the docs (and in the article) this keys *NSAppleMusicUsageDescription*

Comments

  1. Hans Knöchel 2016-09-19

    Hey there, the keys NSPhotoLibraryUsageDescription and NSMicrophoneUsageDescription are even required when you use any camera- or photo-related API. The NSAppleMusicUsageDescription can be necessary when using any music-related API's, but also media-related queries. The latter one is also discussed in TIMOB-23923. Although this does not seem to be a Titanium SDK-issue, I would check your source-code anyway (confidential). If you want that, please let me know.
  2. nicolomonili 2016-09-19

    I can confirm that this app dont' use any *camera or photo-related API* / *music-related API's*. In fact from the app settings (Settings / App) there is only the cellular data option.
  3. Hans Knöchel 2016-09-19

    Ok, if that's the case, we may need to adjust out compiler-symbols. We only compile certain *classes* when the namespace is used, e.g. USE_TI_MEDIA for any Ti.Media API. But in the case that you have an API on the Ti.Media, all other methods are generated as well. So I would like to know if we can generate method-based symbols to detect this and only compile certain methods if they are actually used. Need some time to think about that.
  4. Hans Knöchel 2016-09-19

    [~cbarber] We use [this lines](https://github.com/appcelerator/titanium_mobile/blob/master/iphone/cli/commands/_build.js#L5675) to generate symbols like USE_TI_MEDIA for all Ti.Media methods. Could we integrate a "whitelist" / regex that also detects the usage of Ti.Media.queryMusicLibrary, Ti.Media.showCamera and Ti.Media.openPhotoGallery? Then we could use precompile-macros for those, e.g. USE_TI_MEDIA_QUERYMUSICLIBRARY and Apple won't complain in the future. *EDIT*: Looks like it already does something in the build-process:
       { ANALYTICS: 1,
         API: 1,
         NETWORK: 1,
         PLATFORM: 1,
         UI: 1,
         UISETBACKGROUNDCOLOR: 1,
         UITABGROUP: 1,
         UIWINDOW: 1,
         UITAB: 1,
         UILABEL: 1,
         MEDIASHOWCAMERA: 1,
         MEDIA: 1 }
       
    So maybe USE_TI_MEDIASHOWCAMERA could actually be generated.
  5. Chris Barber 2016-09-20

    [~hansknoechel] The build will detect all Titanium calls and defines preprocessor constants for the API and its parent. So Ti.Media.showCamera will generate USE_TI_MEDIASHOWCAMERA and USE_TI_MEDIA. There is no need for a whitelist. iOS simply needs to refer to the more specific USE_TI_MEDIASHOWCAMERA and USE_TI_MEDIAQUERYMUSICLIBRARY instead of just USE_TI_MEDIA. We can use this symbol map to generate missing keys in the Info.plist or show a warning that they are missing.
  6. Hans Knöchel 2016-09-20

    Gotcha. But since we currently only wrap the whole MediaModule class with one #ifdef USE_TI_MEDIA, affected methods like -(void)showCamera:(id)args would even be generated without using them. So we need to a) wrap all related methods (this is huge) and b) detect used symbols to throw warnings beforehand. But I would neglect b) since we already throw a warning in the methods themselves. I have a wip-PR for this, but since it's very easy to break stuff with compiler-macros, it needs some more testing before submitting something. Assigning to fix-version 6.0.0 for now.
  7. Chris Barber 2016-09-20

    How many related methods are there? Ti.Media isn't that big. There's a boat load of constants, but there aren't that many methods. And maybe we leave the methods there, but #ifdef the implementation and leave the methods in place, perhaps emit a warning or exception if invoked. We should do this anyways. What happens if you build an app for device that does an eval('Ti.Media.showCamera()')? There are scenarios where the implementation will not exist, but it the API can still be invoked.
  8. Hans Knöchel 2016-09-24

    Correct. We need the same for all other related API's, e.g. Ti.Calendar, Ti.Contacts and probably Ti.Geolocation. I just read another post about this on Slack (regarding contacts usage). [~cng] Do you want me to work on this?
  9. Chee Kiat Ng 2016-09-26

    [~hansknoechel] yes please. Thanks!
  10. David Fox 2016-09-26

    I'm having this same issue while trying to build my app. Just to confirm though, as a temporary workaround, adding these keys despite not actually using the functionality won't break anything, is that correct?
  11. nicolomonili 2016-09-26

    correct
  12. christian ribe 2016-09-28

    I am having the same issue. The NSAppleMusicUsageDescription requirement surprised the heck out of me... What should we put in the string key ? Since apple refuses empty strings... "Not used" ??
  13. Hans Knöchel 2016-09-28

    Anything that makes sense, e.g. "Can we access your music library to select music?". I know it's a pseudo-sentence, but since you don't use the API, it won't be prompted anyway. And as soon as this ticket is resolved, you can remove the key again.
  14. christian ribe 2016-09-28

    Makes sense thanks Hans.
  15. Hans Knöchel 2016-10-01

    PR: https://github.com/appcelerator/titanium_mobile/pull/8456 Packaged version of this PR: [mobilesdk-6.1.0-osx.zip](https://www.dropbox.com/s/n8czyv57ytxtadq/mobilesdk-6.1.0-osx.zip?dl=1) *Some notes*: * The current status should already resolve all of the above warnings * -I will check Ti.Contacts and Ti.Calendar next (should not be as critical as Ti.Media, since they don't include that many different API's)- * This needs to be very very well reviewed before merging. I already did tons of both logical tests, but I may have forgot a method-dependency. *EDIT*: I can't see problems with non-used Ti.Calendar / Ti.Contacts issues. If your app was rejected because of NSCalendarsUsageDescription or NSContactsUsageDescription and you did *not* use the above API's, please let us know! *This part is only relevant for the review of this ticket*: Here is how you scan your packaged app:

    Unzip the AppName.ipa file after renaming AppName.ipa to AppName.zip

    Open the AppName.app file and navigate to the AppName file (no suffix, thats a binary)

    Copy the AppName file to the desktop

    Open the terminal and navigate to the desktop

    Use nm AppName | grep _EK to check for Ti.Calendar API's

    Use nm AppName | grep _AV to check for Ti.Media API's

    Use nm AppName | grep _CN to check for Ti.Contacts API's (neglect _CNCopy* results)

    Use nm AppName | grep CLLocation to check for Ti.Geolocation API's (should already be wrapped correctly before)

    *Additional review-steps*: 1. Create a new app with the packaged version of this PR 2. Build the app for device 3. Follow the above steps to check the symbols of our new apps which are the base for all other ones Also please test the KitchenSink for possible problems regarding Ti.Media API's. I will try to setup another test-case that includes all major Ti.Media API's (showCamera, saveToGallery, openPhotoGallery, openMusicLibrary, queryMusicLibrary).
  16. Hans Knöchel 2016-10-01

    [~nicolomonili] And I noticed that you used Appcelerator Studio 4.3.3.201510212245 which is very outdated. Please use Studio 4.7.x for iOS 10 compatibility.
  17. nicolomonili 2016-10-02

    @Hans Knoechel ok I'll update! strange that is not detected the new version though ..
  18. Chee Kiat Ng 2016-10-03

    See comments on PR for KitchenSink-found issues. Scanning a new project that doesn't include any Media / Contacts related API yields no results, which is correct.
  19. Chee Kiat Ng 2016-10-04

    PR approved. Let's do a backport for 6_0_X please. [~hansknoechel]
  20. Hans Knöchel 2016-10-04

    PR (6_0_X): https://github.com/appcelerator/titanium_mobile/pull/8469
  21. Chee Kiat Ng 2016-10-04

    PR merged.
  22. Eric Wieber 2016-11-11

    Verified fixed, using: MacOS 10.12 (16A323) Studio 4.8.0.201611020954 Ti SDK 6.0.0.v20161111062138 Appc NPM 4.2.8-9 Appc CLI 6.0.0-69 Alloy 1.9.4 Xcode 8.1 (8B62) Scanned and submitted apps with different combinations of permissions or no permissions at all. All were accepted and only showed usage of permissions that were actually used.
  23. Junaid Younus 2017-01-24

    We were able to reproduce this issue with the 6.0.1 release of the SDK. Here's the email:
        Missing Info.plist key - This app attempts to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSCalendarsUsageDescription 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 NSPhotoLibraryUsageDescription key with a string value explaining to the user how the app uses this data.
        
    We don't use any Calendar or Photo functionality in our app, I did a project-wide search for Ti.Calendar and Ti.Media and there's nothing in our code, only in some auto generated build files. We bypassed the issue by adding the appropriate keys to the tiapp.xml files.
  24. Hans Knöchel 2017-01-24

    [~jyounus] Can you post the contents of the build/iphone/Classes/defines.h file here? We are currently working on a 6.0.2 version, thx!
  25. Hans Knöchel 2017-01-24

    And are you using an Admob module? It's a known issue on their side that they fixed recently. Update the module version in that case.
  26. Danny Pham 2017-03-17

    I have received the same rejection message with missing NSCalendarsUsageDescription key using latest Titanium SDK 6.0.2 and latest Admob version 2.1.0
  27. Eric Merriman 2017-03-17

    Hello [~crossbits] Did you add the NSCalendarsUsageDescription key and value to the tiapp.xml plist section?
  28. Danny Pham 2017-03-17

    After the rejection, yes. Now the upload seems fine. But I don't use any calender functions.
  29. Eric Merriman 2017-03-17

    Hmmm... If you look in the folder: /build/ios and find the Xcode project, and launch it in Xcode, does a search of your code for NSCalendar object give us any clue about where the source of the rejection would've come from?
  30. Hans Knöchel 2017-03-17

    [~crossbits] Let's work on that then! Can you reach out to me on Ti-Slack and send me the generated defines.m from build/iphone/Classes/? Thx!
  31. Hans Knöchel 2017-03-20

    The issue was inside the Admob library. Should be fixed after [this update](https://github.com/appcelerator-modules/ti.admob/pull/67).
  32. Hans Knöchel 2017-03-25

    The new Ti.Admob version 2.1.1 is released and includes the above fixes as well.
  33. Michael Gangolf 2017-10-19

    My TestFlight app with 6.3.0.RC got rejected because it didn't include *NSAppleMusicUsageDescription* again. I'm only using Camera, PhotoGallery and these Modules:
        <module platform="iphone">dk.napp.slidemenu</module>
        <module platform="commonjs">reste</module>
        <module platform="commonjs">nl.fokkezb.html2as</module>
        <module>av.imageview</module>
        
    I'll add it again but I have 4 versions online already (6.2.0.GA) which didn't need the key in tiapp.xml
  34. Jason Kneen 2017-10-30

    Seeing the music and photo error from Apple when the app we're building doesn't access camera or photos and doesn't access music. It does play / stream remote videos.
  35. Jason Kneen 2017-10-30

    That's on 6.2.2.GA btw
  36. Mitul Bhalia 2018-01-09

    One of my app is rejected yesterday with ti sdk 6.3.1 saying NSBluetoothPeripheralUsageDesc key is missing. @Jason Kneen
  37. Jason Kotchoff 2018-06-14

    Apple rejected our app today which was built with Ti 7.1.1 stating: bq. We identified one or more issues with a recent delivery for your app, "xxx". Please correct the following issues, then upload again. bq. Missing Info.plist key - This app attempts to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSPhotoLibraryUsageDescription key with a string value explaining to the user how the app uses this data. bq. Missing Info.plist key - This app attempts to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSBluetoothPeripheralUsageDescription key with a string value explaining to the user how the app uses this data. bq. Missing Info.plist key - This app attempts to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSMicrophoneUsageDescription key with a string value explaining to the user how the app uses this data. Our app doesn't use the photo library, bluetooth or the microphone however I managed to get a build accepted by apple by adding the following to the tiapp.xml:
        <dict>
          <key>NSPhotoLibraryUsageDescription</key>
          <string>Can we save to your photo library?</string>
          <key>NSBluetoothPeripheralUsageDescription</key>
          <string>Can we use your bluetooth?</string>
          <key>NSMicrophoneUsageDescription</key>
          <string>Can we use your microphone?</string>
        </dict>
        
    The app doesn't use admob so this must be related to the core Titanium SDK.
  38. Jason Kotchoff 2018-06-14

    Actually, a friend told me his app was rejected for containing vague descriptions like this so I'll change this to:
        <dict>
            <key>NSPhotoLibraryUsageDescription</key>
            <string>APP_NAME does not use your photo library</string>
            <key>NSBluetoothPeripheralUsageDescription</key>
            <string>APP_NAME does not use your bluetooth</string>
            <key>NSMicrophoneUsageDescription</key>
            <string>APP_NAME does not use your microphone</string>
        </dict>
        
    based on: [https://stackoverflow.com/questions/39519773/nsphotolibraryusagedescription-key-must-be-present-in-info-plist-to-use-camera-r/39519960#39519960](http://example.com)

JSON Source