我是否需要在 Info.plist 中提供联系人使用说明,以便在 Swift 中使用 UIApplication.shared.open 和 URL 方案进行电话呼叫 tel://?

Do I need to provide contact usage description in Info.plist for making a phone call using UIApplication.shared.open with tel:// URL scheme in Swift?

提问人:Arish 提问时间:7/5/2023 最后编辑:HangarRashArish 更新时间:7/6/2023 访问量:119

问:

我正在使用以下代码在我的 Swift iOS 应用程序中拨打电话:

if let phoneNumber = URL(string: "tel://8001968001") {
    UIApplication.shared.open(phoneNumber)
}

我想知道是否需要在 Info.plist 文件中为此功能提供联系人用法说明。我知道访问用户的联系人或通讯簿需要使用说明,但在这种情况下,我只使用 URL 方案发起电话呼叫。tel://

我已经在 Info.plist 文件中提供了必要的 NSAppTransportSecurity 设置,以允许对 URL 方案进行任意加载。但是,我不确定是否仍然需要联系人使用说明。有人可以澄清在这种情况下是否需要联系人使用说明吗?

iOS URL 方案

评论


答:

0赞 Goldy Brar Gangster 7/5/2023 #1

无需在 Info.plist 文件中提供联系人用法说明。仅当应用尝试访问用户的联系人或通讯簿时,才需要联系人使用情况说明。

Apple 文档明确指出,联系人使用说明不是必需的

tel:// 

URL 方案。

  1. Apple 开发者文稿 - 隐私:https://developer.apple.com/documentation/uikit/protecting_the_user_s_privacy
  2. Apple 开发人员文档 - 请求访问数据的权限:https://developer.apple.com/documentation/uikit/protecting_the_user_s_privacy/requesting_access_to_protected_resources