iOSkit Requesting Permission

Apple MAS rejects apps that request permission to the camera unless the request message contains an explanation on why you need access (see link below).
Is there a way to add the reason using iOSkit? or using declares?
I only see the view’s Title as a way to do this, but suspect Apple will not approve this and requires it to be part of the message the user has to agree to.

https://developer.apple.com/ios/human-interface-guidelines/app-architecture/requesting-permission/

When any of the things requiring permission are used by an app on a device for the first time, iOS requests permission from the user via a standard dialog.

My app uses the camera in a view that uses AVFoundation classes from iOSKit and the app has never been rejected by App Store Review for not displaying a reason for this request. In addition to the camera, my app requests user approval to use the photo library, calendars, contacts and location.

Prior to the release of iOS 11, I read that apps now need to display reasons for various requests. The way to do this is to put the appropriate prompts into the Info.plist that is included with your app. I’ve added those requests in and my app has since been approved many times since iOS 11 shipped. So that seems to be the right approach. :slight_smile:

Thanks for the quick reply Jason. So something like below added to my project would add this to the info.plist when compiled, right?

[code]<?xml version="1.0" encoding="UTF-8"?>

NSCameraUsageDescription Whatever the reason is you need access [/code]

I just have an Info.plist file saved in my app project folder which I have dragged into the project, as described here.

I edit that file by double-clicking on it, which opens it in Xcode for editing (as a plist).

Works like a charm. One additional question: how do I add localised strings? Although Apple is likely to only review it in English, I would like to display the reason localised.

Glad to hear it! I don’t know how to do that and I only ship my app in three variants of English because it’s a client for an online product which is only available in a few countries, none of which require changes to the permission phrases I’ve used. However I searched and found this article. That should be possible to do with a post-build script to copy the language-specific strings files into the appropriate folders within each language folder. If you right-click on your built .app file and explore the package you’ll see a folder for each language that you support, so you need to get the language-specific strings files into those folders post-build.

Thanks again. Apple did reject my App for not having an explanation for asking access, but for now I will simply add it in English and see if it gets approved. I received an update from Apple yesterday, on now having a more consistent rejection policy. It could be that from now on, all apps requesting access without giving a reason in plist will be rejected.

I suspect you might be correct about that. You should be OK now with the plist entries as my latest update was approved only 10 days ago and it has the plist entries in the bundle. Good luck! :slight_smile: