iTunes connect : NSMicrophoneUsageDescription key missing but no microphone usage - ios

I tried to upload my app on iTunes Connect, but the following error appeared :
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.
It worked until now. I didn't add new library.
My research conclude on modules which are :
- Take photo (no videos), but no update from 2 years
- AVAudioSession library, but no update from 3 years, and doesn't use the requestRecordPermission
And I don't use Instabug or iMessage.
I don't need microphone on my app, how I can tell I really don't use it ?
Or how I can find the library which requires the NSMicrophoneUsageDescription key ?
(I don't want to add the key to my info-plist, I think it's not normal to ask the user for something I don't use/want to use)

During submission your binary is scanned for the presence of the symbol - AVAudioSession requestRecordPermission: in this case.
when found you get an error like the one above.
You can either
just add the key as there is no prompt for your users until you actually request the permission to use the microphone.
find which of your framework is containing the symbol (you can search recursively in your build folder framework binaries with tools like strings or nm or otool, grep the above symbol and when found remove the framework from your app).

Related

ITMS-90683: Missing Purpose String in Info.plist NSMicrophoneUsageDescription, flutter

I don't use microphone but App Store rejected my app by this error:
ITMS-90683: Missing Purpose String in Info.plist - Your app‘s code references one or more APIs that access sensitive user data. The app‘s Info.plist file should contain a NSMicrophoneUsageDescription key with a user-facing purpose string explaining clearly and completely why your app needs the data. If you're using external libraries or SDKs, they may reference APIs that require a purpose string. While your app might not use these APIs, a purpose string is still required. For details,
And I added NSMicrophoneUsageDescription to Info.plist but when I upload it gives this error again.
Even though you are not using microphone some of the packages that you used might have accessed this feature. In info.plist you can add the same like this
<key>NSMicrophoneUsageDescription</key>
<string>The application does not use this feature</string>
The Kashik answer has one disadvantage. User will see permission dialog, if some library makes request for microphone.
If you want to find out what library can fire request for microphone, you can search Microphone phrase on every library in .pub-cache directory. And then you can replace such lib. See my answer for more details: https://stackoverflow.com/a/75309325/5985886

IOS permissions in Info.plist ignored when uploading app

I am trying to build an ionic cordova app for IOS (we have only used android builds on this project until now), I have added the IOS platform from scratch, built in cordova, then opened the Xcode project, built, archived and uploaded. but then i get emailed an error regrading missing entries into my info.plist for "NSMicrophoneUsageDescription" and "NSSpeechRecognitionUsageDescription".
So i went and added the two records with an explanation for their use in my apps info.plist
<key>NSMicrophone​Usage​Description</key>
<string>The app uses speech to text input to capture notes, this requires microphone access</string>
<key>NSSpeech​Recognition​Usage​Description</key>
<string>The app uses speech to text input to capture notes, this requires speech recognition use</string>
I have verified that those records end up in the built files info.plist that i then try uploading, but i still get the rejection email.
I thought it may need to be in the info.plist file of the API that requires those permissions, but even after adding the same values there i still get the rejection emails.
I have tried uploading from Xcode after the archiving finished and taking the Xcode archive, browsing inside it, getting just my .app, adding to a folder called Payload, compressing and renaming it to .ipa and uploading that to apple, with the same response.
Is there some file naming or folder structure that i am missing when i upload my files, i have checked that they all have the records that apple is asking for in all info.plist files but i still get the exact same rejection email when uploading
EDIT: the rejection email from apple
"
Dear Developer,
We identified one or more issues with a recent delivery for your app, "XXXX" 7.XX (7.XX). Please correct the following issues, then upload again.
ITMS-90683: Missing Purpose String in Info.plist - Your app's code references one or more APIs that access sensitive user data. The app's Info.plist file should contain a NSMicrophoneUsageDescription key with a user-facing purpose string explaining clearly and completely why your app needs the data. Starting Spring 2019, all apps submitted to the App Store that access user data are required to include a purpose string. If you're using external libraries or SDKs, they may reference APIs that require a purpose string. While your app might not use these APIs, a purpose string is still required. You can contact the developer of the library or SDK and request they release a version of their code that doesn't contain the APIs. Learn more (https://developer.apple.com/documentation/uikit/core_app/protecting_the_user_s_privacy).
ITMS-90683: Missing Purpose String in Info.plist - Your app's code references one or more APIs that access sensitive user data. The app's Info.plist file should contain a NSSpeechRecognitionUsageDescription key with a user-facing purpose string explaining clearly and completely why your app needs the data. Starting Spring 2019, all apps submitted to the App Store that access user data are required to include a purpose string. If you're using external libraries or SDKs, they may reference APIs that require a purpose string. While your app might not use these APIs, a purpose string is still required. You can contact the developer of the library or SDK and request they release a version of their code that doesn't contain the APIs. Learn more (https://developer.apple.com/documentation/uikit/core_app/protecting_the_user_s_privacy).
The App Store Team
"
First, you need to clear your derived data.
set your deployment target to 9.0 or lesser maybe, when you change your target Xcode resets your info.plist.
prepare your Cordova application using the command : cordova prepare
once you prepared your application goto "-Info.plist" file and add the below description.
<key>NSMicrophone​Usage​Description</key>
<string>The app uses speech to text input to capture notes, this requires microphone access</string>
<key>NSSpeech​Recognition​Usage​Description</key>
<string>The app uses speech to text input to capture notes, this requires speech recognition use</string>
archive your application and uploadd to appstore. you will not get rejection.

"Missing Purpose String in Info.plist File" not actually missing

Attached is what I get from Apple after uploading to the App Store Connect, even though all of these are included in my info.plist. I have tried nearly 10 times to change the name of my string ranging from long strings (e.g. We get the bluetooth in order to connect with certain DJI models that require bluetooth to get telemetry and other data from the drone.) to short strings (e.g. We display the user's location on Mapview.)
All other questions I have seen claim the simple solution is to include the string, which I'm already doing! Does this have something to do with DJI's sdk? I would think just including this in MY info.plist would be enough. The main issue seems to be with the bluetooth permissions as another app I am trying to upload returns the same issue.
"Dear Developer,
We identified one or more issues with a recent delivery for your app,
"DJI Swift Demo". Please correct the following issues, then upload
again.
Missing Purpose String in Info.plist - Your app's code references one
or more APIs that access sensitive user data. The app's Info.plist
file should contain a NSBluetoothPeripheralUsageDescription key with a
user-facing purpose string explaining clearly and completely why your
app needs the data. Starting Spring 2019, all apps submitted to the
App Store that access user data will be required to include a purpose
string. If you're using external libraries or SDKs, they may reference
APIs that require a purpose string. While your app might not use these
APIs, a purpose string is still required. You can contact the
developer of the library or SDK and request they release a version of
their code that doesn't contain the APIs. Learn more
(https://developer.apple.com/documentation/uikit/core_app/protecting_the_user_s_privacy).
Though you are not required to fix the following issues, we wanted to
make you aware of them:
Missing Purpose String in Info.plist - Your app's code references one
or more APIs that access sensitive user data. The app's Info.plist
file should contain a NSLocationWhenInUseUsageDescription key with a
user-facing purpose string explaining clearly and completely why your
app needs the data. Starting Spring 2019, all apps submitted to the
App Store that access user data will be required to include a purpose
string. If you're using external libraries or SDKs, they may reference
APIs that require a purpose string. While your app might not use these
APIs, a purpose string is still required. You can contact the
developer of the library or SDK and request they release a version of
their code that doesn't contain the APIs. Learn more
(https://developer.apple.com/documentation/uikit/core_app/protecting_the_user_s_privacy)."
Instead of verifying the plist information in XCode, please look into the plist inside ipa.
Please follow the below steps to verify plist inside ipa.
Let say, your ipa file is Demo.ipa
Copy the Demo.ipa to DemoBkup.ipa
Rename it to DemoBkup.zip
Extract the zip file. (Double click the zip file)
The Extracted file will contain "Payload" folder.Get into Payload folder.
You will find the Demo package. Right click and tap "Show Package contents"
Search for your Info.plist.
Validate all the information you gave in XCode is present in this plist.
Change your info.plist keys with the keys Privacy - Bluetooth Peripheral Usage Description, Privacy - Location When In Use Usage Description. Check the given screenshot for reference:
Do check the plist file referenced by the scheme you are building. I think the plist file you are making change is not the same referenced by the scheme from what you are building the ipa file to submit to App Store.

Do I need to add a privacy "purpose string" to my app's Info.plist to allow it to run on iOS 10?

General Query
Does precise documentation exist for which API methods/properties require privacy "purpose strings" in iOS 10?
Specific Query
I have an app that links against the CoreBluetooth framework that accesses only the following methods/properties:
CBCentralManager:
state
- retrieveConnectedPeripheralsWithServices:
CBPeripheral:
name
In the documentation, I have found the following vague statements (emphases mine):
An iOS app linked on or after iOS 10.0 must include in its Info.plist file the usage description keys for the types of data it needs to access or it will crash. To access Bluetooth peripheral data specifically, it must include NSBluetoothPeripheralUsageDescription.
[...]
When the system prompts the user to allow usage, the value that you provide for this key is displayed as part of the alert.
[...]
To protect user privacy, an iOS app linked on or after iOS 10.0, and which accesses the Bluetooth interface, must statically declare the intent to do so. Include the NSBluetoothPeripheralUsageDescription key in your app’s Info.plist file and provide a purpose string for this key. If your app attempts to access the Bluetooth interface without a corresponding purpose string, your app exits.
[...]
The data and features that require user permission are described in Table 1-2.
(Table 1.2 states that NSBluetoothPeripheralUsageDescription is required to access "Bluetooth peripherals")
My app does not currently exit when it calls the APIs listed. Neither does it "prompt the user to allow usage".
However, this blog post suggests that the lack of a crash does not indicate that no purpose string is required.
(Despite the fact that my app is not "linked on or after iOS 10.0" (the current version has been in the store since before iOS 10 existed), it does crash citing a missing NSCameraUsageDescription when it attempts to access the camera.)
Furthermore, my reading of the documentation above suggests that I should be including an entry for NSBluetoothPeripheralUsageDescription.
Is there any other documentation that I've missed that lists which actual API calls are covered by which privacy purpose strings?
Do I need to add an entry for NSBluetoothPeripheralUsageDescription to my Info.plist?
Is there any harm in adding such an entry if it turns out not to be required?
Yes you're definitely need it, it was optional in pre-ios10 but now you have to explicit add the comment into the info.plist
IF you're build with iOS10. It will crash the app but If you build with pre-ios 10 it's fine. It's based on Xcode build not based on Device version
So basically, next time you update the app you need to add it.
and By the way, I couldn't find document for it, this is my own experience that we have when shifting from iOS9 to iOS10

App rejected: Systematic way to find (cocoapod) library that accesses privacy-sensitive data

iTunes Connect just told me that
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.
My app however doesn't make use of the microphone. How can I systematically find out which of my (cocoapods) dependencies are responsible for that?
There are >20 dependencies and I'd like to avoid manually removing dependencies (and uncommenting my code using it) just to find which one of them causes the rejection since build time + submitting + "waiting for processing" takes a lot of time.
For closed-source Pods, use nm to show the symbol tables of the shared libraries. In this case, the command would be nm Pods/google-cast-sdk/GoogleCastSDK-Public-3.2.0-Release/Goog‌​leCast.framework/Goo‌​gleCast, which lists a reference to AVAudioSession.
In your app's plist, add "NSMicrophoneUsageDescription" and add description for that.

Resources