Maps & Location

RSS for tag

Learn how to integrate MapKit and Core Location to unlock the power of location-based features in your app.

Maps & Location Documentation

Posts under Maps & Location subtopic

Post

Replies

Boosts

Views

Activity

iOS 26 share map 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 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.
0
0
22
1w
App not showing up in Apple Map's share location menu
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!
0
0
33
Jul ’25
MapCameraPosition & userLocation
I have a Map within a SwiftUI. I initialize a variable like this: var cameraPosition: MapCameraPosition = .userLocation(followsHeading: true, fallback: .automatic) and then I want to zoom map, code like this: let userRegion = MKCoordinateRegion( center: userLocation.coordinate, span: MKCoordinateSpan( latitudeDelta: 0.01, longitudeDelta: 0.01 ) ) cameraPosition = .region(userRegion) But it does't work. How can I solve this problem?
0
1
343
Nov ’24
Location Verification API's
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.
0
0
89
Jun ’25
"hotels" query brings me to an hotel in Ramallah
When trying the request "hotels" on MapKitJS with searchRegionPriority=default, it will return an hotel in Ramallah even if the searchRegion is very far from there. It can happen if your search region is very broad in most place (above Europe if you zoom out a lot, over Turkey and Middle East even if the bounding box is narrower), but on specific places it happens even with a small search region (like in Tripoli, Lebanon, whatever the zoom level). With searchRegionPriority=required, many hotels can be found in the same area. Reproduce with: https://maps-api.apple.com/v1/search?q=hotels&searchRegion=34.45512816097114,35.849070061159864,34.428418939926146,35.80795182731595&lang=en&searchRegionPriority=default
0
0
512
Nov ’24
[iOS] Location data no longer updating consistently after updating the app from old version
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?
0
0
118
May ’25
Changing MKMapView .preferredConfiguration or .mapType causes crash
If I change MKMapView's .preferredConfiguration property from .realistic to .flat, or .mapType from .hybridFlyover to .hybrid, subsequent scrolling causes a crash: -[MTLDebugRenderCommandEncoder validateDrawIndexedPrimitives:indexCount:indexType:indexBuffer:indexBufferOffset:instanceCount:function:]:6179: failed assertion `Draw Indexed Primitives Validation indexBufferOffset(0) + (indexCount(864) * 2) must be <= [indexBuffer length] (12). For example, changing: mapView.preferredConfiguration = MKHybridMapConfiguration(elevationStyle: .realistic) to: mapView.preferredConfiguration = MKHybridMapConfiguration(elevationStyle: .flat) Then, scroll the map view, and it will crash. It is OK the other way around. Or change: self.mapView.mapType = .hybridFlyover to: self.mapView.mapType = .hybrid I've tried everything I can think of, including calling functions like these after the change: mapView.setNeedsDisplay() mapView.setRegion(self.mapView.region, animated: false) .mapType and .preferredConfiguration are settable properties, so they should be possible to change. I could create a new MKMapview, but I'd have to perfectly recreate the state which is not trivial and far from ideal. I'm just trying to work around the issue FB14553276 so my map tiles don't show tiling seems in 2D which is a new issue introduced with iOS 18. This potential workaround still shows the seems in 3D, but is better than always showing seems. Seems like whatever I do, I just can't defeat MapKit bugs and puts me in an impossible situation. :( I've submitted Feedback this issue: FB16153802 It seems like others are experiencing the issue: https://forums.developer.apple.com/forums/thread/730780
0
1
507
Dec ’24
MKLocalSearch not returning Places in the specified region
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!
0
0
149
Jul ’25
Improving MapKit JS Load Times – Is Bundling Allowed?
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!
0
0
72
Jul ’25
transportType .transit does not work
hi, does someone encounter this problem, this is sample code : let request = MKDirections.Request() request.source = MKMapItem(placemark: startPlacemark) request.destination = MKMapItem(placemark: endPlacemark) request.transportType = .transit // .transit does not work I want to make a route with two point(startPlacemark and endPlacemark ), when I give request.transportType the value of **.transit ** ,I found it not work, ps: .automobile .walking works well , my Xcode version is 16 .
0
0
262
Oct ’24
WeatherKit always returns 401 NOT_ENABLED despite correct setup
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!
0
0
50
Jun ’25
React-native-map. LongPress callback not working
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
0
0
70
May ’25
Simulator Location Authorization Issue: Authorization Status Remains notDetermined After Denying and Changing in System Settings
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" -&gt; "Privacy &amp; Security" -&gt; "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") } }
0
0
446
Feb ’25
CMAltimeter becomes somehow uncalibrated: absolute locations not delivered anymore (temporarily)
Note: I have had issues with CMAltimeter since whats seems to have been a major undocumented modification since iOS 17.4. So I'm using the CMAltimeter absolute locations delivery. Sometimes, the altimeter seems to be in an uncalibrated mode and therefore, no altitude delivery happens. Is there a way to be inform of such state? Currently, it just doesn't work and I can't inform the user about this. They just think the app is broken What message should I give to the users to accelerate the calibration such that the CMAltimeter will work again? Also, users have reported that the CMAltimeter can temporarily stop delivering altitude updates, even though it should. So I guess my question resumes to this: Whats the best practice to handle an uncalibrated CMAltimeter? Thanks!
0
0
284
Feb ’25
Nearby Interaction / DL-TDoA (Beta): Need NITLDOA params; 16 Pro shows distance-only, 13 has direction
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?
0
1
167
3w
App Clip Not Launching From Approved Apple Maps Action Link
We’ve set up an advanced App Clip experience that successfully launches when a user scans our QR code. However, the same App Clip invocation URL does not launch when tapping the associated Action Link on our Apple Place Card in Apple Maps. Instead of opening the App Clip, the link falls back to the website. What We Have Done So Far: App Clip Launched in App Store Connect: Our App Clip is approved and live on the App Store. Here is the invocation URL: https://appclip.parkzenapp.com/park?q=oJrbSIgx Below is the QR code for our Advanced App Clip experience we are attempting to open in our Apple Maps Place card When scanning the QR code that uses the same App Clip invocation URL, the App Clip reliably launches as expected. Here is our apple-app-site-association file, thats correctly served from the associated domain: https://appclip.parkzenapp.com/.well-known/apple-app-site-association Add here is a screenshot showing how the appclip.parkzenapp.com domain is correctly validated. Advanced App Clip Experience: We created and submitted an advanced App Clip Experience specifically tied to our location on Apple Maps. This App Clip Experience is approved and live. Below is an image of our set up of this Advanced App Clip Experience Business Connect: We've created the Apple Maps Location in business connect and added the advanced App Clip experience invocation URL as an Action Link in the place card. See screenshot below. Apple Maps Place: https://maps.apple.com/place?auid=906421750045811407 Despite meeting these conditions, when a user taps the Action Link (the "Reserve" button in the Apple Maps Place Card), the fallback website opens rather than the App Clip. Question: What additional step or configuration might we be missing to ensure the Action Link on our Apple Maps place card triggers the App Clip instead of the website? Thank you
0
0
430
Dec ’24
Offline Mapkit tiles
I'm currently developing an app with mapkit which I may submit to the Swift Student Challenge. So anyways, the app will be used completely offline. I was wondering if there was any way to include very low resolution map tiles with the app files. That way, the app never needs wifi. However, I'm not sure if this is possible, especially since the map would need to be under 20 mb. Thanks.
0
0
278
Feb ’25