Questions tagged [core-location]

This proprietary Apple framework for iOS and Mac OS X allows apps to obtain information on a device's current location (latitude, longitude, and on some devices, altitude), direction and speed. The framework also provides methods for monitoring regions and being notified as the devices enters and exits predetermined geographical regions.

Filter by
Sorted by
Tagged with
0 votes
0 answers
48 views

Handling location updates in background for widget refresh

I'am developing an iOS widget for my weather app, where the user can set the widget to "My location". This means the widget needs to be refreshed on location changes. Since a widget can't ...
Marco Sprenger's user avatar
-2 votes
0 answers
15 views

How I can obtain Public Transportation Information with MapKit [closed]

Can Mapkit show me details about bus stops, train stations, underground and overground stops, or other public transportation locations based on a specific latitude and longitude? If you check the ...
Ade Adegoke's user avatar
-2 votes
0 answers
39 views

CLGeocoder().geocodeAddressString kCLErrorDomain error 8 but same zipcode working in mapkit searchbar [closed]

Some zip codes are not working when using geocodeAddressString but the same zip code works using a searchbar in MapKit. Any reason? I have seen the same zip code work in food delivery apps like Uber ...
iosDev's user avatar
  • 94
1 vote
1 answer
58 views

Why does iOS delegate not work properly in KMM?

I have a KMM project that requires access to the user's location. My locationClient is written in Kotlin. It was all working as expected, but I'm seeing strange behavior after updating Kotlin from 1.8....
Charlie Walker's user avatar
0 votes
1 answer
72 views

How to fix UI unresponsiveness if requesting the Users Location in Swift?

