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

Remove WeatherKit from existing app
One of my apps includes a free weather forecast using WeatherKit. Recently, it started to get more downloads and almost reached the limits of the free tier. I've removed the forecast in newer versions but there's still a substantial amount of users who do not update their apps. Is it possible to somehow remove the capability from existing apps? Thank you!
1
0
80
Jun ’25
New CoreLocation APIs
Hi All, I am currently working on an app that has some navigation functionality, and since my minimum iOS is 18 wanted to incorporate the new APIs that yield a AsyncStream of locations. I have watched both WWDC sessions, the one where the new API is introduced to retrieve the location points, and also the other video where the new authorization process for location is simplified as well. I have an app currently working in its current state, but am noticing some weird quirks when using the CLBackgroundActivitySession to get the elevated background permission. What I am doing here is to create this stream and the background object is below: return AsyncThrowingStream { continuation in let task = Task { do { for try await update in CLLocationUpdate.liveUpdates(updateType) { if shouldStopUpdate { continuation.finish() break } continuation.yield(update) } } catch { continuation.finish(throwing: error) } } state = .started(locationTask: task, background: CLBackgroundActivitySession()) } When I have an active navigation session going and am strongly holding this object and the user force quits the app (or I stop the target through Xcode) the navigation activity indicator in the status bar (or dynamic island) remains present. Even if I relaunch the app, start navigation again, and then call the invalidate method on the CLBackgroundActivitySession I then am seeing that navigation indicator even if I delete my app, and often need to do a full restart to get out of this state. Is there a step I am missing, or do I not understand the way the new API works to run in the background?
1
0
614
Jan ’25
Simulator location data
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?
1
0
142
Jun ’25
The latest IOS doesn't act for the custom iBeacon anymore.
I have some questions about the changes that the latest IOS doesn't act (scanning or monitoring) for our custom beacon devices. Since about 2015, We has provided some 'location based service' by using our custom iBeacon devices. However We've just realized that the latest IOS devices doesn't work with our custom iBeacon devices. but also realized It could still work with the other normal iBeacon devices. So, I've dig this issues for a while and finally I got the answer. It's because the one byte of Ibeacon advertsing packet payload. the followings are the differences about manufacturer data part between a normal Ibeacon and our custom beacon. normal Ibeacon 0xFF 0x4C00 0x02 0x15 0x736E75685F70656F706C655F74656331 0xEA61 0x03EB 0xC5 our custom Ibeacon 0xFF 0x4C00 0x02 0x15 0x736E75685F70656F706C655F74656331 0xEA61 0x03EB 0xC5 0xDA Yes, I know. after many of searches and research, Now I've understood the byte (meaning the length of following payload) should be changed as '0x16'. But It is certainly something that has worked well not so long ago. Anyway, The introduction was so long, but this is the one question what I'd like to ask about. I need to know exactly which version of IOS this change came from. (I've tried but I couldn't find any thing about this on the official documents.) I need to expaing to my customers what's going on. for that, I need the information that exactly which version of IOS It didn't work from. Thanks in advance. Regards.
1
0
420
Jan ’25
How to Reduce Geolocation Drifting Inside Buildings on iOS?
I am developing a Flutter app that uses geolocation data extensively. While the location accuracy is excellent under an open sky, I’ve noticed significant drifting when users are inside large buildings. This impacts the app’s functionality as precise location data is critical. I would like to know: Are there any specific configurations or APIs available in the Apple ecosystem to enhance indoor geolocation accuracy? Would combining GPS with other location technologies (like Wi-Fi or Bluetooth) reduce drifting effectively? Are there recommended practices for handling geolocation indoors on iOS? Any advice, examples, or guidance would be greatly appreciated!
1
0
343
Jan ’25
Apple maps trail / local path only becomes visible on very close zoom
I'm using apple maps to build a feature so users can create and save running/cycling/hiking routes. Currently the map only shows trails and similar local paths after zooming in to what is basically an extreme level. I want the trails and local paths to be more visible on a further, broader level of zoom. APPLE MAPS JS EX: https://trkbucket.s3.amazonaws.com/media/shoe_images/Screenshot_2024-10-23_at_10.52.17AM.png https://trkbucket.s3.amazonaws.com/media/shoe_images/Screenshot_2024-10-23_at_10.52.04AM.png APPLE MAPS iOS EX: https://trkbucket.s3.amazonaws.com/media/shoe_images/IMG_9DDF5C9A320D-1.jpeg Also strange that on iOS the path is visible while more zoomed out whereas JS does not. Please advise how to show these map items at a broader zoom.
1
0
581
Oct ’24
Geolocation tracking for IOS apps using .net Maui
I'm working on an in-house iOS app designed to help users accurately track their routes during trips. Currently, I've implemented a method to track users when the app is open in the background. However, I'm facing challenges, as the tracking stops when the device is locked for more than 10 minutes. I'm looking for a solution to continuously track a user's geolocation, even if the app is closed or not in use. Specifically, I want to ensure uninterrupted tracking, especially when the device is locked. Here are some key points: Current Method: I'm currently using the Core Location method and a combination of background tasks and a repeating timer to fetch the user's location and update a log for geolocation tracking when the app is open in the background. Issues Faced: The tracking stops when the device is locked for more than 10 minutes. This limitation impacts the accuracy of the route tracking during longer trips. Objective: My goal is to achieve continuous geolocation tracking, even when the app is closed or not actively used, to provide users with a seamless and accurate record of their routes. Platform: The app is developed for iOS using the .net maui platform, and I'm seeking solutions or suggestions that are compatible with the iOS .net maui environment. If anyone has experience or insights into achieving continuous geolocation tracking on iOS, especially when the app is not in use or the device is locked, I would greatly appreciate the assistance.
1
1
981
Feb ’25
Background location tracking not reliable
I'm writing an app in which the user is expected to initiate location tracking, let the app track for a period of time (a few minutes to a couple of hours) and then discontinue tracking. We want the user to be able to switch apps or let their device lock while tracking without losing any location updates. My understanding is that this can be done with the "While in use" location permission and does not require "Always". We don't want to have to ask our users for the "Always" permission. I'm configuring the location manager this way: locationManager.delegate = self locationManager.desiredAccuracy = kCLLocationAccuracyBestForNavigation locationManager.allowsBackgroundLocationUpdates = true locationManager.showsBackgroundLocationIndicator = true locationManager.distanceFilter = kCLDistanceFilterNone locationManager.activityType = .otherNavigation locationManager.pausesLocationUpdatesAutomatically = false (The user is expected to be walking around in an outdoor location, stopping occasionally to take notes and pictures). I've tested this using both an iPhone and an iPad that relies on an external GPS device. It works. I can lock the device and see a continuous stream of location updates in the debugger for hours. I've also tested it while walking outdoors. However, my customer keeps reporting that the app stops tracking his location whenever it goes into the background. He says that it will track his location fine while in the foreground, but when he backgrounds it, it stops getting location updates. Then when it comes into the foreground again, it resumes. When we plot the locations on a map, you see a straight line between the place where the app went into background and where it woke up again. We know for sure that the app is just transitioning to and from the background and that it is not being terminated and restarted. I can't reproduce this result on my devices and can't figure out what I'm doing wrong. The customer says he has another app on his device (which is also an iPad with an external GPS) and that the other app does track him when it is in the background. My app does process all of the locations received in the didUpdateLocations method and not just the last one, so it's not that I'm getting the updates and ignoring them. I'm also not receiving any calls to 'locationManagerDidPauseLocationUpdates', 'didFinishDeferredUpdatesWithError', or 'didFailWithError'. The only explanation I can think of at the moment is that something changed in iOS. I know that the other app my customer is using is fairly old and built against an old version of the iOS SDK. Thanks for your help.
1
1
402
Jan ’25
Are rate limits for calculate, calculateETA, and reverse geocoding shared across an app?
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!
1
1
133
Jun ’25
Location not tracking in background
I really need some help. I have been going back and forth with a customer of mine for weeks. Our app is supposed to track location in the background after a user starts it in the foreground. Every time I test it, it works. I can put the app in the background and walk around for hours. Every time he tests it, it doesn't work. He puts the app into the background and about a minute later, it stops tracking him. Then it starts again when the app comes back to the foreground. We have each tried it on two devices with the same results. I'm willing to post the rest of the details if anyone is interested in helping me, but the last couple of times I got no response, so I'm not going to bother unless I can get some help this time. Thanks.
1
0
431
Feb ’25
LookAroundPreview navigation not working on macOS
The code below using LookAroundPreview works fine on iOS (showing the preview image with a button saying "Look Around" at the top to enter full screen with navigation), but on macOS (15.3) there is no button and no way to navigate the view. Is this a bug or is there something I need to do differently on macOS? I have also tried using AppKit with MKLookAroundViewController and I don't seem get the button to launch full screen there either. import SwiftUI import MapKit struct ContentView: View { var body: some View { LookAroundPreviewView(coordinate: CLLocationCoordinate2D(latitude: 37.33182, longitude: -122.03118)) .frame(width: 300, height: 200) } } struct LookAroundPreviewView: View { let coordinate: CLLocationCoordinate2D @State private var scene: MKLookAroundScene? @State private var errorMessage: String? var body: some View { Group { if scene != nil { LookAroundPreview(scene: $scene, allowsNavigation: true) } else if let errorMessage = errorMessage { Text("Error: \(errorMessage)") .foregroundColor(.red) } else { ProgressView("Loading Look Around Preview...") } } .task { do { let request = MKLookAroundSceneRequest(coordinate: coordinate) let fetchedScene = try await request.scene scene = fetchedScene } catch { errorMessage = error.localizedDescription print("Error loading Look Around scene: \(error)") } } } }
1
0
335
Feb ’25
IMDF Labels for Indoor Survey App
I have seen examples of conducting an Indoor Survey of an IMDF where it has labels on the map. This would help. Our structure is basically a huge hall that gets reconfigured weekly from a horse venue to a car show to a home and garden show. I was thinking of creating a series of walkways to criss cross the floor and then survey them once done. It would be nice to have a label of the features on the map. How is this done? Thank you, Mele
1
0
329
Nov ’24
Do I need to maintain CLServiceSession when app relaunches from terminated state due to CLMonitor events?
I'm currently testing the CLMonitor API and have a question about CLServiceSession management. When my app is relaunched from a terminated state in the background due to CLMonitor events, do I still need to create and maintain a CLServiceSession instance? I'm wondering if CLServiceSession is necessary even when I don't need to continuously receive GPS updates through liveUpdates. Since CLMonitor can trigger app launches for region monitoring events without requiring constant location updates, I'm unclear about whether the CLServiceSession is still required in this scenario. Any clarification on the proper implementation would be greatly appreciated. Thanks!
1
0
145
4w
Core Location always failing (kCLErrorLocationUnknown)
Hello. I’m trying to use Core Location Service on any application in Mac (Safari, Maps, Weather, Chrome with Core Location configuration, or just trigger the API with a standalone app) and it seems that all of them constantly fail to provide the geolocation of my device because of the same error (kCLErrorLocationUnknown). I'm using MacBook Pro (M3 Max) with Sonoma 14.7. I’m sure the apps have access in the settings and everything is in order except the Core Location response. I’ve tested the issue on multiple MacBooks and it reproduced 100% of the times on all of them. Did anyone encounter a similar issue?
1
4
2.1k
Oct ’24