1

I'm using the SFSafariViewController to access a website that has an image upload button. When the user touches it, it shows library/camera options which work fine in iOS 13.

I did not add Camera and Photo Library usage descriptions to my Info.plist, but apparently it is not required for it to work.

My problem is that the Apple App Review has rejected my app by stating:

Your app accesses user data from the device but does not have the required precautions in place.

Specifically, your app accesses the device’s camera without asking the user permission.

I'm not sure how to fix this, since, even though I can add the usage descriptions, I believe SFSafariViewController does not provide me a delegate that enables me to ask for a specific permission when a user touches a button inside a website.

Community
  • 1
  • 1
André Lourenço
  • 668
  • 5
  • 10

1 Answers1

1

Apple App Review enforces all apps to ask for permission. Even if your library does not require it or have a specific delegate, you still need to add the static message to display to the user whenever the system uses camera or microphone. I believe the best solution is to make sure you have the following in your ios > Runner > Info.plist :

<key>NSCameraUsageDescription</key>
<string>Need to upload image</string>

<key>NSMicrophoneUsageDescription</key>
<string>Need to upload image</string>

https://developer.apple.com/documentation/avfoundation/cameras_and_media_capture/requesting_authorization_for_media_capture_on_ios

Texv
  • 1,225
  • 10
  • 14
  • I think you meant NSPhotoLibraryUsageDescription instead of NSMicrophoneUsageDescription. I've just tried adding that, but I'd like to know how/when to trigger the message that shows those descriptions. In my opinion, they should be triggered when the Upload image button is touched, but if SFSafariViewController does not provide a delegate for that action I cannot present the message at the right time. – André Lourenço Apr 01 '20 at 02:21
  • would this link help by any chance? https://stackoverflow.com/questions/33930409/ios-9-xcode-7-sfsafariviewcontroller-image-upload-camera-black-screen – Texv Apr 01 '20 at 02:30
  • I had seen that question, but it sounds like a different problem since the camera/library works fine in my case. The only problem I'm facing is the App Review. – André Lourenço Apr 01 '20 at 04:06