I am trying to request a users location for my native iOS app. It works fine when the user accepts but if he denies the request and goes back to the map screen (which also works without the user ...
hbypr2's user avatar
  • 11
0 votes
1 answer
60 views

iOS 17.0.1 Simulator Doesn't Show Custom App Settings When Requesting Location Permission Access

I may have found a bug within Xcode 15.0.1. I am working with CoreLocation in order to access a user's location. I have all the code working and the permissions needed within the info.plist. Below is ...
tundsdev's user avatar
-1 votes
1 answer
138 views

How can I get user location with MapKit?

I write map app for iOS 17 with Xcode 15. And I have problem with detecting user location. So, I add the parameters to info And I create Map() with MapUserLocationButton() var body: some View { ...
Aryesia's user avatar
  • 152
0 votes
0 answers
17 views

Jumps in GPS location during region monitoring

I have region monitoring feature in my iOS application. I have certain locations marked as projects and when a user reaches to any of that location, GPS triggeres the Enter and Exit project events. ...
GDeep's user avatar
  • 49
0 votes
0 answers
60 views

Cannot fix ITMS-90738 and ITMS-90683 issues with NSLocationAlwaysAndWhenInUseUsageDescription (Core Location on iOS)

I need help because I have not succeeded to fix the following issues: ITMS-90738: Invalid purpose string value - The “NSLocationAlwaysAndWhenInUseUsageDescription” value for the ...
Kous92's user avatar
  • 41
0 votes
0 answers
42 views

Can't get updated location using custom class

I create a custom LocationManager so I can just use that object to get the location of the user anywhere in the app, but It seems like I can't get the location using the object that I created, here's ...
Dylan's user avatar
  • 1,123
0 votes
0 answers
57 views

CLLocationManager: getting kCLErrorDenied in widget

I am having some problem with accessing the CLLLocationManager location from my widget. It works fine with Xcode 15 running on a iOS17 simulator. But running it on device gives me an error in the ...
Z S's user avatar
  • 7,079
1 vote
1 answer
252 views

watchOS 10 CLLocationManager problem getting user location permission

I have an iOS app with a companion watchOS app since a couple of years. Everything used to work just fine. Now with iOS 17 and watchOS 10 there seems to be a problem when asking users for permission ...
Georg's user avatar
  • 3,704
0 votes
1 answer
85 views

Looking for correct way to populate view model one location permission is granted

I have a fairly standard location manager service controlling a mapview - which displays when the app loads. I also have View Model that contains map annotations restricted to the current region of ...
Phil's user avatar
  • 57
0 votes
0 answers
71 views

Swift WidgetKit Speedometer Widget - Location Returning Null

I want the speedometer to update as quickly as possible but I don't know how to set up the class or getTimeline function to do so. The permissions are all correct because i sometimes get a speed for a ...
Connor Sabine's user avatar
0 votes
0 answers
78 views

Is it possible to use CoreLocation services with external GPS - NMEA?

I am writing an app for iOS (I am using SwiftUI) which requires to work with external GPS receiver. GPS is not connected to the iPhone / iPad via bluetooth or something else. GPS is sends NMEA strings ...
bacata.borisov's user avatar
-1 votes
1 answer
60 views

Using CLLocationManager with SwiftUI (XCode 14.3.1, iOS 16.6)

I'm building an iPhone app to display the current solar time -- the time of day based on the location of the sun in the sky at your actual location, rather than the time zone in which you find ...
mikeolson's user avatar
0 votes
0 answers
151 views

SwiftUI Location Manager

I've made an app that user CoreLocation to get users latitude and longitude, I want to help users find each other by providing a general direction to them to find their friend (CoreMotion and ...
DevAcc's user avatar
  • 93
1 vote
1 answer
49 views

iOS Swift application instance time alive

I have created an application that uses location services and bluetooth services. Inside AppDelegate using significant location changes I am assigning a new instance of CBCentralManager like this: ...
alreadygone's user avatar
0 votes
0 answers
107 views

How many conditions can we add to a CLMonitor from WWDC2023?

Apple presented the all-new Core Location Monitor at WWDC 2023. It changes the logic of monitoring for iBeacons with a new approach of adding CLCondition-s for monitoring iBeacon values like UUID, ...
jauntybrain's user avatar
1 vote
1 answer
118 views

Swift locationManager.requestWhenInUseAuthorization() not prompting the user

locationManager.requestWhenInUseAuthorization() is called when the user pushes a button, but no prompt is displayed. Here is my full code import SwiftUI import CoreLocation struct ContentView: View {...
Boio's user avatar
  • 817
0 votes
0 answers
19 views

Why does CLGeocoder return the wrong region for the USA?

I have a requirement to centre a MapKit map on a country, based on the country's region identifier. When I use CLGeocoder to get the placemark for most identifiers it returns good results, but when I ...
Paul's user avatar
  • 1,947
-1 votes
1 answer
45 views

iOS application stops sending location updates after some period of time while the app is in the background

I have an iOS that needs to receive continuous location updates in the background. I set the location manager as follows: location_manager.delegate = self location_manager....
pbx's user avatar
  • 698
0 votes
1 answer
106 views

Minimum distance of distanceFilter(CLLocationManager)

locationManager.desiredAccuracy = kCLLocationAccuracyBest locationManager.distanceFilter = 1 locationManager.startUpdatingLocation() I wanted to set the distance of distanceFilter 1 meter. I don't ...
YM B's user avatar
  • 19
0 votes
0 answers
77 views

CheckIfLocationServicesIsEnabled (Purple Warning) iOS 17.0

I am trying to remove a Purple Warning against CheckIfLocationServicesIsEnabled/.locationServicesEnabled when trying to resolve the user's location. This is based on Sean Allen's YouTube video "...
Edward Hasted's user avatar
0 votes
1 answer
63 views

@Published variables do not carry over as @Binding variables from Model to View to DetailView

I am trying to pass shotCoord, ballCoord, and waiting from LocationManagerModel to ContentView, and then to the DetailView of items on a list. I need these three variables to maintain their values ...
jhbetts's user avatar
  • 27
3 votes
1 answer
169 views

MKLocalSearch only yields US results, how to expand search?

I am using MKLocalSearch to allow users to search for their city. However, when I try the code I only receive results in the US. Also I receive a lot of results that include stores etc. I added the ...
ahmed's user avatar
  • 233
0 votes
0 answers
77 views

Location Manager very slow and fails - how to fix?

I have implemented the Location Manager class into my app to get the user's location. I have installed the app onto my iPhone 14 device (not sim) and sometimes getting the current location is slow and ...
ahmed's user avatar
  • 233
-1 votes
1 answer
38 views

Does CLGeocoder() geocode zip codes outside of the US?

I am using CoreLocation geocoder to geocode zip codes and find their corresponding city and states. When I run a zip code such as 75001 which represents a city in Texas but also a region in Paris (...
ahmed's user avatar
  • 233
0 votes
0 answers
47 views

MapView goes back to the original position when I try to zoom in or zoom out, it keeps fixated on the user location

I could get the user location and even track it but when user moves the view updates and follows the user. The problem is when I try to zoom in or out it goes back to the original position. This ...
Arafat's user avatar
  • 1
1 vote
0 answers
29 views

Menu dismissal problem - depends on menu content

My app needs to track the user's location but each time my locationManager sends a location update, it dismisses a toolbar menu (if it is displayed). The odd thing is that if the menu buttons have ...
Magnas's user avatar
  • 3,888
1 vote
1 answer
82 views

Location Manger is not updating location on ios 16+

I am using this code snippet which enables location tracking - (void)enableOrDisableLocationTracking { NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults]; NSInteger ...
Ron Weasley's user avatar
0 votes
0 answers
20 views

Converting Address to Coordinates and Saving to Data Model [duplicate]

I have a data set of stores. I am building an app using Swift to help people see which stores are closest to them. The data include the stores' addresses, but not their coordinates, so I need to make ...
AzAzinZ's user avatar
  • 21
0 votes
0 answers
28 views

Issue with LocationManager's updates

I wrote an app to collect data via MotionManager, the scenario is an iPhone located inside a vehicle. I need to collection some location-related data as well (latitude, longitude and speed). I use a ...
mj4318's user avatar
  • 31
1 vote
0 answers
21 views

Get track user location when app is killed

I am making an app with location in real time, when I get the location in the foreground and background I have no problem, but when I want to do the same with the app closed, I can never get it. Is ...
Jaime Giovanni Guerra's user avatar
0 votes
0 answers
14 views

Cannot Convert value of type "CLLocationCoordinates2D" to closure result type 'Void' [duplicate]

In this swift code, I am trying to make the function convert an address to a string, and after it does so successfully, it should return the coordinate as a CLLocationCoordinate2D The error, Cannot ...
CoolCrafts Bayarea's user avatar
0 votes
1 answer
107 views

will Location Summary for "Always Allow" location permission shown for iBeaconRegion Monitoring as well in iOS?

From iOS 13, location permissions are tricky to get "Always Allow" from the user. Till if we managed to get the permission and if we are integrated locationUpdate callbacks, Users will get ...
Srinivas's user avatar
  • 315
1 vote
0 answers
115 views

UI Responsiveness error: guard CLLocationManager.locationServicesEnabled() else method can cause UI unresponsiveness if invoked on the main thread

I'm working on a weather and news app, and when I run the app on my device, it says "This method can cause UI unresponsiveness if invoked on the main thread. Instead, consider waiting for the -...
skyline1801's user avatar
0 votes
0 answers
28 views

Swift Map Annotations showing up two states away from the (simulated) user location

Beginner here, I'm building an app, for practice, that populates the map with businesses of a certain type (through MKLocalSearch request) within a 1000 meter radius. My MKRegion is set right, my ...
LiamBaynes85's user avatar
0 votes
0 answers
26 views

'kCLErrorDomain error 2' on iOS simulator

I'm making a app and finally reach the end. my app present some location with MapKit with using geocodeAddressString on CLGeocoder. func getLocation(from address: String, completion: @escaping (_ ...
Martin Q's user avatar
1 vote
1 answer
54 views

Swift CLLocation placemark is returning an error when using lat and long cordinates

My issue is this block of code. Sometimes it retrieves the value based on the coordinates and sometimes it hangs and returns the error output below. No matter what it has coordinates every time and a ...
adalovelacy's user avatar
1 vote
2 answers
191 views

SwiftUI CLLocationManager didUpdateLocations not getting called

I have the following LocationManager class to fetch the users location to call another method with this. The problem is that the didUpdateLocations Delegate never gets called. The App has the ...
Philipp Rosengart's user avatar
2 votes
1 answer
559 views

iOS Location Push Service Extension. CLLocationPushServiceErrorDomain Code: 1

I'm following Apple guidelines to add the Location Push Service Extension to my app. I followed these steps: I applied and got approved for Location Push Service Extension. I added the entitlement ...
Dobrocode's user avatar
  • 341
0 votes
1 answer
151 views

MKLocalPointsOfInterestRequest does not return the same results than MKLocalSearch.Request or MKLocalSearchCompleter

My app uses Core Location to request for Points Of Interest near the user. I used the different APIs provided by Apple: MKLocalPointsOfInterestRequest, MKLocalSearch.Request and MKLocalSearchCompleter....
alpennec's user avatar
  • 1,884
0 votes
1 answer
177 views

Independent watchOS app stuck in Core Location authorization loop?

I'm working on an independent (standalone) watchOS app which requires access to precise location data in both the foreground and the background (so it needs "Always" access). I created the ...
bmt22033's user avatar
  • 6,960
0 votes
0 answers
26 views

Is it possible to change when didDetermineState of CLLocationManager is called?

When the beacon disappears, didDetermineState is called about 40 seconds later by default, but during that time didDetermineState is not called even if the beacon returns. Therefore, we would like to ...
takk_0208's user avatar
0 votes
0 answers
20 views

Do we need to wait locationManagerDidChangeAuthorization: before to call CLLocationManager.authorizationStatus?

Do we need to wait locationManagerDidChangeAuthorization: before to call CLLocationManager .authorizationStatus? I would like to call CLLocationManager .authorizationStatus immediatly after I just ...
zeus's user avatar
  • 12.3k
0 votes
1 answer
270 views

Cannot get location from swift to flutter using custom platform-specific code

1. I have to get location of iOS device, but I am not using flutter packages. I need to get it from swift code and pass it to flutter. I don't have any experience in swift. I have used the following ...
Muhammad Zeeshan's user avatar
0 votes
1 answer
32 views

Inaccurate user location when map is zoomed out

When I am completely zoomed in on the map the user location is correct but when I begin to zoom out the user location annotation moves away from its true position. For example if I set the location to ...
albstr's user avatar
  • 9
1 vote
0 answers
224 views

CLLocation doesn't work from CLI app on MacOS Ventura

MacOS 13.2.1, Xcode 14.2 I'm struggling to get CLLocation to work on Ventura from a command line executable. It works fine from a GUI app. I have the same experience with Swift and Objective C (using ...
n8henrie's user avatar
  • 2,807
0 votes
1 answer
707 views

How to request for location permission when a button got pressed in swift

I am working a weather app which requires location data. To get the data i want to request for permission only when the user presses the locationButton and not when the app opens. It is working fine ...
kumar pujala's user avatar

1
2 3 4 5
62