In the last few months we have seen a lot of the following errors in which it fails to retrieve location information. This seems to happen across multiple browsers and feels related to apple/mac OS more than the browsers.
Error: "CoreLocationProvider: CoreLocation framework reported a kCLErrorLocationUnknown failure."
Any suggestions or an ETA on when this can be fixed? I have seen other threads/posts on this but wanted a new one to highlight the issue is prevalent.
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
Created
Hello,
I'm experiencing an issue with the Apple Maps URL scheme when using raw latitude and longitude coordinates in the daddr parameter.
Until recently, using a URL like this worked reliably:
https://maps.apple.com/?daddr=37.7749,-122.4194
This would open Apple Maps and show directions from the current location to the specified coordinates.
However, on recent iOS versions, this URL no longer behaves as expected.
I am developing an iOS app that uses CLLocationManager to collect location continuously in both foreground and background. But it has the following 4 issues and I don’t understand why:
After a while of not using the app, I can not get location updates regularly. Even after that, I go into the app more often or even turn OFF and turn ON the permission again, but the problem still doesn’t improve until I reinstall the app.
Previously, I used SilentLog SDK to collect location. Since the cost was quite high, we developed our own SDK that also handles location tracking. After updating the app from the old version using SilentLog SDK to the new version using my own SDK, I can not get location updates regularly. However, when I reinstalled the app, it worked perfectly.
It seems that apps downloaded from TestFlight can get location more continuously than apps downloaded from the App Store
We sometimes encounter this error in the logs:
Error Domain=kCLErrorDomain Code=0 “(null)”
I think my app was not terminated in the background because I still collect location but it is not as frequent. I want to know if Apple has any mechanism to prevent such apps from getting location data continuously?
I use CLLocationManager with the following configuration:
self.locationManager.distanceFilter = 20
self.locationManager.desiredAccuracy = kCLLocationAccuracyBest
self.locationManager.allowsBackgroundLocationUpdates = true
self.locationManager.showsBackgroundLocationIndicator = false
self.locationManager.pausesLocationUpdatesAutomatically = false
I also filter the location updates using:
guard let location = locations.last else { return }
guard location.horizontalAccuracy <= 100 else { return }
guard location.speedAccuracy >= 0 else { return }
I use a background task to wake up the device every 15 minutes, and I also use silent push notifications in a similar manner. Each time the task is executed, I usually call stopLocation and then startLocation again. This happens quite frequently — will it have any impact or cause any issues?
I am using CLLocationUpdate.liveUpdates() to build a location sharing app. Most of the time it works fine, including in the background, giving acceptably frequent updates. However, soon after the user puts their phone away for the night, the updates stop coming.
I've checked all the instance properties (.stationary, .locationUnavailable, etc.) but none of them are ever set to true, even for the last update before updates end.
Is there some way to keep the updates coming through the night?
I've included some relevant parts of my code here:
func startLocationUpdates() {
if self.manager.authorizationStatus == .notDetermined {
self.manager.requestWhenInUseAuthorization()
}
Task {
do {
self.background = CLBackgroundActivitySession()
self.session = CLServiceSession(authorization: CLServiceSession.AuthorizationRequirement.always)
let updates = CLLocationUpdate.liveUpdates()
for try await update in updates {
if let loc = update.location {
BackgroundServiceKt.onLocationUpdate(arg: loc)
}
// check all the instance properties
}
} catch {
// error
}
return
}
}
class AppDelegate: NSObject, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
LocationsHandler.shared.startLocationUpdates()
return true
}
}
Summary
The onLongPress callback on MapViewcomponent is not working on iOS devices. The callback is properly implemented but never gets triggered on iOS, while it works as expected on Android.
Reproducible sample code
<MapView
onLongPress={(e) => {
console.log("onLongPress", e);
setAddLocation(e.nativeEvent.coordinate);
}}
// ... other props
Steps to reproduce
Just put onLongPress callback on MapView and notice it won't be triggered.
Expected result
Long press on the map should trigger the onLongPress callback
The callback should receive the event object with coordinates
Actual result
Long press on the map does not trigger the callback on iOS
No console logs are shown when long pressing
The functionality works as expected on Android
React Native Maps Version
1.23.8
What platforms are you seeing the problem on?
iOS (Apple Maps)
React Native Version
0.79.2
What version of Expo are you using?
SDK 53
Device(s)
Any iOS Device
Topic:
App & System Services
SubTopic:
Maps & Location
I’ve just updated to Simulator 16.0 (104.1)
I’m currently developing my first app, which relies heavily on location data. It was simulating correctly before I updated Simulator. Since the update it is no longer receiving location data.
Is anyone else experiencing this problem?
We have background location updates enabled in our app that updates the location on our servers to deliver realtime weather alerts. We see that we are receiving these location updates when the app is backgrounded by the user.
However, when the user removes our app from the background using the App Switcher, we no longer see notifications happening. We have the app delegate's "didFinishLaunchingWithOptions" method setup to check for .location in the launch options, and start location tracking immediately.
Is it the intention of the OS to no longer send our app background location updates if the user manually removes our app from the background?
Topic:
App & System Services
SubTopic:
Maps & Location
Hello,
I’ve done a lot of testing of location services running in background with various settings, but in all scenarios location updates pause after a couple of hours, especially overnight In sleep mode.
My app, for personal safety, requires regular location updates to 5m accuracy every minute. The only solution I have found is to keep the app in foreground.
Location always stops updating. Background mode stops updating. Live location services stops updating.
Is there a solution I may have missed other than keeping app in foreground?
thank you,
Brendan
The https certificate has expired
Is there a way to simulate altitude, longitude and latitude using the API?
For now I only found longitude and latitude to be simulated.
Topic:
App & System Services
SubTopic:
Maps & Location
Hi Apple Dev Team & Community,
We’ve encountered an issue with background location updates when using an XCFramework we’ve built from our main app.
Context:
We have a standalone app called TravelSafely that reliably performs background location updates and alerts, even during sleep mode.
From this app, we extracted some core functionality into an XCFramework, including location management, and provided it as an SDK to a client.
We created a demo app to test this SDK in isolation.
Problem:
In the demo app, we notice that location updates work fine in the foreground.
However, in the background or sleep mode, location updates sometimes stop completely.
When we bring the app to the foreground again, location resumes.
This does not happen in the original standalone app.
What We’ve Already Checked:
UIBackgroundModes includes location
Info.plist has the required permissions
Location is started correctly using startUpdatingLocation
We maintain strong references and use background tasks as needed
Question:
Why would an app using a binary XCFramework (with location logic) behave differently from the original app in terms of background execution?
Is there any known issue or recommendation when working with SDKs/XCFrameworks that need to manage background tasks and location updates?
Any insights or recommendations to maintain proper background behavior would be highly appreciated.
Thank you!
Topic:
App & System Services
SubTopic:
Maps & Location
Tags:
Frameworks
Core Location
Background Tasks
Hi,
Does anyone know how can a company sign up to be a publisher for guides on apple maps? Example - https://maps.apple.com/guides?publisher=17882075820533551969&_provider=9902
I'm having hard time figuring out the process.
Hi,
I'm using MapKit's MKDirections.calculate, calculateETA, and reverse geocoding (via CLGeocoder.reverseGeocodeLocation) in my iOS app.
I understand that there are undocumented rate limits for these services to prevent abuse, but I couldn't find official details.
I would like to know:
Are the rate limits applied per device, per app installation, or are they shared across all users of the same app bundle ID?
Is there any guidance on how to design these features to avoid hitting rate limits in a production environment?
What is the best practice if a user repeatedly triggers routing or reverse geocoding (e.g., typing or moving the map)?
Any clarification or official documentation would be greatly appreciated. Thank you!
I am unable to do the "Test Indoor Positioning" step in the Indoor Survey map. It says "Indoor Positioning Inactive". The support email for the indoor maps team is not functional.
Topic:
App & System Services
SubTopic:
Maps & Location
Hello,
I upgraded my Apple Developer account from free to paid (Individual), but I cannot enable “Background Modes” (specifically “Location updates”) for any of my App IDs—including both old App IDs created while on the free account and brand new App IDs created after upgrading.
When I go to Apple Developer Portal > Identifiers > [select App ID] > Edit, the option for “Background Modes” is missing from the list of capabilities.
This is preventing me from enabling required entitlements for background location in Xcode, and all provisioning profiles fail with errors such as:
Provisioning profile "iOS Team Provisioning Profile: [my bundle id]" doesn't include the com.apple.developer.location.always and com.apple.developer.location.background entitlements.
Steps I’ve Taken:
Upgraded to a paid Apple Developer Program (verified in my account).
Created new App IDs after upgrading—Background Modes is still missing.
Created new Xcode projects with new App IDs and bundle identifiers—same result.
Refreshed provisioning profiles, cleaned Xcode, logged out/in—no change.
Contacted Apple Support; advised to file a Code-Level Support request, but the issue is with the portal/App ID capabilities, not my code.
My Question:
Has anyone experienced this issue where Background Modes capability is missing for all App IDs, even after upgrading to a paid account?
Is there any workaround, or does this require intervention from Apple Developer Support to “unlock” the missing capabilities for my developer account?
Any insight or advice would be appreciated!
Thank you.
In reference to this webpage, I'm turning my iPad to an iBeacon device.
class BeaconViewModel: NSObject, ObservableObject, CBPeripheralManagerDelegate {
private var peripheralManager: CBPeripheralManager?
private var beaconRegion: CLBeaconRegion?
private var beaconIdentityConstraint: CLBeaconIdentityConstraint?
//private var beaconCondition: CLBeaconIdentityCondition?
override init() {
super.init()
if let uuid = UUID(uuidString: "abc") {
beaconIdentityConstraint = CLBeaconIdentityConstraint(uuid: uuid, major: 123, minor: 456)
beaconRegion = CLBeaconRegion(beaconIdentityConstraint: beaconIdentityConstraint!, identifier: "com.example.myDeviceRegion")
peripheralManager = CBPeripheralManager(delegate: self, queue: nil, options: nil)
}
}
func peripheralManagerDidUpdateState(_ peripheral: CBPeripheralManager) {
switch peripheral.state {
case .poweredOn:
startAdvertise()
case .poweredOff:
peripheralManager?.stopAdvertising()
default:
break
}
}
func startAdvertise() {
guard let beaconRegion = beaconRegion else { return }
let peripheralData = beaconRegion.peripheralData(withMeasuredPower: nil)
peripheralManager?.startAdvertising(((peripheralData as NSDictionary) as! [String: Any]))
}
func stopAdvertise() {
peripheralManager?.stopAdvertising()
}
}
In Line 10, I'm using CLBeaconidentityConstraint to constrain the beacon. Xcode says that this class is deprecated and suggests that we use CLBeaconIdentityCondition. But if I try to use it, Xcode says
Cannot find type 'CLBeaconIdentityCondition' in scope
I've just updated Xcode to 16.4. I still get the same error. So how do we use CLBeaconIdentityCondition to constrain the beacon? My macOS version is Sequoia 15.5. Thanks.
The other day I was playing with iBeacon and found out that CLBeaconIdentityConstraint will be deprecated after iOS 18.5. So I've written code with BeaconIdentityCondition in reference to this Apple's sample project.
import Foundation
import CoreLocation
let monitorName = "BeaconMonitor"
@MainActor
public class BeaconViewModel: ObservableObject {
private let manager: CLLocationManager
static let shared = BeaconViewModel()
public var monitor: CLMonitor?
@Published var UIRows: [String: [CLMonitor.Event]] = [:]
init() {
self.manager = CLLocationManager()
self.manager.requestWhenInUseAuthorization()
}
func startMonitoringConditions() {
Task {
print("Set up monitor")
monitor = await CLMonitor(monitorName)
await monitor!.add(getBeaconIdentityCondition(), identifier: "TestBeacon")
for identifier in await monitor!.identifiers {
guard let lastEvent = await monitor!.record(for: identifier)?.lastEvent else { continue }
UIRows[identifier] = [lastEvent]
}
for try await event in await monitor!.events {
guard let lastEvent = await monitor!.record(for: event.identifier)?.lastEvent else { continue }
if event.state == lastEvent.state {
continue
}
UIRows[event.identifier] = [event]
UIRows[event.identifier]?.append(lastEvent)
}
}
}
func updateRecords() async {
UIRows = [:]
for identifier in await monitor?.identifiers ?? [] {
guard let lastEvent = await monitor!.record(for: identifier)?.lastEvent else { continue }
UIRows[identifier] = [lastEvent]
}
}
func getBeaconIdentityCondition() -> CLMonitor.BeaconIdentityCondition {
CLMonitor.BeaconIdentityCondition(uuid: UUID(uuidString: "abc")!, major: 123, minor: 789)
}
}
It works except that my sample app can take as long as 90 seconds to see event changes. You would get an instant update with an fashion (CLBeacon and CLBeaconIdentityConstraint). Is there anything that I can do to see changes faster? Thanks.
Hi all,
We’re running into a challenge with our iOS app DriveSmarter, which uses background location updates when connected to a physical Bluetooth device (e.g., dash cam, radar detector). For battery efficiency, we disable location services in the background when no device is connected. The problem we’re now facing is:
How can we programmatically re-enable location services when a Bluetooth device reconnects while the app is still in the background?
From what I understand, Core Location doesn’t allow re-enabling background location updates unless the app returns to the foreground. But our core use case requires this to happen seamlessly in the background when the user starts driving and the device connects again.
To clarify:
We stop location updates when the device disconnects.
We want to resume location updates only when the device reconnects, even if the app is still in the background.
Manually bringing the app to the foreground is not a reliable or user-friendly option.
So my questions:
Is it possible to programmatically restart background location services upon a Bluetooth connection event while staying in the background?
If not, are there any best practices or Apple-recommended alternatives to achieve a similar result?
Any guidance, patterns, or creative solutions would be greatly appreciated!
Thanks in advance
Our backend management system uses Google for Location, and Apple Maps is just one of the solutions in our map component.
When should I convert coordinates to GCJ02?
Maybe you would say that when you are in mainland China?
BUT NOT AT ALL!
What if the user does not enable location permission?
What if the user has not inserted a SIM card? Or not Chinese SIM card but location in China?
OR the user location in China, But use VPN with en overseas IP?
All solutions are not perfect, unless you open the API to developers and tell us whether Apple Maps currently uses the wgs84 coordinate system or gcj02, which is the most reliable.
Topic:
App & System Services
SubTopic:
Maps & Location
Tags:
MapKit
Maps and Location
Apple Maps Server API
I'm building a weather map that shows the rain on the map. I'm able to retrieve PNG images that are used as tiles to put onto the map. I then reload all the tiles on the map with each timeframe (tile set for every 10 minutes).
I'm able to get the map loaded up and I'm able to place the tiles and reload the data for each time slot. But I'm getting a ton of spam on the console every time the tiles are reloaded.
Failed to locate resource named "sky20Grey0@2x.png"
Failed to locate resource named "sky20Grey0@2x.png"
Compiler failed to build request
Compiler failed to build request
Compiler failed to build request
Compiler failed to build request
Compiler failed to build request
Compiler failed to build request
Compiler failed to build request
Compiler failed to build request
Compiler failed to build request
Yet the images are showing on the map just fine. But I feel like it's a bit sluggish due to all the spam coming out as I'm reloading this every 0.5 seconds with a timer.
I've tried to load the data from a remote server on demand by overriding the - (void)loadTileAtPath:(MKTileOverlayPath)path result:(void (^)(NSData *tileData, NSError *error))result function. But due to the timer this can lead to the data not getting loaded fully before it switches to the next time slot of data. I therefore pre-load everything. I can then store the NSData in memory and use loadTileAtPath or the NSURL to a stored file and use - (NSURL *)URLForTilePath:(MKTileOverlayPath)path. Both cases work. But both cases have this spam.
I've further refined things such that the MKTileOverlayRenderer is reused but that didn't help. Here's the function for that..
- (MKOverlayRenderer*)mapView:(MKMapView*)mapView rendererForOverlay:(id<MKOverlay>)overlay
{
if ([overlay isKindOfClass:[MKTileOverlay class]]) {
if (!self.rainRenderer) {
self.rainRenderer = [[MKTileOverlayRenderer alloc] initWithTileOverlay:overlay];
self.rainRenderer.alpha = 0.5;
}
return self.rainRenderer;
}
return nil;
}
I'm using one MKOverlay and then just reloading the tiles as needed. Otherwise there is quite a pronounced flicker. Here's that function which is triggered by the NSTimer to happen every 0.5 seconds.
- (void) updateRainFrame {
self.currentFrameIndex = (self.currentFrameIndex + 1) % self.timestamps.count;
if ((self.currentFrameIndex >= 0) && (self.timestamps.count > self.currentFrameIndex)) {
NSLog (@"self.currentFrameIndex = %lu", self.currentFrameIndex);
NSString *timestamp = self.timestamps[self.currentFrameIndex];
[self.overlay setTimestamp:timestamp];
[self.rainRenderer reloadData];
}
}
In that function I'm updating the "timestamp" in the overlay which is the time slot that contains all the tiles for that time. This way my overridden MKTileOverlay can then pass the correct path for the tiles. For example for loading from a file:
- (NSURL *)URLForTilePath:(MKTileOverlayPath)path {
return [self getWeatherTileFileURLForPath:path];
}
Or NSData stored in memory
- (void)loadTileAtPath:(MKTileOverlayPath)path result:(void (^)(NSData *tileData, NSError *error))result
{
return [self getWeatherTileDataForPath:path];
}
But no matter which way I use I keep getting this spam and unfortunately there is no error or anything to point to why it is spamming out.
Also the tiles themselves are PNG files either 256x256 or 512x512 in pixel size.
I saw that this could be something to do with Metal but I'm assuming that's something that MapKit uses.
Very much welcome any thoughts to what could be causing this?