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

Post

Replies

Boosts

Views

Activity

Background API call in iOS
Hello, I am building an enterprise application, where I will be syncing user location to the backend server every 5 min for a period of 12 hr every day. I have enabled location updates and background processing for the app in Xcode, and also will be getting location permission as always from user. We are able to get the location update from the user for the whole time, but the part where we make the service call to sync with backend is delayed. It works fine for the first couple of minutes, but later we see the delay. I have also used NWConnection to directly make the service call without using URLSession, this approach is slight better comparatively, but not perfect. I have made sure "Low power mode" and "Low data mode" is disabled, also "Background App Refresh" is enabled for the application. I believe it should be possible since may app eg. WhatsApp, Telegram have a feature of sharing live location for up to 8 hrs. Is there any way where we can achieve this without delay? Thanks in advance.
1
0
695
Aug ’23
MapKit : is there any user-location restriction?
Hi, We've released a golf app available on iOS. It uses MapKit to display maps : golfcourses, shots, livecaddie, telemeter etc. Some users from South-Korea are complaining about not being able to zoom-in on areas located in their country (particularly in the New Seoul Country Club). They can have an overview of the golfcourse but it's impossible to get closer. If they try on other golfcourses located in the US or in the UK, it works perfectly (still trying from Korea). We can't replicate the issue on the Simulator. We changed the language/region + gps location to South-Korean. Our IP is located in France. Do you know if there's some restriction about map display depending on the country you are currently located?
0
0
432
Aug ’23
Mapas - contribución
Me encuentro en el país de Colombia y por muchos años todavía Apple no va habilitado el modo de navegación en mi país también me di cuenta que hay muchos países con ciudades muy importantes claro está que tienen sus ciudades muy bonitas en mapas 3D fotorealismo o en mapas 3D en vista estándar mi pregunta es si yo desde Colombia desde mi ciudad podría ayudar a qué las fotos del terreno visto desde el aire fueran mucho mejor con ayuda de un drone. Y así empezar a evolucionar un poco mi ciudad referente a Apple Maps, O también para empezar a que la navegación en Apple Maps sea más cercana de lo que Apple tiene pensado para nosotros
1
0
410
Aug ’23
CLLocationPushServiceErrorDomain
Error Domain=CLLocationPushServiceErrorDomain Code=3 "(null)" An error occurs when calling startMonitoringLocationPushes(completion:). Why does this error occur? Included com.apple.developer.location.push entrymen when I generated the bundle ID. Added push notification functionality. Requested Location service permission. Added location push service extension target.
0
0
269
Jul ’23
Unknown device in Find My app
Hi, I lauched my Find My app today and found every devices i (or my family) use but there was an unknown one, a macbook pro located the other side of the country in a city i never went to. This device doesn't appear in the list on devices on which my apple account is signed in, only in the Find My app Apple support reassure me, it's not on my logged in devices list so my credentials hadn't be stollen, it seams to be a problem with the iOs 17 beta Configurations : Sonoma bêta 14.0 (23A5286i) on my macbook iOS 17.0 (21A5277j) on my iPhone 11
0
0
545
Jul ’23
Can you make a Marker selectable?
In the initial Xcode 15/iOS 17 Beta selecting a Marker would give a visible indication that the marker was selected without setting the selection. This is the code I used. struct ContentView: View { let location = CLLocationCoordinate2D(latitude: 37.0, longitude: -122.0) @State private var position: MapCameraPosition = .automatic @State private var selectedItem: MKMapItem? var body: some View { VStack { Text(selectedItem == nil ? "Nothing Selected" : selectedItem?.name == nil ? "No name" : selectedItem!.name!) .bold() .padding() Map(position: $position, selection: $selectedItem) { Marker("Marker", coordinate: location) .tag(1) .tint(.red) } } .padding() } } I submitted feedback and things changed in Beta 3. Now I can not select the Marker. That's not the direction I'd hoped to see. Am I doing something wrong or is there no way to select a Marker placed on a map?
2
1
1.2k
Jul ’23
What is the right way to display user location on map
Hello, I am currently working on an app for a client. The concept is straightforward: the app allows users to view the location of other users on a map, even when they are not actively using the app. However, this feature is limited to a selected group of people, specifically those who have joined the same group as the user. To achieve this, I collect location data in the background. The primary objective of this app is to connect users with nearby individuals who can assist them with tasks or jobs. However, I encountered an issue during the app review process. The review team deemed it inappropriate for deployment because it displays users' locations on a map, without the necessary privacy safeguards in place. Nevertheless, the main purpose of the app is to allow users to be visible on the map, and people who download the app intend to be included in this display. Here is the comment provided by the reviewer: Your app enables the display of nearby users' locations on a map, but does not have the required privacy precautions in place. Additionally, here is the specific requirement: Require users to manually check-in each time they wish to have their location displayed on a map; there should be no option to enable automatic check-ins. If I understand correctly, this means that users would be required to open the app in order to appear on the map. However, this contradicts the purpose of the app, as users prefer to be passively visible without actively opening the app. On the other hand, I have noticed tracking apps like Life360 and others that provide similar functionalities. They display users' locations on a map in near-real-time. What am I missing to ensure the validity of my app? The reviewer mentioned being unable to provide any hints, so I am hopeful that someone here can assist me.
2
2
738
Jun ’23
macos sonoma - unable to change time zone
hi, everyone! i travelled to a different time zone and the time has not updated to my new location. i seem to remember this worked ok before sonoma. system settings - privacy & security - location services - system services - details - setting time zone ON (if this is changed to off it does not stay off, if i leave that window pressing done, when i open that setting again it is still set to on, so changing it has no effect) system settings - general - date & time all set to ON (if Set time zone automatically using your current location is set to off the the Time zone stays greyed out and cannot be changed and only the Closest city can be changed, which is of no use as cities to select from are still not in the time zone i want to change to). this is probably a bug in the new macos sonoma and just wanted to make this known and hopefully have a solution to it. thank you!
10
4
4.7k
Jun ’23
Granularity/Accuracy of delivered locations with live updates
First of all : Thanks for the great presentation (wwdc2023-10180), Siraj ! This new, simple API looks like what we've been looking for for easy manageable background location updates with 'automatic battery drain minimization' :-) There were two questions that came to my mind. As far as I understood, the CLLocationUpdate.LiveConfiguration is used to help the location services to improve the location fixes. Are there other options planned to specify the granularity of delivered locations e.g., how accurate the locations need to be (as the desiredAccuracy and distanceFilter settings for the olden CLLocationManager)? Does the Implementation switch between significant location changes and regular, more expensive ways (like GPS hardware) or just deliver the most feasible accuracy available at the time of notification? I'm just curious - if I get the most feasible granularity, everything is fine for me anyway :-) Thanks again, Michael
1
0
653
Jun ’23
How to handle thousands of map annotations (+100K) in a MKMapView?
According to the MKMapview, all annotations should be added to the map: https://developer.apple.com/documentation/mapkit/mkmapview When configuring your map interface, be sure to add all of your annotation objects right away. The map view uses the coordinate data in each annotation object to determine when the corresponding annotation view needs to appear onscreen. When an annotation moves onscreen, the map view asks its delegate to create a corresponding annotation view. If your app has different types of annotations, it can define different annotation view classes to represent each type. But this has a very low performance when the map is zoomed out and all annotations are visible (although market already filters out most of the annotations and only displays a few). As fas as I've seen, the suggestion from the documentation doesn't scale properly when the number of annotations is very large. Grouping doesn't help, neither using reusable annotations. Is the only option here, handling manually the add/remove annotations as the map rect changes?
2
0
923
May ’23
How to detect MapKit Map panning/scrolling ended
Hello, I'm trying to figure out how to detect when user stops scrolling (panning) the map. The problem: I have a MapAnnotation that I want to always keep in the centre, even is user is panning/scrolling the map. When map is open first time, the original annotation location is user's current location. I request the name of the location to display it on top of the annotation. when user moves the map around, I want to track when he stop this action and select a location in the centre of map's new region and display the a location's name on top of the annotation I can't use .onChange() because region centre changes constantly as user moves the map, because it causes to many requests for location's name DragGesture .onEnded() is never called, so I have no idea when customer stops moving the map So my question is - how to detect in this case when customer stopped moving the map? Have anyone faced the same problem? Any ideas how to solve it?
2
1
1.6k
Apr ’23