Why doesn't my Info.plist work? - ios

The project is not recognising the Info.plist correctly.
For example, I want to use the camera or the photo library in the app and even though I added the keys to the Info.plist, I see an error indicating that I need to add those keys.
Recently I used a URL in the app and added App Transport Security Settings to Allow Arbitrary Loads and the app shows me an error for this too.

Related

Xamarin iOS project Info.plist issues during submission on App Store

I am developing project which use the following permissions in Info.plist: NSCameraUsageDescription,
NSPhotoLibraryUsageDescription, NSMicrophoneUsageDescription, NSPhotoLibraryAddUsageDescription, NSCalendarsUsageDescription. App can browse photos library or take a picture. After the deployment process for submission on App Store I get the info:
The app's Info.plist file should contain a NSLocationAlwaysUsageDescription key with a user-facing purpose string explaining clearly and completely why your app needs the 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.
In my app I don't use or ask user for location permission. Moreover I use the NuGet packages: Xamarin.Essentials, Forms, Plugin.Permissions. How can I workaround this issue with location permissions to avoid placing this ?
There is nothing that you can do to workaround the problem aside from removing plugins.
And there are no reasons to do something like that as the end-user won't see any difference unless you ask for the location in the app's code. Info.plist is not visible to the end user in any way including through the app listing.

Is it mandatory to add NSPhotoLibraryUsageDescription in info.plist?

I am not using UIImagePicker in my app and not accessing the Photo Library. I got a mail regarding add NSPhotoLibraryUsageDescription in info.plist file.
I have following questions
How to confirm my project accessing the photo library?
I already searched UIImagePicker in my project and did't get any result.
Is it mandatory to add NSPhotoLibraryUsageDescription in info.plist while i am not accessing the photo library?
Can any one help to find it out .
Thanks
UIImagePicker
An image picker controller manages user interactions and delivers the results of those interactions to a delegate object. The role and appearance of an image picker controller depend on the source type you assign to it before you present it.
whenever you used UIImagePicker, you have to give permission for that particular application
There is a list of all Cocoa Keys that you can specify in your Info.plist file:
https://developer.apple.com/library/content/documentation/General/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html
(Xcode target -> Info -> Custom iOS Target Properties)
iOS already required permissions to access microphone, camera, and media library earlier (iOS6, iOS7), but since iOS10 the apps will crash if you don't provide the description why you are asking for the permission.
UPDATE:
Summary of all privacy keys (with example description):
Useful Link
You only have to add this key-value pair to your info.plist if you are actually accessing the photos any way. If it's not added the app is going to crash.
Check if any of your added dependencies using UIImagePicker.
No it's not mandatory to add NSPhotoLibraryUsageDescription key in info.plist. If your App is not using accessing photo from library/gallery then you should remove it. But as "#Bence Pattogato" said if Your app accessing photo from library/gallery and there is no key added in info.plist then it will be crash.
For your information below are different keys that required to add info.plist if you accessing relevant features according to camera/photo library.
1) NSPhotoLibraryUsageDescription : This key lets you describe the reason your app accesses the user’s photo library. When the system prompts the user to allow access, this string is displayed as part of the alert.
2) NSCameraUsageDescription : describes the reason that the app (including an iMessage app) accesses the device’s camera. When the system prompts the user to allow access, this string is displayed as part of the alert.
3) NSPhotoLibraryAddUsageDescription : (New in iOS 11) This key lets you describe the reason your app seeks write-only access to the user’s photo library. When the system prompts the user to allow access, this string is displayed as part of the alert.
Above information get from this Appel official link.

App rejected: Missing Info.plist key "NSBluetoothPeripheralUsageDescription" but framework is not present

