OGeek|极客世界-中国程序员成长平台

标题: ios - 可以同时请求权限吗? [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-13 13:56
标题: ios - 可以同时请求权限吗?

在我的应用程序上,我们拥有一些应用程序运行所绝对需要的权限,对于这些权限,我们设置了界面,向用户解释为什么需要它们,然后要求用户授予权限。

但是,请求某些权限(例如“照片”和“相机”)似乎有点多余。是否可以(in iOS 8+)同时请求这两个权限?我不记得曾经授予应用程序访问我的照片库 AND 相机的权限,但我的应用程序似乎需要它。

目前我正在背靠背地请求权限,但是多个弹出框比任何东西都更烦人,尤其是在感觉不必要的时候。



Best Answer-推荐答案


虽然相机和照片似乎应该作为一个权限混为一谈,但它们都使用两个不同的框架(AVCaptureDevice 和 PHPhotoLibrary),因此有两个单独的授权要求(即使您使用的是 UIImagePickerController)。

我建议您尝试利用这个机会,使其更像是一种请求授权并向您的用户解释其必要性的体验。

有很多文章 (here's one),有些设计师在工作,至少是我的工作,当您花一些时间向用户解释为什么需要访问权限时,他们会赞叹如何获得更高的接受率。

还有 Apple Human Interface Guidelines有一个关于访问用户数据以及如何处理它的页面

Make sure users understand why they’re being asked to share their personal data. It’s natural for people to be suspicious of a request for their personal information if they don’t see an obvious need for it. To avoid making users uncomfortable, make sure the alert appears only when they attempt to use a feature that clearly needs to know their information. For example, people can use Maps when Location Services is off, but they see an alert when they access the feature that finds and tracks their current location.

Describe why your app needs the information, if it’s not obvious. You can provide text that appears in the alert, below a system-provided title such as ““App Name” Would Like to Access Your Contacts” or for location notifications, “Allow “App Name” to Use Your Location While You Use the App?”. You want this text to be specific and polite so that people understand why you’re asking for access to their information and don’t feel pressured.

关于ios - 可以同时请求权限吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35051797/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (https://ogeek.cn/) Powered by Discuz! X3.4