菜鸟教程小白 发表于 2022-12-13 13:56:13

ios - 可以同时请求权限吗?


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

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

<p>目前我正在背靠背地请求权限,但是多个弹出框比任何东西都更烦人,尤其是在感觉不必要的时候。 </p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>虽然相机和照片似乎应该作为一个权限混为一谈,但它们都使用两个不同的框架(AVCaptureDevice 和 PHPhotoLibrary),因此有两个单独的授权要求(即使您使用的是 UIImagePickerController)。</p >

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

<p>有很多文章 (<a href="https://library.launchkit.io/the-right-way-to-ask-users-for-ios-permissions-96fa4eb54f2c#.c7ixtimdm" rel="noreferrer noopener nofollow">here&#39;s one</a>),有些设计师在工作,至少是我的工作,当您花一些时间向用户解释为什么需要访问权限时,他们会赞叹如何获得更高的接受率。 </p>

<p>还有 <a href="https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/LocationServices.html" rel="noreferrer noopener nofollow">Apple Human Interface Guidelines</a>有一个关于访问用户数据以及如何处理它的页面</p>

<blockquote>
<p>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.</p>

<p>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.</p>
</blockquote></p>
                                   
                                                <p style="font-size: 20px;">关于ios - 可以同时请求权限吗?,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/35051797/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/35051797/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - 可以同时请求权限吗?