Android 类似 iOS 中的权限

发布于 2024-11-04 02:54:58 字数 139 浏览 2 评论 0原文

在android中,您可以在清单文件中定义gps、短信发送、位置等权限。 iOS 中是否有类似的功能,让用户在安装之前就知道某个应用程序使用了手机的哪些功能? 或者,当某些功能想要使用某些功能(例如 GPS、短信...)时,用户在应用程序使用过程中是否会收到警告?

In android, you define permissions for gps, sms sending, location , .., in the manifest file.
Is there anything similar in the iOS, so the user would know what capabilities of the phone some app uses before installation?
Or is the user warned during app use when some function wants to use something (e.g. gps, sms...)?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

子栖 2024-11-11 02:54:58

在 iOS 中,您可以在类似于 Info.plist 的清单中声明您的应用程序要求。但此信息并不用于征求用户许可,仅用于确保设备兼容性。

只有通知和位置服务需要用户许可,当您的应用程序第一次尝试使用相应的 API 时,系统会自动向用户请求该许可。

我的猜测是,许多其他权限已经通过 Apple Store 许可协议授予,用户必须接受这些权限,这与 Android 不同(我猜你可以在不使用市场的情况下安装应用程序,不是吗?这与合法的许可协议有很大不同)观点)

In iOS you declare your application requirements in its manifest-like Info.plist. But this information is not used to ask user permission, only for ensuring device compatibility.

Only Notifications and Location Services require user permission, which is automatically asked to the user the very first time your application attempt to use the corresponding API.

My guess is that many other permissions are already granted via the Apple Store license agreement, that the user must have accepted, unlike Android (I guess you can install an app without using the market isnt? which changes a lot from a legal point of view)

╄→承喏 2024-11-11 02:54:58

iPhone 上没有权限之类的东西。

用户被警告的唯一事情是当应用程序使用其当前位置时 - 然后用户会收到系统警报提示,并且必须明确允许或拒绝应用程序访问位置数据。

关于短信和电子邮件,它们只能通过标准控制器创建和发送,因此用户无论如何都会意识到这一点

There's no such things as permissions on iPhone.

The only thing that user is warned about is when application uses his current location - then user is prompted with system alert and must explicitly allow or deny application's access to location data.

What concerns sms and email, they can be created and sent only via standard controllers so user will be aware of that anyway

起风了 2024-11-11 02:54:58

在 iOS 上,您不必在某个特定文件中声明所有必要的权限。你只需使用它们。例如位置

info.plist

//Privacy - Location When In Use Usage Description
<key>NSLocationUsageDescription</key>
<string>title</string>
//Privacy - Location Always and When In Use Usage Description
<key>NSLocationWhenInUseUsageDescription</key>
<string>description</string>
import CoreLocation

let locationManager = CLLocationManager()
locationManager.delegate = self
locationManager.requestAlwaysAuthorization()

func locationManager(_ manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus) {

}

[IDFA]

on iOS you don't have to declare all necessary permissions in some specific file. You just use them. For example location

info.plist

//Privacy - Location When In Use Usage Description
<key>NSLocationUsageDescription</key>
<string>title</string>
//Privacy - Location Always and When In Use Usage Description
<key>NSLocationWhenInUseUsageDescription</key>
<string>description</string>
import CoreLocation

let locationManager = CLLocationManager()
locationManager.delegate = self
locationManager.requestAlwaysAuthorization()

func locationManager(_ manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus) {

}

[IDFA]

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文