iOS 应用权限的完整列表

Complete list of iOS app permissions

不同的网站(e.g.)解释说iOS权限模型是这样工作的:所有应用程序都有一组基本权限(包括互联网访问)。如果在运行时需要额外的权限,系统会询问用户是授予还是拒绝。

iOS知道哪些权限?什么属于基本权限集?未经用户同意可以做什么?基本上我正在寻找 list similar to this one,只是为了 iOS

您可以添加到 info.plist 文件的所有密钥都在 Apple documentation 中列出并进行了说明。

对于大多数后台模式,您需要在 Info.plist 中添加一个键,以指示该应用程序想要 运行 在后台进行编码。

但此信息不用于请求用户许可,仅用于确保设备兼容性。

只有一些服务需要用户许可(如地理定位和通知服务),当您的应用程序第一次尝试使用相应的 API.

时,系统会自动向用户询问这些服务

您可以执行沙盒中的任何操作。因此,默认情况下允许访问互联网和存储文件,但不允许尝试与其他应用对话,例如阅读相机胶卷或显示推送通知。

好像没有正式的名单。

到目前为止我找到了这些权限,其中加粗的是基本权限:

  • 上网
  • 访问地理定位
  • 使用通知服务(收到 and/or 显示?)
  • 与其他应用对话
  • 访问相机
  • 访问微phone
  • 正在访问 phone 联系人列表
  • 访问日历
  • 访问照片
  • 安排提醒

与其他答案相比,有一个在运行时询问的官方权限列表。它位于 iOS Security Guide(第 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 10 起,需要为请求的权限提供描述。在框架的开发人员文档中,您将看到是否需要这样的描述,访问它的 API 将导致权限提示(如果没有给出描述则崩溃),例如请参阅 developer documentation of the Contacts framework:

中的提示

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 include NSContactsUsageDescription.

此外,每个 iOS/macOS 版本的可用权限的一个很好的来源是 Information Property List Key Reference(搜索单词中包含的 UsageDescription)。

至少有一项其他未记录的权限需要用户在运行时同意: