[TIMOB-23925] iOS: App rejected because some <key> in the Info.plist aren't specified
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2016-10-04T08:32:04.000+0000 |
Affected Version/s | Release 5.5.0 |
Fix Version/s | Release 6.0.0 |
Components | iOS |
Labels | n/a |
Reporter | nicolomonili |
Assignee | Hans Knöchel |
Created | 2016-09-19T08:55:51.000+0000 |
Updated | 2018-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*
Hey there, the keys
NSPhotoLibraryUsageDescription
andNSMicrophoneUsageDescription
are even required when you use any camera- or photo-related API. TheNSAppleMusicUsageDescription
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.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.
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 anyTi.Media
API. But in the case that you have an API on theTi.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.[~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 allTi.Media
methods. Could we integrate a "whitelist" / regex that also detects the usage ofTi.Media.queryMusicLibrary
,Ti.Media.showCamera
andTi.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:So maybe
USE_TI_MEDIASHOWCAMERA
could actually be generated.[~hansknoechel] The build will detect all Titanium calls and defines preprocessor constants for the API and its parent. So
Ti.Media.showCamera
will generateUSE_TI_MEDIASHOWCAMERA
andUSE_TI_MEDIA
. There is no need for a whitelist. iOS simply needs to refer to the more specificUSE_TI_MEDIASHOWCAMERA
andUSE_TI_MEDIAQUERYMUSICLIBRARY
instead of justUSE_TI_MEDIA
. We can use this symbol map to generate missing keys in theInfo.plist
or show a warning that they are missing.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.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 aneval('Ti.Media.showCamera()')
? There are scenarios where the implementation will not exist, but it the API can still be invoked.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?
[~hansknoechel] yes please. Thanks!
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?
correct
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" ??
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.
Makes sense thanks Hans.
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
orNSContactsUsageDescription
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'sUse
nm AppName | grep _AV
to check for Ti.Media API'sUse
nm AppName | grep _CN
to check for Ti.Contacts API's (neglect_CNCopy*
results)Use
*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).nm AppName | grep CLLocation
to check for Ti.Geolocation API's (should already be wrapped correctly before)[~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.@Hans Knoechel ok I'll update! strange that is not detected the new version though ..
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.
PR approved. Let's do a backport for 6_0_X please. [~hansknoechel]
PR (6_0_X): https://github.com/appcelerator/titanium_mobile/pull/8469
PR merged.
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.
We were able to reproduce this issue with the 6.0.1 release of the SDK. Here's the email:
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.
[~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!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.
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
Hello [~crossbits] Did you add the NSCalendarsUsageDescription key and value to the tiapp.xml plist section?
After the rejection, yes. Now the upload seems fine. But I don't use any calender functions.
Hmmm... If you look in the folder:
[~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!The issue was inside the Admob library. Should be fixed after [this update](https://github.com/appcelerator-modules/ti.admob/pull/67).
The new Ti.Admob version 2.1.1 is released and includes the above fixes as well.
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:
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
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.
That's on 6.2.2.GA btw
One of my app is rejected yesterday with ti sdk 6.3.1 saying NSBluetoothPeripheralUsageDesc key is missing. @Jason Kneen
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:
The app doesn't use admob so this must be related to the core Titanium SDK.
Actually, a friend told me his app was rejected for containing vague descriptions like this so I'll change this to:
based on: [https://stackoverflow.com/questions/39519773/nsphotolibraryusagedescription-key-must-be-present-in-info-plist-to-use-camera-r/39519960#39519960](http://example.com)