WKWebView, files ActionSheet and related usage descriptions

When the loaded page in WKWebView (iOS app) has a web form to add files and the user taps on it the user will see a system ActionSheet with options:

  • Take photo or video
    Photo Library
  • Browse


To use the first one it is required to add Camera and Microphome usage description permissions. It is easy to find it out because the app crashes without usage descriptions in the project info.plist but as a developer I am not using the UIImagePickerController directly


To use the second option it seems the developer has to add photo library usage description - NSPhotoLibraryUsageDescription. But according to this documentation https://developer.apple.com/documentation/photokit/requesting_authorization_to_access_photos it is not required. And the app does not have any crashes (but this document tells that it should crash https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html#//apple_ref/doc/plist/info/NSPhotoLibraryUsageDescription). This option does not produces the alert about photo library access, and on top of that the developer does not use any photo frameworks or UIImagePickerController

To use third option it seems the developer should setup UISupportsDocumentBrowser key but the app does not use UIDocumentBrowserViewController directly. Probably I have to make my own alert according to iCloud Design Guide. Also there some entitlements to use iCloud


While the first option is required to create some usage descriptions the two others don't and it is not clear how the security policy for apps is working at all. There is no any consistency. Also the WKWebView documetation does not describe this case at all. It produces a lot of questions. At least I have to ask about it according to this document https://developer.apple.com/documentation/uikit/protecting_the_user_s_privacy/requesting_access_to_protected_resources


But the main question is what usage description keys should I as a developer put inside my application info.plist so I will provide the best experience for app's user and not be rejected in app review process while use WKWebView to load any website with form containing files input fields?


Thanks a lot

Accepted Reply

So, if anybody is interested in here is an official response by Apple Developer Technical Support for this question (which is one 50$ request from 100$ requests batch of Apple Dev Program cost):

Thanks for contacting Developer Technical Support (DTS).

 If your WKWebView will allow your users access sites that may require permissions you are unaware of, there is no good answer.

Generally, your app should know where your users are going and what permissions may be required. We are not App Review so I cannot tell you the criteria for a rejection but here is my advice :

1) Add all possible permissions that will be relevant to your app, camera, photo library, iCloud Drive access, ALL of the location permissions if you think location will come into play and whatever else you deem a scenario that can happen.

2) Limit the places your users will go and know what permissions are required to for those sites.

With that said your app is not crashing TODAY (I say that because I cannot predict the future) with photos because your app can’t actually access the photo library using WKWebView, it can only access the selected photo. The same is true for Browser. It doesn’t hurt to add permissions for such but App Review is who you should contact for confirmation.

Hopefully this helps. 

So, yep, that helps... A bit

Also

We are not App Review ...

sounds like where are two companies I have to communicate with ...

Anyway, this is at least some information. Thank you all and thank you Apple for support very much.
Best regards


Replies

Ok. It is important for me now so I have asked in dev support ...
So, if anybody is interested in here is an official response by Apple Developer Technical Support for this question (which is one 50$ request from 100$ requests batch of Apple Dev Program cost):

Thanks for contacting Developer Technical Support (DTS).

 If your WKWebView will allow your users access sites that may require permissions you are unaware of, there is no good answer.

Generally, your app should know where your users are going and what permissions may be required. We are not App Review so I cannot tell you the criteria for a rejection but here is my advice :

1) Add all possible permissions that will be relevant to your app, camera, photo library, iCloud Drive access, ALL of the location permissions if you think location will come into play and whatever else you deem a scenario that can happen.

2) Limit the places your users will go and know what permissions are required to for those sites.

With that said your app is not crashing TODAY (I say that because I cannot predict the future) with photos because your app can’t actually access the photo library using WKWebView, it can only access the selected photo. The same is true for Browser. It doesn’t hurt to add permissions for such but App Review is who you should contact for confirmation.

Hopefully this helps. 

So, yep, that helps... A bit

Also

We are not App Review ...

sounds like where are two companies I have to communicate with ...

Anyway, this is at least some information. Thank you all and thank you Apple for support very much.
Best regards