I have a Cordova app that runs in iOS phones. I'm trying to send an update of this app to App Store, but it is being rejected. Firstly it was rejected because the info.plist contained a line with the key NSBluetoothPeripheralUsageDescription and this feature is never used in my app. To solve this problem I removed this line from info.plist and the respective framework from Linked Frameworks and Libraries in xCode (the framework CoreBluetooth.framework and the line NSBluetoothPeripheralUsageDescription was added by Cordova Diagnostic Plugin), as can be seen in the image below:
However now I'm receiving a e-mail from iTunes Connect saying this:
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.
But I removed the CoreBluetooth.framework from the xCode project...
My question is: I need to remove this framework from another place? Are some other framework able to use bluetooth causing this problem?
Thanks for help.
Open Info Plist file and press on + sign add new key in info.plist of your project and add this NSBluetoothPeripheralUsageDescription and write value "Explain the reasons for bluetooth"
Check Screen shot below
It appears that you cannot have a generic text string like:
We need access to your bluetooth connection.
I had something like this and got rejected. When I had a more detailed description like:
We need access to your bluetooth connection to upload data from your
device for crash reports.
I was approved.
The descriptions are mandatory for any content you or any frameworks you link against attempt to access. The errors are generated upon an attempt to access the content if a usage description was not supplied, so if you're getting those errors your app must be requesting them. You should discover why your app or its frameworks require these and add appropriate usage descriptions to your app's info.plist.
Or more ideally, if you don't need access, see if there's a way to not request it (or use frameworks that do unnecessarily).
For time being you can add the following descriptions in your info.plist and submit your app (in case of urgent app update)
<key>NSCalendarsUsageDescription</key>
<string>Explain the reasons for accessing...</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Explain the reasons for accessing...</string>
<key>NSBluetoothPeripheralUsageDescription</key>
<string>Explain the reasons for accessing...</string>
Just open your info.plist and add the code above accordingly.
Try to add below in your plist. It solve my problem.
<config-file parent="NSPhotoLibraryUsageDescription" platform="ios" target="*-Info.plist">
<string>YourAppName would like to store a photo.</string>
</config-file>
I found this thread because I had the same problem.
My experience was that I had installed a Bluetooth package with cordova, but, the experiment fail, and with the new copiles has this issue.
I checked the package.json, the package-lock.json and that I removed all the refences to my code. But, still falling.
Then I checked the pods bundle and found the Bluetooth bundle, but still failing.
I remove and add the platform ios and still falling.
Then I check the project and in the plugins folder I have the Bluetooth plugins folder. Removed, Compiled and works again.
I hope to help you.

iTunes connect rejects my App after uploading because of missing privacy-access descriptions

I want to upload my app to iTunes connect but after uploading I always get an error message by mail from iTunes, that after their scan some description variables are missing.
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 NSCameraUsageDescription key with a string value explaining to the user how the app uses this data.
I am using both features, so that's ok, BUT: i already added those variables to my localized infoPlist.strings. And these seems to work, because in the Simulator and my iPhone, both strings are displayed correctly in the system dialogs. I didn't add the strings to the plist.info file, because I specified them in the localized file, which should be ok. The plist.info and also the localized file are both packaged in the app, I already head a look using Finder.
Is there anything else I must add? Do I still need to add them to the plist.info file, although they are in the localized file?
Additional info: I am using the latest XCode 8 GM build on macOS Safari.
Are you using AdMob? If so the answer is that Google confirmed that it is an issue with the AdMob SDK. You can read about it here.
The solution is, to add the keys also to the PList.info file, not only to the localized infoPlist.strings file.
This is a bit inconsequent because within the simulator and on my phone every message is displayed correctly. But now my app was accepted.

About Info.plist file and Xcode 5

I have some questions regarding the information I should include in my project's Info.plist file before submitting the app:
A) About CFBundleIcons: I see this key when I open the file in Xcode as source code and the xml format is displayed but, when I open it as property list, I only see an Icon files (iOS 5) entry, is that correct? On the other hand, I've changed the app icons I firstly had in the General tab of the target settings, and the Info.plist file keeps listing the old app icons as well, and the new icons I added do not have the .png extension in their name... should I handle this information manually, or did I something wrong when I changed the icons in the target's settings? Should the names include the png extension? Should I list all versions of an icon (standard and #2x), or just the name for the standard is enough?
B) Regarding UIRequiresPersistentWifi key, Apple's docs say that
Include this key if your app requires a Wi-Fi connection
I'm not sure if I have to include this key: my app performs network operations but they could be done via WWAN, not only via Wi-Fi. And not all my app's features need network connection to be performed.
C) About UIRequiredDeviceCapabilities key. I have in turn some questions here: Apple says that
The value of the UIRequiredDeviceCapabilitieskey is either an array or a dictionary that contains additional keys identifying features your app requires (or specifically prohibits).
What do they mean when they say "features your app requires": those features which the app won't work at all without them, or all those features that your app can use? For example: my app includes an option for listening the device's location. It is an optional functionality, users can enable and disable it. I check [CLLocationManager locationServicesEnabled] when the user enables the option. I've no set the location-services value in the plist file and the app has been tested and the feature works, and the compiler has never complained. Should I include the value if I want to submit the app?
Something similar happens with another capabilities, for example microphone and still-camera. I use UIImagePickerController at some point of the app, as well as the microphone for speech recognition, but that are also optional functions of the app that the user has to select, they don't affect its overall operation. And I neither have included such values in the plist yet and they are working...
Thanks in advance
A: If you want to publish iPhone app only you need provide the 2 icon's(#1x, #2x),Now I think #1x is not for necessary, if you want to publish Both iPad & iPhone, you may need to provide 4 icon. But if you dont care about the quality 1 icon is OK.
B:This line UIRequiresPersistentWifi is not necessary.
C:Same as B) This line UIRequiresPersistentWifi is not necessary. if you have more require from iOS system.

Resources