iOS 应用权限的完整列表
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/29894749/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Complete list of iOS app permissions
提问by Hyman Miller
Different web sites (e.g.) explain that the iOS permission model works like this: All apps have a set of basic permissions (including Internet access). If an additional permission is required during runtime the user is asked whether to grant or deny it.
不同的网站(例如)解释说,iOS 权限模型是这样工作的:所有应用程序都有一组基本权限(包括 Internet 访问权限)。如果在运行时需要额外的权限,则询问用户是授予还是拒绝。
Which permissions does iOS know? What belongs to the basic permissions set? What can be done without user consent? Basically I am looking for a list similar to this one, just for iOS
iOS 知道哪些权限?什么属于基本权限集?没有用户同意可以做什么?基本上我正在寻找一个类似于这个的列表,仅适用于 iOS
回答by Max
In contrast to other answers, there is an official list of permissions that are asked at runtime. It is in the iOS Security Guide(p. 84):
与其他答案相反,有一个在运行时询问的官方权限列表。它在iOS 安全指南(第 84 页)中:
iOS helps prevent apps from accessing a user's personal information without permission. Additionally, in Settings, users can see which apps they have permitted to access certain information, as well as grant or revoke any future access. This includes access to:
- Contacts
- Calendars
- Reminders
- Photos
- Motion activity and fitness
- Location Services
- Apple Music
- Your music and video activity
- Microphone
- Camera
- HomeKit
- Health
- Speech recognition
- Bluetooth sharing
- Your media library
If the user signs in to iCloud, apps are granted access by default to iCloud Drive. Users may control each app's access under iCloud in Settings. Additionally, iOS provides restrictions that prevent data movement between apps and accounts installed by an MDM solution and those installed by the user.
iOS 有助于防止应用程序在未经许可的情况下访问用户的个人信息。此外,在“设置”中,用户可以查看他们允许哪些应用访问某些信息,以及授予或撤销任何未来的访问权限。这包括访问:
- 联系人
- 日历
- 提醒事项
- 相片
- 运动活动和健身
- 位置服务
- 苹果音乐
- 您的音乐和视频活动
- 麦克风
- 相机
- 家庭套件
- 健康
- 语音识别
- 蓝牙共享
- 您的媒体库
如果用户登录 iCloud,默认情况下会授予应用访问 iCloud Drive 的权限。用户可以在“设置”中的 iCloud 下控制每个应用程序的访问权限。此外,iOS 提供了一些限制,以防止在 MDM 解决方案安装的应用程序和帐户与用户安装的应用程序和帐户之间移动数据。
Since iOS 10 it is required to provide a description for the requested permission. In the developer documentation of the frameworks you will see if such a description is required and accessing it's API will lead to an permission prompt (or crash if not description is given), e.g. see the hint in the developer documentation of the Contacts
framework:
从 iOS 10 开始,需要提供所请求权限的描述。在框架的开发人员文档中,您将看到是否需要这样的描述,访问它的 API 将导致权限提示(如果没有给出描述,则会导致崩溃),例如,请参阅框架的开发人员文档中的Contacts
提示:
Important
An iOS app linked on or after iOS 10.0 must include in its
Info.plist
file the usage description keys for the types of data it needs to access or it will crash. To access Contacts data specifically, it must includeNSContactsUsageDescription
.
重要的
在 iOS 10.0 上或之后链接的 iOS 应用程序必须在其
Info.plist
文件中包含它需要访问的数据类型的使用说明键,否则会崩溃。要专门访问联系人数据,它必须包含NSContactsUsageDescription
.
Additionally, a good source of available permissions for each iOS/macOS version is in the Information Property List Key Reference(search for UsageDescription
contained in words).
此外,每个 iOS/macOS 版本的可用权限的一个很好的来源是信息属性列表键参考(搜索UsageDescription
包含在单词中)。
回答by BoilingLime
All the keys you can add to your info.plist
file are listed in Apple documentationand described.
您可以添加到info.plist
文件中的所有密钥都在Apple 文档中列出并进行了描述。
For most background modes you need to add a key in Info.plist to indicate that the app wants to run code while in the background.
对于大多数后台模式,您需要在 Info.plist 中添加一个键来指示应用程序希望在后台运行代码。
But this information is not used to ask user permission, only for ensuring device compatibility.
但此信息并非用于征得用户许可,仅用于确保设备兼容性。
Only some services require user permission (like Geolocation and Notifications services), which are automatically asked to the user the very first time your application attempt to use the corresponding API.
只有某些服务需要用户许可(例如地理位置和通知服务),这些服务会在您的应用程序首次尝试使用相应的 API 时自动询问用户。
回答by Hyman Miller
It seems that there is no official list available.
好像没有官方的名单。
So far I found these permissions, where the bold ones are basic permissions:
到目前为止,我找到了这些权限,其中粗体是基本权限:
- Internet access
- accessing Geolocation
- using notifications services (receiving and/or showing?)
- talking to other apps
- accessing camera
- accessing microphone
- accessing phone contact list
- accessing calendars
- accessing photos
- scheduling reminders
- 互联网
- 访问地理位置
- 使用通知服务(接收和/或显示?)
- 与其他应用程序交谈
- 访问相机
- 访问麦克风
- 访问电话联系人列表
- 访问日历
- 访问照片
- 安排提醒
回答by James Campbell
Anything that is within your sandbox you can do. So internet access and storing files are allowed by default but trying to talk to another app for example reading the camera roll or showing push notifications are not.
沙箱内的任何事情都可以做。因此,默认情况下允许访问互联网和存储文件,但尝试与另一个应用程序交谈,例如阅读相机胶卷或显示推送通知,则不允许。