定位权限,“使用App期间”和“始终”有什么区别,请使用中文回答
Asked on 03/06/2025
1 search
在WWDC 2024的“What's new in location authorization”会议中,苹果介绍了定位权限的不同选项,包括“使用App期间”和“始终”两种授权方式。
-
“使用App期间”(When in Use):这种授权方式允许应用在用户正在使用应用时访问位置信息。当应用进入后台或用户不再使用应用时,应用将无法继续访问位置信息。这种方式适用于用户只希望在特定情况下(如导航或查找附近的服务)共享位置信息的场景。
-
“始终”(Always):这种授权方式允许应用在后台持续访问位置信息,即使用户没有主动使用应用。这对于需要持续跟踪用户位置的应用(如健身追踪应用)非常有用。然而,苹果强调,从今年开始,“始终”授权只有在应用处于前台时才能生效,并且需要显式地创建CL服务会话。
如果你想了解更多关于定位授权的细节,可以查看What's new in location authorization (01:52)的章节。

What’s new in location authorization
Location authorization is turning 2.0. Learn about new recommendations and techniques to get the authorization you need, and a new system of diagnostics that can let you know when an authorization goal can’t be met.

Build a spatial drawing app with RealityKit
Harness the power of RealityKit through the process of building a spatial drawing app. As you create an eye-catching spatial experience that integrates RealityKit with ARKit and SwiftUI, you’ll explore how resources work in RealityKit and how to use features like low-level mesh and texture APIs to achieve fast updates of the users’ brush strokes.

What’s new in privacy
At Apple, we believe privacy is a fundamental human right. Learn about new and improved permission flows and other features that manage data in a privacy-preserving way, so that you can focus on creating great app experiences.