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
}
}
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
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
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,
I've watched the WWDC video "Discover streamlined location updates"
As detailed here: https://developer.apple.com/videos/play/wwdc2023/10180/?time=364
In order for my app to receive location updates in the background, the video states that I can either use a live activity or a CLBackgroundActivitySession
My app has a live activity, however the location updates stop shortly (10 seconds, this is the normal "grace period" described) after backgrounding the app, even when the live activity is visible. If I acquire a CLBackgroundActivitySession, location updates continue in the background.
I have reproduced this behavior in the Simulator in a barebones app for testing and confirmed that it's not working as described.
My question is: Should I hold a CLBackgroundActivitySession even when I already have a Live Activity?
Topic:
App & System Services
SubTopic:
Maps & Location
Tags:
Core Location
Maps and Location
ActivityKit
Hi everyone,
I’m trying to use WeatherKit REST API in my iOS app, but for several days now I always get the same response:
WeatherKit capability is enabled in my App ID
WeatherKit is enabled in App Services (in Certificates, Identifiers & Profiles)
WeatherKit REST API is enabled in my developer account
JWT is correctly signed with private key from AuthKey_XXXXX.p8
Token contains correct iss, kid, sub, exp, and scope
Request is sent to https://weatherkit.apple.com/api/v1/weather/en/50.45/30.52 with Authorization: Bearer
Still, the response is always 401 NOT_ENABLED.
This is not a temporary issue — I’ve been testing this for over 5 days, regenerating keys, JWTs, and checking the setup.
Everything seems correct — but WeatherKit just won’t respond with actual data.
Has anyone experienced something similar?
Is there something missing in the setup not documented?
Thanks in advance!
Topic:
App & System Services
SubTopic:
Maps & Location
How to set up iPhone 16 so that the Apple map navigation does not go into a dark screen during use? iOS 26 Developer Beta
Topic:
App & System Services
SubTopic:
Maps & Location
Dear Apple Team,
I am reaching out regarding the need for more sophisticated location verification APIs beyond basic IP lookup capabilities. As online fraud continues to evolve, IP-based geolocation has proven insufficient for many business use cases requiring accurate location verification. Would it be possible to discuss this proposal with your API development team? I believe this would be valuable for the entire iOS and macOS developer ecosystem while maintaining Apple's commitment to user privacy.
Topic:
App & System Services
SubTopic:
Maps & Location
Tags:
Security
Core Location
Maps and Location
I am developing a navigation application. My goal is for this navigation app to also work in the background and provide the user with real-time directional updates. When apps request access to location services, users see a TCC (Transparency, Consent, and Control) prompt. This prompt allows the user to choose under what conditions the app can access location services (for example: “While Using the App”, “Always”, etc.).
If the user selects the “While Using the App” option, can the navigation app still access location in the background and provide directional information to the user? Is something like this technically possible? Does Apple allow this behavior for navigation apps or similar use cases?
Topic:
App & System Services
SubTopic:
Maps & Location
Tags:
Core Location
Maps and Location
Privacy
Hello,
I'm working on an application that requires the use of significant location changes and visits, in addition to region monitoring and standard continuous location delivery (foreground and background).
iOS 17 and iOS 18 introduced changes to how we can monitor distinct regions of interest (with CLMonitor) as well as receive location updates (with CLLocationUpdate).
But I couldn't find any information regarding how to work with
Significant location changes. Do we still need to create a location manager and call startMonitoringSignificantLocationChanges()? Where are the updates received in this case, in the locationManager(_:didUpdateLocations:) or in the liveUpdates async sequence?
Visits. Same question here, for visit monitoring to work, do we still have to create a location manager then call startMonitoringVisits()? Where are the visits being notified? Still in locationManager(_:didVisit:) or in the liveUpdates asynchronous sequence?
I just want to be sure I understand correctly how to use the updates, and if some features of Core Location still need to use a location manager and the delegate to receive the events.
Maybe additional CLCondition will be added to cover both of these technologies as it seems highly related to monitoring conditions (significant location change, and visit).
Thank you,
Axel
I'm making an app that can have locations and links shared to it. I have gotten the share intent working for text and urls with:
NSExtensionActivationSupportsWebURLWithMaxCount: 1
NSExtensionActivationSupportsWebPageWithMaxCount: 1
NSExtensionActivationSupportsText: true
in Info.plist of the share extension. I am able to share Google Maps locations and safari websites. However, my app does not appear when I share a location on Apple Maps.
I also tried the other options in the docs (https://developer.apple.com/documentation/bundleresources/information-property-list/nsextension/nsextensionattributes/nsextensionactivationrule) as well without success. When I share a location (i.e. a shop) in Apple Maps, it looks like a link but perhaps its something else?
Does anyone know how to get an app to come up in the share menu of an Apple Maps location?
Thanks!
Our Indoor Map for shopping center has been stuck at "Occupants Data in Review" for a few weeks. Can someone on that team assist? Thank you.
Topic:
App & System Services
SubTopic:
Maps & Location
Hi, I'm using the Apple Maps Server API (/v1/geocode) to retrieve geocoding results for Japanese addresses.
Until recently, requests like the one below returned correct results:
GET https://maps-api.apple.com/v1/geocode?q=東京都千代田区千代田1-1&lang=ja-JP
Authorization: Bearer <valid JWT>
But now, the response is always:
{ "results": [] }
However, when I use the same address with lang: en-US, it returns valid coordinates:
GET https://maps-api.apple.com/v1/geocode?q=1-1 Chiyoda, Chiyoda-ku, Tokyo=en-US
"東京都千代田区千代田1-1" is a Japanese address, and "1-1 Chiyoda, Chiyoda-ku, Tokyo" is the same address written in English.
My Questions:
Has there been a recent change to the geocoding behavior for Japanese addresses when lang: ja-JP is used?
Does the lang parameter affect not only the response language but also the internal parsing logic?
Is this a known issue or limitation?
The access token is valid and I'm getting a 200 OK response, but results is always empty with lang: ja-JP.
Thanks for your help!
Hi- I've never posted on here before! But ChatGPT hasn't been helpful with this.
I have a call using MKLocalSearch (i have a waddled down version below)
let region = MKCoordinateRegion(
center: location, // the user's location
span: MKCoordinateSpan(
latitudeDelta: 0.005,
longitudeDelta: 0.005
)
)
let req = MKLocalPointsOfInterestRequest(coordinateRegion: region)
req.pointOfInterestFilter = MKPointOfInterestFilter(including: [.nightlife])
let search = MKLocalSearch(request: req)
I made the latitude and longitude the lowest they can possibly be without throwing an error. Sometimes (and unreliably) when the user's location is at say, a bar, this list will give me like 10 bars that are not even within the region, and exclude the bar that the user is actually present in. How can i make this not the case?
In other words, I just want this to return what I expect: a list of POIs with the category .nightLife within the defined region.
Any help would be appreciated!
Hey everyone,
I’m using MapKit JS in a web app and wanted to ask if anyone has experience optimizing its loading performance.
Initially, I was using the core version of MapKit JS, but some users reported issues—certain modules weren’t immediately available, and they had to wait quite a while before the map became usable.
Switching to the full version helped somewhat, but I’m still seeing delays. In some cases, MapKit JS isn’t fully ready even after 10 seconds.
To reduce these delays, I’m considering bundling MapKit JS directly into my site’s JavaScript bundle (rather than loading it externally). My hope is that this could improve load times and reduce dependency on external script loading.
Before I try this, I want to make sure this doesn’t go against Apple’s usage policies for MapKit JS.
Has anyone tried this approach? Is bundling MapKit JS allowed? Or are there better ways to improve the loading experience?
Thanks in advance!
The documentation for CLGeocoder states
Geocoding requests are rate-limited for each app, so making too many requests in a short period of time may cause some of the requests to fail. (When the maximum rate is exceeded, the geocoder returns an error object with the CLError.Code.network error to the associated completion handler.)
And it provides helpful guidance on how and when to submit geocoding requests.
The documentation for MKReverseGeocodingRequest does not mention requests are rate-limited. Does this mean it is not rate-limited? If it is rate-limited, is it similar to CLGeocoder, what is its behavior?
It is important to understand behavior of the API in order to understand impact on my app’s use case and how users will be affected should I change the implementation. Thanks!
I have just a thin blue line as the route polyline and it is quite different not to think that this ist just a small river? Does anyone have an idea how to change the color and the strike width (line width) of the polyline (between Essen and Dortmund). The solution by Gemini and ChatGPT is not working...
Thanks for your help, Markus
<script src='https://cdn.apple-mapkit.com/mk/5.x.x/mapkit.core.js'
crossorigin async data-callback='initMapKit' data-libraries='full-map,services,overlays,annotations' data-token='TOKEN></script>
<script type='module'>
const setupMapKitJs = async() => {
if (!window.mapkit || window.mapkit.loadedLibraries.length === 0) {await new Promise(resolve => { window.initMapKit = resolve }); delete window.initMapKit;}};
const main = async() => {
await setupMapKitJs();
var map = new mapkit.Map('map-container', {
center: new mapkit.Coordinate(51.5, 6.9),
showsZoomControl: true,
colorScheme: 'light',
showsMapTypeControl: true,
});
map.cameraDistance = 30000;

const directions = new mapkit.Directions();
directions.route({
origin: 'Essen',
destination: 'Dortmund'
}, (error, response) => {
if (error) {
console.error(error);
return;
}
const route = response.routes[0];
const routePolyline = route.polyline;
routePolyline.lineWidth = 20;
map.addOverlay(routePolyline);
});
};
main();
</script>
Topic:
App & System Services
SubTopic:
Maps & Location
Hi,
Apple recently announced DL-TDoA (Downlink TDoA) support on iOS26. This API is currently marked as Beta. We are working on integrating this functionality into our app, already added the APIs and tried to configure a new DL-TDoA session using NIDLTDOAConfiguration (the only parameter it takes is networkIdentifer). The session is configured but automatically invalidated by the OS.
When is DL-TDoA expected to be fully supported by phones? Can we expect a detailed documentation or specification explaining how to arrange the session with the DT-Anchors (channel, ranging duration, ...)? Do we need Bluetooth LE connection with the anchors while running DL-TDoA?
We already have the 4 DT-Anchors (1 initiator and 3 responders) ready, looking forward to be able to test this new exciting feature and get DL-TDoA measurements to trilaterate the phone position within a map.
Regards.
Apple recently announced DL-TDoA (Downlink TDoA) support on iOS 26, and the API is currently marked Beta. Using two iPhones (16 Pro and 13) on iOS 26.0 Beta, I’m starting a Nearby Interaction session and need to read NITLDOA parameters (address, carrier frequency offset, signal strength/RSSI), but I can’t find a supported way. I’m also seeing asymmetry: iPhone 13 reports distance+direction, while 16 Pro reports distance only. Is there a supported workflow/API to access those parameters, and any known device/OS constraints that would cause direction to be unavailable on 16 Pro?
I am having a problem with the following scenario.
The user opens the Maps app, then selects a location like a store or restaurant, then taps on share and then on my app.
On iOS 26, my app stopped showing as an option to receive the location altogether. After changing the NSExtensionActivationRule to TRUEPREDICATE to accept all, I see this difference between the OS versions.
iOS 18.5
(lldb) po extensionContext?.inputItems
▿ Optional<Array<Any>>
▿ some : 1 element
- 0 : <NSExtensionItem: 0x60000000c5d0> - userInfo: {
NSExtensionItemAttachmentsKey = (
"<NSItemProvider: 0x600002930d20> {types = (\n \"public.plain-text\"\n)}",
"<NSItemProvider: 0x600002930c40> {types = (\n \"com.apple.mapkit.map-item\"\n)}",
"<NSItemProvider: 0x600002930bd0> {types = (\n \"public.url\"\n)}"
);
NSExtensionItemAttributedContentTextKey = {length = 329, bytes = 0x7b5c7274 66315c61 6e73695c 616e7369 ... 656e7472 61616c7d };
"com.apple.UIKit.NSExtensionItemUserInfoIsContentManagedKey" = 0;
}
iOS 26
(lldb) po extensionContext?.inputItems
▿ Optional<Array<Any>>
▿ some : 1 element
- 0 : <NSExtensionItem: 0x60000000cbd0> - userInfo: {
NSExtensionItemAttachmentsKey = (
"<NSItemProvider: 0x60000293afb0> {types = (\n \"public.url\"\n)}",
"<NSItemProvider: 0x60000293bf70> {types = (\n \"public.plain-text\"\n)}"
);
"com.apple.UIKit.NSExtensionItemUserInfoIsContentManagedKey" = 0;
}
Please notice how iOS 26 stopped sending com.apple.mapkit.map-item
Is it no longer possible to get a MKMapItem item out of the extension contents from the Maps app?
I would appreciate any pointers on how to extract the info of the shared location from the Maps app.
Topic:
App & System Services
SubTopic:
Maps & Location
I am having a problem with the following scenario.
The user opens the Maps app, then selects a location like a store or restaurant, then tap on share and then on my app.
On iOS 26, my app stopped showing altogether. After changing the NSExtensionActivationRule to TRUEPREDICATE to accept all, I see this difference between the OS versions.
iOS 18.5
(lldb) po extensionContext?.inputItems
▿ Optional<Array<Any>>
▿ some : 1 element
- 0 : <NSExtensionItem: 0x60000000c5d0> - userInfo: {
NSExtensionItemAttachmentsKey = (
"<NSItemProvider: 0x600002930d20> {types = (\n \"public.plain-text\"\n)}",
"<NSItemProvider: 0x600002930c40> {types = (\n \"com.apple.mapkit.map-item\"\n)}",
"<NSItemProvider: 0x600002930bd0> {types = (\n \"public.url\"\n)}"
);
NSExtensionItemAttributedContentTextKey = {length = 329, bytes = 0x7b5c7274 66315c61 6e73695c 616e7369 ... 656e7472 61616c7d };
"com.apple.UIKit.NSExtensionItemUserInfoIsContentManagedKey" = 0;
}
iOS 26
(lldb) po extensionContext?.inputItems
▿ Optional<Array<Any>>
▿ some : 1 element
- 0 : <NSExtensionItem: 0x60000000cbd0> - userInfo: {
NSExtensionItemAttachmentsKey = (
"<NSItemProvider: 0x60000293afb0> {types = (\n \"public.url\"\n)}",
"<NSItemProvider: 0x60000293bf70> {types = (\n \"public.plain-text\"\n)}"
);
"com.apple.UIKit.NSExtensionItemUserInfoIsContentManagedKey" = 0;
}
Please notice how iOS 26 is no longer sending com.apple.mapkit.map-item.
Is there an alternative way to read the info from the map location shared to my app?