Core Location

RSS for tag

Obtain the geographic location and orientation of a device using Core Location.

Core Location Documentation

Posts under Core Location tag

152 Posts
Sort by:
Post not yet marked as solved
0 Replies
7 Views
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
Posted
by michael.h.
Last updated
.
Post not yet marked as solved
0 Replies
45 Views
Hello, I have a few questions regarding the new CLMonitor that would be really helpful to hear answers to: How many conditions can the CLMonitor monitor at once? The analogous CLRegions had a limit of 20 in iOS 16. Is there a limit, or a larger limit with CLMonitor? What's the range of radii that CircularGeographicCondition can monitor? With CLRegions, we observed a functional minimum radius of 100m. Finally, the session video notes that CLMonitor events can arrive unpredictably: can any further elaboration be given on these events? When might there be more or less predictability of these events? Thanks! Liam
Posted Last updated
.
Post not yet marked as solved
9 Replies
11k Views
Whenever I fresh install my app onto my device, it is not showing up in the Settings app. Even after trying to search it, nothing appears. I use location services and local network within my application so I need to be able to change those authorizations as it does not reliably prompt for those authorizations (I need always for location and that was removed, local network never prompts correctly). I have however seen my app appear in the settings app under privacy -> Location Services but not local network. Is this an issue with Apple or with my application? Should also be known that it does appear in settings on some devices.
Posted Last updated
.
Post not yet marked as solved
8 Replies
2.7k Views
In our latest two pushes to AppStore Connect, we've been getting the following message, where we hadn't previously: Dear Developer, We identified one or more issues with a recent delivery for your app, "XYZ" 1.2.3 (123). Your delivery was successful, but you may wish to correct the following issues in your next delivery:  ITMS-90683: Missing purpose string in Info.plist - Your app’s code references one or more APIs that access sensitive user data, or the app has one or more entitlements that permit such access. The Info.plist file for the “xyz.app” bundle should contain a NSLocationAlwaysAndWhenInUseUsageDescription key with a user-facing purpose string explaining clearly and completely why your app needs the data. If you’re using external libraries or SDKs, they may reference APIs that require a purpose string. While your app might not use these APIs, a purpose string is still required. Oddly though, we've not really made any changes to our codebase that should trigger this. Just wondering if others are seeing the same message? Has the algorithm to detect this changed recently and giving false positives? We've even uploaded a previous release (that didn't get this warning) to check if we get the warning again, and we are receiving the warning on an app upload that didn't get the warning previously. Would be good to know if any logic behind this trigger has changed, or is anyone else getting the same message when they are not expecting it? Searching our Codebase for CoreLocation reveals nothing, is there anything else that may trigger this popup and require this plist key?
Posted
by DaveLev.
Last updated
.
Post not yet marked as solved
1 Replies
61 Views
A new feature in Settings > privacy & Security> Location Services that allows users to disable location access for all installed 3rd party applications. I think this is a great idea. It would save battery life and improve privacy for users. It would also be helpful for tracking kids and teenagers, as well as for people with Alzheimer's or dementia and syndrome down people. Apple and Google should store children and teenagers' school locations on their Apple or Google accounts. I think this is a good idea, but I don't think it should be mandatory. Parents should have the option of whether or not to share their child's school location. this helps to protect our teenagers to be safe. Apple should distinguish between known locations, such as home, work, and school. This would be a helpful feature for apps that need to know where the user is located. For example, a delivery app or Amazon iOS App could use this information to let the user know when their package is expected to arrive. Apple should create a Location Known Kit for Location access. This would allow apps to share location information with each other. and there is no need to check over and over by different 3rd party who installed multiple and different applications to check the Locations over and over and it's a disaster that if users are at home or at workplace or at school most majority of the time. please note above new enhancement might help a lot of Apple home and Google Home's routine and automation feature to make them possible This would save battery life and improve performance. I think these are all great ideas. I hope that Apple will consider implementing them in future versions of iOS and iPadOs and Watch OS. Thanks in advance. Best Pooya Mohammadhossein Pooya M
Posted
by pooya.m.
Last updated
.
Post not yet marked as solved
3 Replies
108 Views
Below resources says that I cannot. I don't see satellite count related API in Core Location framework document also. 1)This is not possible using any publicly available iOS API. (2012/11/8) https://stackoverflow.com/a/13309242/809671 2)There is no public available API that allows you to get this kind of detailed information about the GPS satellites. (2010/8/24) https://stackoverflow.com/questions/3555732/is-there-a-way-to-get-detailled-gps-satellites-info-on-iphone 3)Confirmed that your app does not have access to the private API used to suss that information. (2017) https://developer.apple.com/forums/thread/73220 4)Since ios does not provide the number of satellites, and since phone gap is designed as a subset of functionality that runs on all phoneplattform, the num satellites is not available. (2015/11/4) https://stackoverflow.com/questions/33516688/phonegap-cordova-get-number-of-gps-satellites 5)The Public SDK doesn't expose that. (2009/12/17) https://stackoverflow.com/questions/1919553/is-it-possible-to-get-gps-satellite-numbers-via-iphone-sdk 6)Can iOS 8 provide info on satellites? No. (2014/8/20) https://forums.macrumors.com/threads/can-ios-8-provide-info-on-satellites.1766861/ Above posts are little old so I want to double confirm. If an Apple developer can reply this then it would be better thanks.
Posted
by Roflbot.
Last updated
.
Post not yet marked as solved
3 Replies
1.9k Views
Hi guys, I have built a PWA that calls the javascript API navigator.geolocation.getCurrentPosition which prompts the user for location access when the Safari permission is set to Ask. This is the correct behavior and works as expected when open in Safari. However when added to the Home Screen and running with a display mode of "standalone", the location alert does not open on my phone (iPhone 13 mini / iOS 15.1.1). And the call never times out. Then if I switch from the PWA to Safari the location alert / prompt is suddenly showing in Safari. So it seems that the alert is targeting the wrong "tab". This does not happen if the PWA display mode is "browser" or "mimimal-ui" with either of those it behaves normally. I can only replicate this on my phone (iPhone 13 mini / iOS 15.1.1). I have also tested on various older phones (15.1.1 and 14.7) as well as several emulators and they all behave as expected. It is possible this is a obscure setting on my phone but it does feel a lot like an iOS Safari bug.
Posted Last updated
.
Post not yet marked as solved
2 Replies
406 Views
On iOS 16.4. when I try to import a jpeg image that has Exif with latitude and longitude in the selection screen from a browser (Safari, Chrome...), the latitude and longitude information is missing. When trying to import an image into the browser from the selection screen of a browser (Safari, Chrome...), the latitude and longitude are missing (other Exif information is still present). (The other Exif information is still there.) I have confirmed that the latitude and longitude information remains in iOS 16.3, so I believe this is due to the upgrade. Does anyone have a solution for this? To add, we have confirmed that the latitude and longitude information has been missing for some time for images with a .heic extension, but there was no problem before for .jpeg images.
Posted
by T-aku.
Last updated
.
Post not yet marked as solved
2 Replies
1.2k Views
Hello. I got another question.I need to draw half-circle on MKMapView knowing the center coordinates, start and end angles, and radius in nautical miles.I have subclassed MKOverlayPathRenderer:import UIKit import MapKit class IGAAcarsDrawArc: MKOverlayPathRenderer { let PI = 3.14159265 let radius : CGFloat = 10.0 var startAngle: CGFloat = 0 var endAngle: CGFloat = 3.14159 var latitude = 25.96728611 var longitude = -80.453019440000006 override func createPath() { let line = MKPolyline() let arcWidth: CGFloat = 5 let path = UIBezierPath(arcCenter: CGPointMake(CGFloat(latitude), CGFloat(longitude)), radius: self.radius, startAngle: startAngle, endAngle: endAngle, clockwise: true) path.lineWidth = arcWidth path.stroke() } }Now, it is not clear how do I use this to create MKPolyline and implement in mapView(mapView: MKMapView, rendererForOverlay overlay: MKOverlay). Does anyone know how to draw an arc in MKMapView?Thanks a lot!
Posted
by igorland.
Last updated
.
Post not yet marked as solved
0 Replies
128 Views
Hello there! I open a URL with SFSafariViewController inside my app. The URL that opens should ask for permission for the location information as the first step. It works seamlessly through the normal safari application. But when it is opened with SafariServices in the app, I cannot get the location information. When I press the aA icon in the upper right corner of SafariServices UI and open the website settings, although the location part is selected as "Ask", it does not ask for permission for location information and does not see the location.
Posted Last updated
.
Post not yet marked as solved
13 Replies
3.1k Views
Our app gets background location updates and has been working well right up to, and including iOS 16.3.1. However, testing with iOS 16.4 we are finding that background location updates stop shortly after they start. I have spoken with other developers and they’re noticing the same thing. Anyone else using background location updates finding this to be a problem?
Posted
by Scott--R.
Last updated
.
Post marked as solved
5 Replies
1.4k Views
I just submitted a feedback for this (FB9662125) but in the spirit of “share and enjoy”… The cool new Generate Info.plist File feature in Xcode 13 crashes if you try to put an NSLocationTemporaryUsageDescriptionDictionary in your Info.plist file. Here’s a simple repro scenario: Create a minimal iOS app (no Core Data, no tests) Go to target settings → Info tab → Custom iOS Target Properties Click the (+) button on any row to begin inserting a new row Select Privacy - Location Temporary Usage Description Dictionary Click somewhere else or press Return to commit the selection Xcode crashes immediately More generally, it seems that Xcode crashes any time it tries to regenerate your Info.plist file if it contains an NSLocationTemporaryUsageDescriptionDictionary, even if (for example) you manually pasted that dictionary into the file earlier. In that case, merely tapping the (+) button in step 3 above is enough to crash it.
Posted
by Scott J.
Last updated
.
Post not yet marked as solved
0 Replies
124 Views
Hello team, for our app we are utilizing location services and ibeacon services along with background mode, we request users to choose Always Allow access and in our code we use startMonitoringSignificantLocationChanges and Geofencing. When it goes to background we stop fetching the location…but we see Apple Location notification popup is being shown on.. From the attached screen shot we understood that our application has requested Locations in background for these many times and its showing map locations as well. Our users are getting annoyed with these popups. I would like to understand . On what basis apple shows these notifications to user, how they fetch the information. Is that our application hits for location and apple grabs it or when we choose always access automatically system makes these calls and saves information. Can we prevent this popup from displaying to users via code / iPhone settings ? Please clarify.
Posted
by GeethaDev.
Last updated
.
Post not yet marked as solved
5 Replies
5.1k Views
This is my snippet code:if (([[[UIDevice currentDevice] systemVersion] floatValue] >= 10.0) { NSURL *URL = [NSURL URLWithString:@"App-prefs:root=Privacy&path=LOCATION"]; [[UIApplication sharedApplication] openURL:URL options:@{} completionHandler:nil]; }This code works fine for iOS 10.0 to 10.3.3 but when I run this code for iOS 11(beta), the application goes into the background but the Setting page doesn't get opened.
Posted Last updated
.
Post marked as solved
10 Replies
8.5k Views
When I run an app that uses location services on the Xcode 13.1 simulator for iOS 15 the location privacy settings are missing. If you go to the settings on the simulator under privacy the section for location services is missing. The exact same thing on a physical iPhone running iOS 15.0 does show the location settings under privacy in the settings app. Where did the settings for location privacy go? In order to test using the simulator a developer needs to be able to turn those settings on and off, like turning off precise location to see how an app responds.
Posted
by Bussa.
Last updated
.
Post not yet marked as solved
0 Replies
172 Views
Hello, first of all apologies for my bad english. The webview application I made for a company does not work in Turkey and stays on the white screen. When using VPN and running the application, the application opens without any problems. Unfortunately, the application made for users in Turkey cannot be accessed from Turkey. You can login without any problems with any VPN application.
Posted Last updated
.
Post not yet marked as solved
0 Replies
176 Views
I've been getting duplicate visits sent to my CLLocationManagerDelegate. This is new since iOS 16, I did not see this behavior in iOS 15--the observed effect is a quite severe regression in the behavior of CoreLocation. Here is what I'm seeing: The visits have already been delivered When they're sent 'again', they're sent in dozens of callbacks When they're sent 'again', they're sent in batches irrespective of app state I have had a debug app on my phone running since November to capture sysdiagnose for FB12107066. My app simply records data from CoreLocation into a mini Core Data table. Since November 11th, I have had 3808 visits, but when I do some distinct queries on arrival and departure I get a fraction of that. Select distinct arrivalDate: 929 Select distinct departureDate: 799 Select distinct arrivalDate + departureDate: 1172 I wrote some logic to attempt to deduplicate and filter out garbage visits that have already been delivered to me, but my filtering isn't bullet proof. This issue has been happening for me on multiple devices since Nov (iOS 16.2 days?). This happens on an iPhone 13 Pro and an iPad Pro 11-inch (4th gen). This is a real nasty bug as it also keeps waking my app up in the background when I don't expect it to since the OS is delivering me old / replay visits. :/ Has anyone else seen issue with the Core Location Visit API in iOS 16? What deduplication and filtering logic did you come up with? While the issue is affecting me via CoreLocation, I would suspect the same might also occur for anyone using the visits API in SensorKit too.
Posted
by edorphy.
Last updated
.
Post marked as solved
3 Replies
203 Views
I'm trying to create an application that keeps track of an anchored boat, and sounds an alarm if the boat moves outside of a certain radius (indicating the anchor is dragging instead of holding, or the boat is swinging around it to an undesirable location). However, right off the bat, I've got an issue retrieving the device's location: the latitude and longitude values stop changing when the device is sitting still on the slow moving boat. I'm setting desiredAccuracy to kCLLocationAccuracyBestForNavigation, but if I'm not holding the device in my hands, latitude and longitude updates stop coming in, and they won't come in regularly unless I pick up the device and rotate it around a little bit. It seems to me like the GPS is being put to sleep at the system level because it's detecting that the device isn't moving very fast, and accelerometer data doesn't look like an active user, but I need to override that somehow so my app can stay on top of a boat's real-time location. I've been able to reproduce this on multiple iOS devices, which is why I feel like something's going on at the system level, and isn't device-specific. Is there any way for me to work around this behavior (other than building a motorized tray to keep physically rotating the device, of course :D)?
Posted
by Stonge.
Last updated
.