Hello all,
I have a food delivery app that I am beginning to implement CarPlay support in. Route picking, navigation, turn-by-turn guidance features all work perfectly on iPhone, and on CarPlay while the iPhone is unlocked, or locked but screen on.
However, when the iPhone is locked and the screen is off, the CarPlay map view stops following the user's location and appears to be frozen. When this happens, the other "map buttons" that are part of the CPMapTemplate continue to accept user input (I can enter and exit the map panning mode for example), the user's location continues to update, and the turn-by-turn guidance continues as normal. It appears to be just the map view (which is drawn on the window and is not part of the CPMapTemplate) that stops updating in this state.
I've been through every page of Apple documentation on CarPlay but nothing references or addresses how to keep the CarPlay session active while the iPhone is locked. I'm not sure where else to look for answers and I'm out of theories as to why this might happen.
Any guidance around this would be greatly appreciated.
Maps & Location
RSS for tagLearn how to integrate MapKit and Core Location to unlock the power of location-based features in your app.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
We are currently testing the implementation of our Location Push Service Extension (LPSE) in both Ad Hoc and Release environments. We have encountered an issue where LPSE notifications, which were previously working correctly, suddenly fail to be delivered on some devices. After a period of several hours, the notifications resume arriving, but the issue remains intermittent. Notably, during these periods of suspected delivery restriction, regular push notifications (e.g., those using apns-push-type: alert) are delivered and displayed without any problem.
[Detailed Situation]
Test Environment and Scope
We are testing LPSE after obtaining the necessary entitlements, in both Ad Hoc and Release environments.
The issue is not observed on all test devices; only certain devices are affected.
Observed Behavior
Under normal circumstances, LPSE notifications are received and the extension is activated; however, on some devices the notifications suddenly stop arriving.
During these periods, even when sending notifications with apns-push-type: location directly via the CloudKit Push Notification Console, no response is observed on the affected devices.
The APNs server (api.push.apple.com) always returns a 200 OK response via HTTP/2, and our server-side logs and configurations (DNS resolution performed on every request, using the same JWT token for 59 minutes per session, communication via HTTP/2 with ALPN Protocol: h2) show no issues.
Other app functionalities (network communication, UI responsiveness, etc.) work normally.
Sending content
When sending notifications from our server to APNs (api.push.apple.com), we use the following configuration (over HTTP/2):
const payload = {
aps: { 'content-available': 1 }
};
const headers = {
':method': 'POST',
':path': /3/device/${apnsToken},
'Authorization': bearer ${jwtToken},
'apns-topic': 'ot.Here.location-query',
'apns-priority': '10',
'apns-push-type': 'location',
'Content-Type': 'application/json'
};
We perform DNS resolution for every request, use the same JWT token for a 59-minute period per session, and communicate via HTTP/2 with ALPN Protocol: h2.
Hypothesis on the Cause
We suspect that due to an implementation issue, silent push notifications (using content-available: 1) were being sent every few minutes concurrently, which may have triggered an APNs delivery restriction (rate limiting).
As a countermeasure, we have completely stopped sending silent pushes and any other background notifications aside from LPSE; however, the issue persists.
Additionally, even after resetting affected devices, the delivery problem continues to occur.
[Questions for Diagnosis]
Given the above situation, is it reasonable to suspect that excessive silent push notifications have triggered an APNs delivery restriction?
Does such a silent push restriction affect LPSE notifications (i.e., those sent with apns-push-type: location)?
Do APNs delivery restrictions persist even after a device has been reset?
Can a high volume of LPSE notifications alone (without silent pushes) also trigger a delivery restriction?
→ This is our primary concern since it poses a significant implementation challenge.
Please let us know if any additional information is required for diagnosis.
I'm calling .startUpdatingLocation() from the background to detect user's location but the updates stop shortly after they start.
The issue seem to also be discussed here:
https://developer.apple.com/forums/thread/726945
I wonder if any solution has been found?
This is a critical feature for our app.
I have:
kCLLocationAccuracyBestForNavigation
allowsBackgroundLocationUpdates = true
pausesLocationUpdatesAutomatically = false
Location Updates in background modes
distanceFilter not set or kCLDistanceFilterNone
It seems like find my mac is able to fetch the device location even if the device is in locked state. Why can’t other apps do the same.
There is no official documentation specifying the exact criteria for determining a CLVisit.
For example, if a user starts at a target location, will the following method be called?
func locationManager(_ manager: CLLocationManager, didVisit visit: CLVisit)
This did not work during my testing.
It was only successfully triggered when starting from a distant location and arriving at the target point.
It would be helpful to know the exact conditions, such as how long a user must stay at a location for it to be considered a visit. Are there any specific thresholds (e.g., minimum duration, distance moved) that determine when this method is triggered?
Topic:
App & System Services
SubTopic:
Maps & Location
Currently (at least for a few days, maybe longer), when trying to create an Apple Maps Web Snapshot according to https://developer.apple.com/documentation/snapshots/generating_a_url_and_signature_to_create_a_maps_web_snapshot with a custom image marker (passed as Base64 PNG), the Apple server responds with a 500 Internal Server Error. Using the default balloon marker works, but a custom Base64 image marker used to work in the past (and still should according to the documentation).
Apple Feedback Ticket: FB16804936
Background
We develop a parental control application called Adora Kids (https://apps.apple.com/us/app/adora-kids/id6443787669) that requires "Location Always" permission to function properly. Our app has Screen Time authorization and provides monitoring services for parents.
Issue
We are experiencing a recurring problem where child users receive the system notification "Adora accessed your location in the background" every few days. This frequently results in children disabling location permissions, which prevents our app from functioning as intended.
Current Approach and Limitations
We have explored using Content & Privacy Restrictions for Location Services as a potential solution, but have encountered two significant limitations:
These restrictions cannot be accessed programmatically via the ManagedSettings framework (unlike AppStoreSettings and other restrictions).
The current implementation is "all-or-nothing" - enabling location restrictions blocks permission changes for ALL apps on the device, preventing children from granting legitimate location access to other applications.
Questions
Is there a way to programmatically access and manage Content & Privacy Restrictions for Location Services through the ManagedSettings framework that we might have overlooked?
Are there any recommended approaches for apps with Screen Time authorization to prevent users from changing specific permissions (particularly location) while still allowing them to manage permissions for other apps?
Does Apple have plans to implement app-specific permission locking for apps with Screen Time authorization in future iOS releases?
Are there any alternative approaches or workarounds that other developers have successfully implemented for this use case?
Any guidance from the developer community or Apple engineers would be greatly appreciated. This is a critical functionality issue affecting the reliability of our parental control service.
Thank you in advance for your assistance.
Topic:
App & System Services
SubTopic:
Maps & Location
Tags:
Core Location
Family Controls
Managed Settings
I am able to fetch the location in foreground and background.
I need just confirmation that can we get location apps killed state.
If It's possible then how can I do that.
I am able to get location in for ground and back ground but
Now I need to get location when user killed app.
Topic:
App & System Services
SubTopic:
Maps & Location
Tags:
Watch Connectivity
watchOS
Core Location
Hello developers! I am working with a team of North Carolina State University researchers to create an app or program that can retrieve real-time traffic events, such as hazards, road closures, and road construction alerts, in a similar manner to the Apple Maps app, but with the added functionality of collecting them over a historical period given a start and end date.
I'm looking through the MapKit documentation, but there doesn't appear to be any functions exposing granular traffic data (i.e. road hazards), just travel times and level of congestion. Could anyone point me in the right direction? Is what I'm looking to do even possible using just Apple data?
Topic:
App & System Services
SubTopic:
Maps & Location
Hello everyone,
I need help updating business information on Apple Maps for locations in Ukraine. Unfortunately, the usual methods, like "Report an Issue" in the Maps app or using Apple Business Connect, don’t seem to be working properly for Ukrainian businesses.
Many locations have outdated or missing details, which is frustrating for both business owners and customers. Given the current situation, keeping information accurate is more important than ever.
Has anyone successfully updated business listings in Ukraine recently? If so, could you share the process or any contacts that might help? Any advice would be greatly appreciated!
Thanks in advance!
Topic:
App & System Services
SubTopic:
Maps & Location
Tags:
Apple Business Manager
Maps and Location
Hello,
I’m experiencing an issue with my iOS app that uses CoreBluetooth in combination with beacon monitoring. My app is designed to wake via beacon region monitoring and then start scanning for a specific BLE peripheral (with specific service UUIDs). When the device screen is bright (i.e., the device is unlocked, or locked but the screen is active/bright), everything works perfectly—the connection is established and maintained without any issues in both: foreground and background.
However, when the device is left alone for a while and the lock-screen dims (sleeps), the app continues to run in the background and range the beacon (I can confirm this via realtime console logs), but the connection attempt fails. Here’s what I observe:
The central manager’s delegate method didConnect is called, indicating that the peripheral was connected.
Almost immediately afterward, didDisconnect is triggered with the error message:
"The specified device has disconnected from us.".
The interesting part is (I repeatedly see this error in the console, because the app repeatedly tries to connect to peripheral until a success), when I touch the lockscreen (not unlock, but just touch, which makes the screen to light up brighter), the connection is being established without any further issues!
I have the necessary background modes enabled in the app’s capabilities (e.g., bluetooth-central, location-always-mode, etc..). My expectation was that, thanks to beacon monitoring, the app would be awakened when needed, and scanning/connection would work reliably in the background regardless of whether the device is active or dimmed.
My questions are:
Why might the connection fail with this error when the device is locked/dimmed?
Is this behavior expected due to iOS power management policies even if the app remains active in the background?
Is there a way to ensure a reliable connection in such cases?
Any insights, workarounds, or suggestions would be greatly appreciated. Thank you in advance!
Topic:
App & System Services
SubTopic:
Maps & Location
Tags:
Core Location
Background Tasks
Core Bluetooth
We have a PWA app developed by our company. In order to distribute this app to users' iPhones, we put this PWA app inside an XCode app. That means we put a WebView in XCode to display the PWA URL. Everything works perfect, except for location access.
The PWA app access the device location. When the first time the app acess location, it asks for user consent two times, by PWA app and by the XCode app. This is fine. When the user clicks Allow, the XCode app preserves the user choice and never asks again. However, the PWA app keeps on asking user permission every day. If we close the app open again, it will ask one more time. That means twice daily. But if we close and open the app for a third time, it will not ask. It remembers the user choice only for 24 hours.
If we install the PWA app directly in iPhone (that means if we add the URL as bookmark in home screen), it is asking for location permission only once. However, when we put this app inside an XCode app it is asking every day.
This affects the user experience, and as our users are not tech savvy, causing many issues. Is there a way to force the PWA app inside XCode app to remember the user choice?
Any help is very much appreciated.
Thanks,
After the implementation of liveUpdates(_:) to receive asynchronous sequence of location updates, we are receiving crash reports on a huge number of users.
However we cannot reproduce the crash so any help is much appreciated.
This is the stack trace:
com.apple.main-thread
0 libsystem_kernel.dylib 0xce4 mach_msg2_trap + 8
1 libsystem_kernel.dylib 0x439c mach_msg2_internal + 76
2 libsystem_kernel.dylib 0x42b8 mach_msg_overwrite + 428
3 libsystem_kernel.dylib 0x4100 mach_msg + 24
4 CoreFoundation 0x717b0 __CFRunLoopServiceMachPort + 160
5 CoreFoundation 0x70e90 __CFRunLoopRun + 1208
6 CoreFoundation 0x957f0 CFRunLoopRunSpecific + 572
7 GraphicsServices 0x1190 GSEventRunModal + 168
8 UIKitCore 0x3ca158 -[UIApplication _run] + 816
9 UIKitCore 0x3c8388 UIApplicationMain + 336
10 atto 0x6a41a0 main + 25 (AppDelegate.swift:25)
11 ??? 0x1ac153a58 (Missing)
com.apple.uikit.eventfetch-thread
0 libsystem_kernel.dylib 0xce4 mach_msg2_trap + 8
1 libsystem_kernel.dylib 0x439c mach_msg2_internal + 76
2 libsystem_kernel.dylib 0x42b8 mach_msg_overwrite + 428
3 libsystem_kernel.dylib 0x4100 mach_msg + 24
4 CoreFoundation 0x717b0 __CFRunLoopServiceMachPort + 160
5 CoreFoundation 0x70e90 __CFRunLoopRun + 1208
6 CoreFoundation 0x957f0 CFRunLoopRunSpecific + 572
7 Foundation 0x74728 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 212
8 Foundation 0x73558 -[NSRunLoop(NSRunLoop) runUntilDate:] + 64
9 UIKitCore 0x4bd354 -[UIEventFetcher threadMain] + 424
10 Foundation 0x115f40 NSThread__start + 732
11 libsystem_pthread.dylib 0x1afc _pthread_start + 136
12 libsystem_pthread.dylib 0x1a04 thread_start + 8
com.google.firebase.crashlytics.MachExceptionServer
0 FirebaseCrashlytics 0x21c10 FIRCLSProcessRecordAllThreads + 184
1 FirebaseCrashlytics 0x21ff0 FIRCLSProcessRecordAllThreads + 1176
2 FirebaseCrashlytics 0x18e74 FIRCLSHandler + 48
3 FirebaseCrashlytics 0x1b804 FIRCLSMachExceptionServer + 688
4 libsystem_pthread.dylib 0x1afc _pthread_start + 136
5 libsystem_pthread.dylib 0x1a04 thread_start + 8
com.apple.NSURLConnectionLoader
0 libsystem_kernel.dylib 0xce4 mach_msg2_trap + 8
1 libsystem_kernel.dylib 0x439c mach_msg2_internal + 76
2 libsystem_kernel.dylib 0x42b8 mach_msg_overwrite + 428
3 libsystem_kernel.dylib 0x4100 mach_msg + 24
4 CoreFoundation 0x717b0 __CFRunLoopServiceMachPort + 160
5 CoreFoundation 0x70e90 __CFRunLoopRun + 1208
6 CoreFoundation 0x957f0 CFRunLoopRunSpecific + 572
7 CFNetwork 0xeba68 +[__CFN_CoreSchedulingSetRunnable _run:] + 416
8 Foundation 0x115f40 NSThread__start + 732
9 libsystem_pthread.dylib 0x1afc _pthread_start + 136
10 libsystem_pthread.dylib 0x1a04 thread_start + 8
Thread
0 libsystem_kernel.dylib 0xa90 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x46ac _pthread_wqthread + 368
2 libsystem_pthread.dylib 0x19f8 start_wqthread + 8
Crashed: com.apple.corelocation.shared
0 libobjc.A.dylib 0x2050 objc_release_x8 + 16
1 libsystem_blocks.dylib 0x1d30 bool HelperBase::disposeCapture<(HelperBase::BlockCaptureKind)3>(unsigned int, unsigned char*) + 68
2 libsystem_blocks.dylib 0x16a8 HelperBase::destroyBlock(Block_layout*, bool, unsigned char*) + 116
3 libsystem_blocks.dylib 0x1180 _call_dispose_helpers_excp + 72
4 libsystem_blocks.dylib 0x111c _Block_release + 236
5 libsystem_blocks.dylib 0xff4 bool HelperBase::disposeCapture<(HelperBase::BlockCaptureKind)4>(unsigned int, unsigned char*) + 68
6 libsystem_blocks.dylib 0x16f8 HelperBase::destroyBlock(Block_layout*, bool, unsigned char*) + 196
7 libsystem_blocks.dylib 0x1180 _call_dispose_helpers_excp + 72
8 libsystem_blocks.dylib 0x111c _Block_release + 236
9 libdispatch.dylib 0x1b4f8 _dispatch_client_callout + 16
10 libdispatch.dylib 0xa2cc _dispatch_lane_serial_drain + 736
11 libdispatch.dylib 0xad90 _dispatch_lane_invoke + 380
12 libdispatch.dylib 0x15178 _dispatch_root_queue_drain_deferred_wlh + 292
13 libdispatch.dylib 0x149fc _dispatch_workloop_worker_thread + 540
14 libsystem_pthread.dylib 0x4660 _pthread_wqthread + 292
15 libsystem_pthread.dylib 0x19f8 start_wqthread + 8
Thread
0 libsystem_pthread.dylib 0x19f0 start_wqthread + 142
Thread
0 libsystem_pthread.dylib 0x19f0 start_wqthread + 142
Thread
0 libsystem_pthread.dylib 0x19f0 start_wqthread + 142
Hello,
Probably a noob question but I can't find any example code around this use case, and really no past questions I could find that address it either.
So, I really love that, when a user taps a POI on the map in my app, the map figures out the right POI every time. Flawless. However, when using .mapFeatureSelectionAccessory, I've tried probably 10-12 iterations, and there doesn't seem to be any way to either:
a) add custom content to the place card that's shown, or
b) replace that place card altogether with a view of my own, or
c) capture the place data but use it in a custom view
I want to be able to leverage the accuracy of Apple's tap gesture detection, but show, for example, only the name of the place, along with buttons and a form I have in a view.
Right now if I'm using .mapFeatureSelectionAccessory, I can't seem to bypass the place card at all.
Hello,
I write a Bachelor-Theses about Geolocation on an iPhone. I have a Signal-generator from R&S to simulate GPS-Data. I write an App on an Android-Phone and can readout the GPS-ID and the strength from the signal and the time and Position for Geolocation zb. Island or Africa like this.
Now my thesis is about the iPhone and I write an App for get the location manager Geolocation and to save it to a sqlite-database with longitude, latitude and time.
But the App recognizes only the real world for geolocation on GPS (LTE and Wlan are disabled!). With my Radio-Generator it would not recognize any Geolocation like the Android phone.?
So I need some fast help for my thesis, where are my problems?
I allready have a function like this:
func updateAccuracy(highAccuracy: Bool) {
locationManager.desiredAccuracy = highAccuracy ? kCLLocationAccuracyBestForNavigation : kCLLocationAccuracyHundredMeters
print("🎯 GPS-Genauigkeit geändert: (highAccuracy ? "Hoch" : "Plane-Genauigkeit")")
}
but nothing happens?
Best regards
Topic:
App & System Services
SubTopic:
Maps & Location
I want a solution to keep tracking the user once he started in driving state until parking.
I tried many solutions like use significant location changes, and silent push notifications and background tasks, but no one of them worked as expected.
I need when user started in driving the app be active until the user parked his car.
I'm using CoreMotion and CoreLocation.
The challenge is when the app is not active like killed or suspended.
So, how to do this? is this possible or not?
I recently converted over my map from Mapbox Maps to MapKit Map. I have been able to add my polygons on the Map using MapPolygon. The issue I am having is being able to select the Polygon to be able to view information about the polygon.
Has anyone been able to figure out a way to tap on the Polygon? I have tried selection but the Polygon doesn't recognize the tap. I would really appreciate it if anyone could point me in the right direction of how I can accomplish this.
First of all, my English skills are not good, so I wrote an AI program and sent it to complete the questions. sorry.
I'm developing a safety monitoring application that requires continuous BLE scanning for temperature and humidity sensors. I need clarification on the technical feasibility of background and sleep mode operation.
Key Requirements:
Continuous monitoring of BLE advertisements from temperature/humidity sensors
Must detect critical temperature/humidity changes immediately
Data logging every minute
Includes navigation features showing routes
Technical Questions:
Background Mode Operation
If using background modes (bluetooth-central + location):
Can we receive BLE advertisements reliably?
What is the actual scanning interval limitation?
Will CBCentralManagerScanOptionAllowDuplicatesKey limitation affect critical monitoring?
Sleep Mode Operation
Can the app maintain BLE scanning during device sleep?
Would combining with navigation background mode help?
Are there any recommended approaches for continuous monitoring?
Sample Code of Current Approach:
let options: [String: Any] = [
CBCentralManagerOptionShowPowerAlertKey: true,
CBCentralManagerOptionRestoreIdentifierKey: "uniqueIdentifier"
]
centralManager = CBCentralManager(delegate: self, queue: nil, options: options)
// Scanning setup
centralManager.scanForPeripherals(
withServices: [serviceUUID],
options: [CBCentralManagerScanOptionAllowDuplicatesKey: true]
)
Has anyone successfully implemented continuous BLE monitoring in background/sleep modes? Are there any special entitlements or techniques that could help achieve this?
This is for a safety-critical application where missing sensor data could lead to serious issues.
Any guidance would be greatly appreciated.
Hello everyone,
I'm encountering a strange location authorization issue in the iOS simulator, and I'm hoping someone can help me analyze it.
Problem Description:
When my app runs for the first time in the simulator, it requests location permissions.
I select "Deny" for the authorization.
Then, I go to the simulator's "Settings" -> "Privacy & Security" -> "Location Services" and enable location permissions for my app.
However, when I return to the app, CLLocationManager.authorizationStatus still returns .notDetermined, and the authorization request pop-up does not appear again.
This issue persists even after resetting the simulator settings multiple times.
import CoreLocation
@Observable
final class LocationManager: NSObject, CLLocationManagerDelegate {
var locationManager = CLLocationManager()
var currentLocation: CLLocationCoordinate2D?
override init() {
super.init()
locationManager.delegate = self
}
func locationManagerDidChangeAuthorization(_ manager: CLLocationManager) {
let status = manager.authorizationStatus
print("Authorize Status: \(status)")
switch status {
case .authorizedWhenInUse, .authorizedAlways:
locationManager.startUpdatingLocation()
case .denied, .restricted:
stopLocation()
case .notDetermined:
locationManager.requestWhenInUseAuthorization()
print("Location permission not determined.")
@unknown default:
break
}
}
func requestLocation() {
let status = locationManager.authorizationStatus
if status == .authorizedWhenInUse || status == .authorizedAlways {
locationManager.requestLocation()
} else {
locationManager.requestWhenInUseAuthorization()
}
}
func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {
guard let newLocation = locations.first else { return }
currentLocation = newLocation.coordinate
print("Updated location: \(newLocation.coordinate)")
}
func locationManager(_ manager: CLLocationManager, didFailWithError error: Error) {
print("Location update failed with error: \(error.localizedDescription)")
currentLocation = nil
}
func stopLocation() {
locationManager.stopUpdatingLocation()
print("Stopped updating location")
}
}
Topic:
App & System Services
SubTopic:
Maps & Location
Tags:
Core Location
Maps and Location
Simulator