请求iOS 10中相机和库的权限 - Info.plist [英] Request Permission for Camera and Library in iOS 10 - Info.plist

查看:273
本文介绍了请求iOS 10中相机和库的权限 - Info.plist的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在应用中实现了WKWebView。
在显示的网页中有一个文件输入,它应该从照片中导入图像。
每当我按下该输入并选择拍照或照片库时,该应用程序突然崩溃,我认为这是因为该应用程序缺少拍摄照片或从库中导入的权限。

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)?

我使用Swift 3.0和WKWebView。

I use Swift 3.0 with WKWebView.

推荐答案

您必须在Info.plist中添加以下权限。

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

相机:

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

照片:

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

这篇关于请求iOS 10中相机和库的权限 - Info.plist的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