ios app crash when input file Choose Existing selected - ios

I try to use uiwebview for my project. All feature works fine, but when in the application click on the Choose Existing button after selection of input file, app crashed. The error message I get is:
[access] This app has crashed because it attempted 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.
Should I add some function into project to ignore this?

You have to add to the app the permission to use the photo library.
Click on the project file in the project navigator, and then select "Info" tab. You will see items like "bundle display name" and "bundle version string". Go to the last item and tap the "+" sign there to add a new item.
When a new item has been added, change its name and select "Privacy - photo library usage description", and add some text regarding why your app wants to select a photo (you could leave this blank in older iOS SDKs but not any more).
Now if you run the app again, the app will display the message that you entered and ask for permission to access the photo library. This will happen only once.

Related

Is it possible to localize the NSPhotoLibraryUsageDescription string displayed by the iOS 14 "Select More" dialog?

My iOS project is set up with localized permission dialog text, through using the InfoPlist.strings file and checking it into my build target.
On iOS 14, when requesting for Photos library permissions, I noticed that the first time the app requests for this permission, the popup (containing 3 options: Select photos, Allow all photos, Deny) will have its permission text correctly translated as per the InfoPlist.strings file.
However, from the next time the app requests for this permission, the popup (which contains 2 options: Select more photos, Use current selection) will not have its permission text translated.
I've also found a Apple Developer forum question raising the same issue, and the answer from Apple Support Staff doesn't seem to help, as my project is already using the InfoPlist.strings file, and the permission text is indeed translated on the first-time popup.
Are there some steps that I'm missing in my setup, or is this a known issue on iOS 14?

How to get listed in the share menu of the Photo App?

I know that in order to get my App listed under the share menu all I have to do is add the Document Types my App supports but it does not work for the "Photos App" for some reason, my App is never shown under this menu.
But if I send an image to my Email and then open it, then tap on Share and my App is right there, what type of document is required for the Photos App then? I added this so far:
public.content
public.jpeg
public.png
public.heic
public.image

Unable to find apple GPS's Privacy - Location Always Usage Description

I am currently working with Swift and I'm trying to get a GPS app working for a project I'm working on. I understand that in order to get the user's location, I need there permission through Privacy - Location Always Usage Description.
However, I don't know why but I cant find it, only Privacy - Location Usage Description. Can you help me or explain why?
You can do this in Xcode 8 by following these steps:
Select your .proj file in project explorer
Select a target
Click on the "Info" tab to find your info.plist file
Use the "+" button to add a new key-value pair in this file
Type in "Privacy -" to get the different options available and choose the one that you need (location usage in your case).
Make sure you enter valid reason as a
string value for this new key.
Hope this helps.

iOS - App crashed because it attempted to access privacy - sensitive data without a usage description

I get the following error:
[access] This app has crashed because it attempted 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.
Do you know how to fix that?
These are set in the plist for your project. You can add/remove these by navigating to your target info inspector and expanding the "Custom iOS Target Properties" section. For example, one of the entries here in a project of mine is:
Privacy - Camera Usage Description
Allows user to capture a photo or video to upload to their family circle
You can see how this looks here:
You need to go to your Info.plist, add a new row and paste NSPhotoLibraryUsageDescription into the key column. Then in the value column give a description as to why you need to access the user's photo library. Repeat the same step with NSCameraUsageDescription if you intend to use the device's camera.

No my app name shown in "Open in" menu for new registered file type on ios

I've added custom file type ".hex" for my app and associated it with my app (followed this tutorial).
Anyway when testing in email app (long tap on attached file) "open in" menu is shown and my app icon is shown but no my app name appended:
If tap "Quick Look" i can see provided by me file type description, so i'm sure file type icon and description is used as expected. Also i can tap my app icon and application:openURL:sourceApplication:annotation will be invoked as expected.
My app icon and name is shown in apps list as usual. Testing on iPad 2 on iOS 7.1.
I'm guessing that you need to add a "Bundle Display Name" (CFBundleDisplayName) key to your Info.plist file.

Resources