是否可以在 Swift 中使用 CLLocationManager 获取定位服务的 "Significant Locations"?
Is it possible to get Location Service's "Significant Locations" using CLLocationManager in Swift?
我正在寻找对用户来说已经很重要的位置,而不必重建他们经常去的位置的列表。我注意到在 phone 的设置中
中有 "Significant Locations"
Settings > Privacy > Location Services > System Services > Significant
Locations
我不确定是否可以使用 Swift 访问它。是否可以在我的应用程序中使用这些位置?
不,无法获取用户在安装您的应用程序之前去过的地方。您只能在安装您的应用程序后获取用户去过的位置。为此,通过调用 -startMonitoringVisits
并等待用户在某处停止,使用 CLLocationManager
和 "Visits"。您需要获得用户的明确授权才能接收访问信息。
文档:Using the Visits Location Service
注意:设置应用中的"Significant Locations"不同于Core Location的重要位置变化监控
我正在寻找对用户来说已经很重要的位置,而不必重建他们经常去的位置的列表。我注意到在 phone 的设置中
中有 "Significant Locations"Settings > Privacy > Location Services > System Services > Significant Locations
我不确定是否可以使用 Swift 访问它。是否可以在我的应用程序中使用这些位置?
不,无法获取用户在安装您的应用程序之前去过的地方。您只能在安装您的应用程序后获取用户去过的位置。为此,通过调用 -startMonitoringVisits
并等待用户在某处停止,使用 CLLocationManager
和 "Visits"。您需要获得用户的明确授权才能接收访问信息。
文档:Using the Visits Location Service
注意:设置应用中的"Significant Locations"不同于Core Location的重要位置变化监控