Alamri Alamri - 2 months ago 192
Swift Question

Request Permission for Camera and Library in iOS 10 - Info.plist

I have implemented a WKWebView in an app.
there's a file input in the shown web page where it should import an image from photos.
Whenever i press on that input and select either "Take Photo" or "Photo Library" the app suddenly crash, which I believe is because the app is missing the permission to either take a photo or import from library.

How do I push a permission request when the user select one of the mentioned methods (Take Photo or Photo Library)?

I use Swift 3.0 with WKWebView.

Answer

You have to add the below permission in Info.plist. Permission in Info.plist

Camera :

Key       :  Privacy - Camera Usage Description   
Value     :  $(PRODUCT_NAME) camera use

Photo :

Key       :  Privacy - Photo Library Usage Description    
Value     :  $(PRODUCT_NAME) photo use