Provide a purpose string
通俗解读
使用受保护资源时,必须提供有效的用途说明字符串,说明应用需要访问的原因;系统会在应用首次尝试访问时向用户弹出请求。
- 系统会生成包含应用名称的提示标题;你需要提供用途说明字符串,最好是一句准确、简洁、完整的句子。
- 如果获得许可,系统会记住该许可,不再重复提示;如果被拒绝,此次及之后的访问尝试都会以特定于该资源的方式失败。
- 对于位置数据,用户可以选择“仅允许一次”,仅在一个会话内授予访问权限。
- 没有有效的用途说明字符串,访问尝试会失败,并可能导致应用崩溃;Xcode 会检测到此类崩溃并报告问题。
- 在 Xcode 的 Signing and Capabilities 编辑器中添加该字符串;Xcode 会将其作为构建设置存储,对应一个 Information Property List 键。
- 如果应用支持多个语言区域,还应使用 InfoPlist.xcstrings 字符串目录为每个语言区域本地化用途说明字符串。
官方原文摘录
The first time your app attempts to access a protected resource, the system prompts the person using the app for permission. In the following example, an iOS app called FoodDeliveryApp, which provides a food delivery service, generates a prompt requesting access to the person’s location: If the person grants …
阅读官方全文 ↗ 在 StoreRules 规则库中打开 询问你的应用是否合规
开发者关于此条款的案例
暂无案例。