Core Location

RSS for tag

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

Posts under Core Location tag

75 Posts

Post

Replies

Boosts

Views

Activity

Background Location Tracking Not Reliably Relaunching App After Termination
We are developing a mileage tracking application that depends on continuous background location updates on iOS. Our app has the required background modes enabled: <key>UIBackgroundModes</key> <array> <string>remote-notification</string> <string>processing</string> <string>fetch</string> <string>location</string> </array> We are observing inconsistent behavior with background location tracking in app terminated state. In some cases, after a period of time, location updates stop completely. Sometimes iOS successfully relaunches the app when movement is detected and location updates resume correctly. However, in other cases, the app is not relaunched by the system, and we stop receiving location updates entirely. We reviewed Apple’s documentation on handling background location updates: https://developer.apple.com/documentation/corelocation/handling-location-updates-in-the-background Based on our observations, we would appreciate clarification on the following points: Is this considered expected iOS behavior or a system limitation? Under what conditions does iOS decide not to relaunch a terminated app for location events? Are there recommended best practices to improve the reliability of background location relaunch behavior? Is there any logging, diagnostics, or debugging mechanism available to determine why the app was not relaunched? Apple’s documentation mentions that location updates may be queued while the app is terminated and later delivered after relaunch. However, in some scenarios we do not receive those queued updates after the app restarts. Under what conditions can queued location updates be discarded or not delivered? Additional notes: We are using standard Core Location background updates. “Always” location permission is granted. Background App Refresh is enabled. The issue is observed intermittently across multiple iOS devices.
0
0
24
3h
iOS 26 — significant location changes & region monitoring no longer relaunching terminated apps
I'm observing significant location changes & region monitoring no longer relaunching terminated apps on iOS 26. Configuration: Deployment target: iOS 17, tested on iOS 26.4.2 UIBackgroundModes: location NSLocationAlwaysAndWhenInUseUsageDescription granted (authorizationStatus = .authorizedAlways) allowsBackgroundLocationUpdates = true Using legacy APIs: startMonitoringSignificantLocationChanges() and startMonitoring(for: CLCircularRegion) NSLocationRequireExplicitServiceSession key is NOT set (relying on implicit service session) Data logged into UserDefaults Observed behavior on iOS 26.4.2: Scenario A — app suspended in background (not force-quit): Both significant location changes and CLCircularRegion exit events deliver reliably for the entire trip. didUpdateLocations and didExitRegion fire as expected with appState = .background. Scenario B — app force-quit by user from App Switcher: Over a 30km / 1-hour drive crossing many SLC distance thresholds and many 2km region boundaries, the app is never relaunched. application(_:didFinishLaunchingWithOptions:) is never called with UIApplicationLaunchOptionsLocationKey. No background delegate callbacks fire. The same code on iOS 18 and earlier did relaunch the app from force-quit via SLC. Questions: Is the iOS 26 behavior in Scenario B intentional — i.e., has Apple tightened enforcement of the documented "user-terminated apps do not receive SLC until reopened/rebooted" policy? Does this enforcement now also cover region monitoring (CLCircularRegion and CLMonitor), as our test indicates? If intentional, is there any supported API path that allows a Pro location-aware app to be relaunched after force-quit WITHOUT displaying the persistent location indicator (blue arrow / pill)? CLBackgroundActivitySession appears to always show the indicator.
0
0
105
5d
Guidance needed on iOS location-based local notification accuracy
We are working on a feature that uses geo-based local notifications to target users when they arrive at an airport. Our implementation uses UNLocationNotificationTrigger with CLCircularRegion. The local notification is scheduled after the user has granted notification permission and location permission. We are currently using “While Using the App” location permission and with enabled location updates in capabilities We have used CLMonitor as well for the same. However, we are seeing inconsistent accuracy and missed triggers, even after testing with users who have granted the required permissions. we did use CLMonitor as well but we are getting the trigger on the entry of specified region. Could you please help us understand the constraints and expected behavior for location-based notification triggers on iOS? Specifically, we would like guidance on the following: What parameters influence UNLocationNotificationTrigger accuracy and reliability? What is the recommended minimum radius for geofencing around large areas such as airports? Does “While Using the App” permission have any practical limitations for location-based local notification delivery? Are there system-level conditions that may prevent or delay the trigger, such as Precise Location being off, Low Power Mode, Focus mode, Background App Refresh, airplane mode, or poor GPS/network availability or any others? Are there recommended best practices for improving reliability for an airport-arrival use case?
0
0
53
5d
Lifecycle and Usage of CLServiceSession after the app is terminated
Hi, I am creating a Driving Behaviour Monitoring app in which I range beacons and I require location updates in foreground, background and in terminated state all the time. I am using CLServiceSession with "Always Authorisation" to get location events. I create CLServiceSession object in the foreground and start monitoring driving and then re-create it when the app is relaunched after termination. Doing this works fine. But sometimes when app is terminated and is not opened again, the app runs on its own even when the device is stationary ( I can see the app is using Location in the Control Centre) and after that Location updates are not received and I am not able to track the driving behaviour. I tried to add diagnostics to know the cause and found "Insufficiently In Use" and then "Service Session Required" in the diagnostics. It would be of great help if the proper usage of CLServiceSession is provided. Important Question: When does the CLServiceSession gets invalidated or destroyed that was created when the app was in foreground ? What happens to the CLServiceSession which was created in the foreground if the app is not opened for long duration, let's say a day or two?
2
0
301
1w
WeatherKit fails with WeatherDaemon JWT permission denied despite valid entitlement/profile
Hi, I’m seeing WeatherKit fail on device with a JWT permission error even though the app appears to be signed correctly with the WeatherKit entitlement. Error: Failed to generate jwt token for: com.apple.weatherkit.authservice Error Domain=WeatherDaemon.WDSJWTAuthenticatorServiceListener.Errors Code=2 "(null)" Setup verified: iOS physical device, tested after clean install/reboot Tested on more than one physical device Bundle ID: com.elilindenDinematch.Al-Outfits Team ID: FYGW4LHN42 App ID has WeatherKit capability enabled Fresh provisioning profile includes: application-identifier = FYGW4LHN42.com.elilindenDinematch.Al-Outfits com.apple.developer.team-identifier = FYGW4LHN42 com.apple.developer.weatherkit = true Signed app binary entitlements also include com.apple.developer.weatherkit = true codesign -dv confirms TeamIdentifier=FYGW4LHN42 Cleared DerivedData and regenerated/reinstalled with a fresh profile Toggled WeatherKit capability off/on in Developer portal and regenerated profile The failure occurs when calling: let weather = try await WeatherKit.WeatherService.shared.weather(for: location) The request takes a few seconds before failing, which makes it seem like the WeatherKit daemon is reaching Apple’s auth service but being rejected during JWT generation. Has anyone seen WeatherKit entitlement propagation get stuck server-side for a specific Team ID + Bundle ID? Is there anything else I can verify locally, or does this require Apple to inspect the WeatherKit auth service registration for this App ID?
0
1
160
2w
Sending 'geoRegion' risks causing data races
I have this simple piece of code that of course correctly ran in Swift 5: func geoRegion()-> CLRegion?{ guard let location=referenceLocation else{ return nil } return CLCircularRegion(center:location.coordinate, radius:50000, identifier:"georeferencing") } func placemarksForAddress(_ address: String) async throws -> [CLPlacemark]?{ if let placemark=placemarkCache[address]{ if placemark.location!.distance(from: referenceLocation!)<100000{ return [placemark] } } do{ guard let geoRegion=self.geoRegion() else { return nil } let placemarks = try await georeferenceQueue.geocodeAddressString( address, in: geoRegion) if placemarks.count>=0{ self.placemarkCache[address]=MKPlacemark(placemark: placemarks[0]) return placemarks } } catch { let placemarks=try await self.placemarkForLocation(referenceLocation) return placemarks } return nil } That now presents error: Sending task-isolated 'geoRegion' to actor-isolated instance method 'geocodeAddressString(_:in:)' risks causing data races between actor-isolated and task-isolated uses
4
0
1.2k
2w
Using CLRequireExplicitServiceSession correctly
I found this documentation that instructs you how to use CLServiceSession to defer any accidental/premature locacation permission prompts: https://developer.apple.com/documentation/corelocation/suspending-authorization-requests It says "Add the CLRequireExplicitServiceSession property to your app’s Info.plist file to opt into this control behavior." I pretty much followed this example to a T. It seemed to work, however in some cases I still manage to get a location permission prompt on a fresh install before the part of the onboarding where we'd ask the user for location permissions (with CLServiceSession now). Is there any additional information on using CLRequireExplicitServiceSession than this blurb? Googling brings up nothing. I presumed the property is a BOOL but I'm not even sure of that, as it doesn't show up in Info.plist's autocomplete suggestions and I have to manually set the type.
1
1
172
Apr ’26
Is continuous background GPS tracing during device idle allowed?
We want to implement continuous GPS tracking in a React Native iOS app for security purposes. We need the tracing in the following case scenarios: App is Terminated App is minimised (Not killed) App is open and device is put to sleep mode #Locked App is in minimised and device is put to sleep mode #Locked (sleep mode) Currently it works in following 2 scenarios: Working when the app open in foreground Works when the app is killed (Traces in background) We would like to understand: Is continuous background location tracking during device idle allowed in iOS ? If allowed, what is the recommended approach to ensure reliable tracking? Are there any specific configurations, permissions, or limitations (battery optimization, system restrictions) we should be aware of? We are using React-Native by transistersoft with background location updates enabled and required permissions configured. This use case is specifically for user safety and security tracking. Any guidance on best practices and platform limitations would be helpful.
1
0
315
Apr ’26
NSLocationTemporaryUsageDescriptionDictionary crashes Xcode 13
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.
19
7
5.3k
Apr ’26
🟡 Yellow Circle In front of my app Name. What does it mean ?
Hello everyone, a few months ago I started building an app using flutter, and a few days ago when I told one of my friends to test it trough Test Flight he asked me why it shows an 🟡 Yellow Circle in front of the app name ? is there an Apple documentation regarding this yellow circle so I can point others to that page ? I googled to find out about this behaviour and it says that my app uses the microphone, but I do not have any code, any library that is using the microphone, it is an Outdoor/GPS Recording app. Thank you.
2
0
263
Mar ’26
Significant Location Change Event in two apps running on same device
I am using Significant Location Change (SLC) monitoring to relaunch my app after it has been terminated. I have implemented SLC in two separate apps installed on the same device, and I would like to understand how the system delivers SLC events in this scenario. Specifically: Will both apps receive the SLC event at the same time, or can there be differences in the timing of delivery? If there are differences, what factors influence when each app receives the event? What criteria or system conditions determine how and when SLC events are delivered to different apps on the same device? Any clarification on the event delivery behavior would be greatly appreciated.
1
0
185
Mar ’26
Reliable region monitoring (geofence-based) while app is killed
I am developing an app used by public safety agencies. Part of the app is used to determine live agency staffing using geofences. For example, a geofence exists around a station, and when a user enters or exits that geofence, the app updates the staffing count at that station in real time. The issue I am having is reliably detecting when a user enters or exits the geofence while the app is killed (meaning the user force quit the app from the app launcher). I understand that iOS can relaunch an app in the background if the system terminated the process using Region Monitoring, but I haven't gotten a clear answer about whether or how this is possible if the user kills (force quits) the app. Thank you in advance for your assistance.
1
0
410
Mar ’26
Getting location in an Apple Watch widget
I have a watchOS WidgetKit complication that needs the user's location to show the nearest transit station, but the widget never gets location permission and CLLocationManager times out. Setup: NSWidgetWantsLocation = YES in Widget Extension's Info.plist NSLocationWhenInUseUsageDescription and NSLocationAlwaysAndWhenInUseUsageDescription in Widget Extension's Info.plist Watch App successfully has location authorization Problem: The system never presents a location permission prompt for my widget. Apple's own World Clock widget does get one on watchOS (see screenshot) — I can't figure out what triggers it. When the widget tries to get location via CLLocationManager, the request times out and never returns a location. Questions: What triggers the system location prompt for a watchOS widget? Is NSWidgetWantsLocation sufficient or is something else required? Why would CLLocationManager time out and never return a location inside a widget extension? Is there a specific pattern required for requesting location in a WidgetKit timeline provider? Screenshots Sorry for swedish, but it says "Do you allow widgets from World Clock to use your location services?"
0
0
332
Mar ’26
Significant change or restart app without location UIBackgroundModes key
Situation: We have an app that only uses location UIBackgroundModes key to restart our app on significant change events as we need it to connect with a BLE device (mounted in the car) when someone starts driving. We cannot use geofence as the car might be used by multiple people so position changes and we don't want to store locations and sent them to multiple users via our servers. So currently we use significant change and just ignore all other location data. During app review we got the following feedback: If the app does not require persistent real-time location updates, please remove the "location" setting from the UIBackgroundModes key. You may wish to use the significant-change location service or the region monitoring location service if persistent real-time location updates are not required for the app features. Question: How to use the significant-change location service without the "location" setting from the UIBackgroundModes key or is there any other way to start the app / connect with the BLE device when it is fully terminated/swiped away? Because the docs state that AuthorizationStatusAuthorizedAlways is required and without the UIBackgroundModes key location that wouldn't be triggered when app is in the background/swiped away. Reference: https://developer.apple.com/library/archive/documentation/UserExperience/Conceptual/LocationAwarenessPG/CoreLocation/CoreLocation.html#//apple_ref/doc/uid/TP40009497-CH2-SW8
3
0
217
Mar ’26
Does an app relying on CoreLocation (GPS) fit the Swift Student Challenge judging criteria?
Hi everyone, I’m currently developing my submission for the Swift Student Challenge. My app idea heavily relies on CLLocationManager to track the user's movement (recording coordinates, altitude, and calculating distances) to provide a localized, real-world experience. I have a few questions regarding how this will be evaluated during the judging process: Testing Environment: Since the rules mention that Xcode app playgrounds are run in the Simulator, but submissions optimized for iPad are run on real devices, will the judges physically test an app that requires real-world walking/movement? Location Permissions: Will the judges accept the iOS location permission prompts to experience the app, or should I build a "Simulation Mode" with mock GPS data to ensure they can evaluate the core logic without leaving their desk? Judging Criteria: Does a location-dependent app fit well within the "Technical Accomplishment" and "Creativity" criteria, or is it too risky if the judges cannot test the physical movement aspect easily?
1
0
286
Feb ’26
CLMonitor API Missing Geofence Entry Events After Initial Registration
We are experiencing a failure in CLMonitor event delivery when the application is launched into the background via an APNS (Remote Push Notification). Even when a CLBackgroundActivitySession is instantiated immediately upon background launch, CLCircularGeographicCondition "Enter" events are suppressed. The system fails to deliver these events until the user manually brings the application to the Foreground. This indicates that CLBackgroundActivitySession does not correctly maintain background persistence when the session begins in a background state rather than transitioning from the foreground. Comparison of API Behavior (Background State) Launch via APNS: CLMonitor: Fails to trigger "Enter" events until the app is manually brought to the foreground. Legacy API: Successfully triggers and delivers "Enter" events immediately upon background launch. Exit Event Reliability: CLMonitor: Reliably triggers exit events even in the background. Legacy API: Reliably triggers exit events. Foreground Dependency: CLMonitor: Requires a foreground transition to "flush" or activate the delivery of pending entry events. Legacy API: No foreground transition required; events are delivered directly to the background process. Event Recovery: CLMonitor: Relies on the developer re-instantiating the CLMonitor and awaiting the events stream, which appears to "stall" during warm-starts. Legacy API: Relies on the CLLocationManagerDelegate which remains active as long as the manager instance exists. Steps to Reproduce Preconditions: Location Permissions: Set to "Always Allow". Background Modes: "Location updates" and "Remote notifications" enabled. App State: Terminated or Killed (by the user or the OS). Reproduction Path: Trigger Background Launch: Send a silent push notification (APNS) to wake the app in the background. Initialize Session: Within the background launch sequence (e.g., didFinishLaunchingWithOptions), immediately create and hold a strong reference to a CLBackgroundActivitySession. Register Monitor: * Initialize CLMonitor using requestMonitorWithConfiguration. Add a geofence using addConditionForMonitoring with a CLCircularGeographicCondition. Simulate Entry: Move the physical device (or simulate location) into the geofence boundary while the app remains in the background state. Observe: No "Enter" event is received in the CLMonitor event stream. Foreground Transition: Bring the app to the foreground. Actual Result: The "Enter" event is only delivered the moment the app enters the Foreground. Expected Result: The CLBackgroundActivitySession should enable CLMonitor to deliver "Enter" events immediately in the background, parity with the deprecated startMonitoringForRegion API.
2
0
376
Feb ’26
Background execution window after CLBeaconRegion wake from terminated state
Hello, I am using CLLocationManager to monitor multiple CLBeaconRegion instances (up to 20). When the app is terminated by the system (not force-quit) and a region enter event occurs, the app is relaunched in the background. I have two questions: What is the expected execution time window after relaunch before the app is suspended again? Is it supported to start short CoreBluetooth operations (e.g., scanning or connecting briefly) within this window? I understand that force-quitting the app disables background relaunch, so this question applies only to system-terminated apps.
5
0
308
Feb ’26
Background Location Tracking Not Reliably Relaunching App After Termination
We are developing a mileage tracking application that depends on continuous background location updates on iOS. Our app has the required background modes enabled: <key>UIBackgroundModes</key> <array> <string>remote-notification</string> <string>processing</string> <string>fetch</string> <string>location</string> </array> We are observing inconsistent behavior with background location tracking in app terminated state. In some cases, after a period of time, location updates stop completely. Sometimes iOS successfully relaunches the app when movement is detected and location updates resume correctly. However, in other cases, the app is not relaunched by the system, and we stop receiving location updates entirely. We reviewed Apple’s documentation on handling background location updates: https://developer.apple.com/documentation/corelocation/handling-location-updates-in-the-background Based on our observations, we would appreciate clarification on the following points: Is this considered expected iOS behavior or a system limitation? Under what conditions does iOS decide not to relaunch a terminated app for location events? Are there recommended best practices to improve the reliability of background location relaunch behavior? Is there any logging, diagnostics, or debugging mechanism available to determine why the app was not relaunched? Apple’s documentation mentions that location updates may be queued while the app is terminated and later delivered after relaunch. However, in some scenarios we do not receive those queued updates after the app restarts. Under what conditions can queued location updates be discarded or not delivered? Additional notes: We are using standard Core Location background updates. “Always” location permission is granted. Background App Refresh is enabled. The issue is observed intermittently across multiple iOS devices.
Replies
0
Boosts
0
Views
24
Activity
3h
iOS 26 — significant location changes & region monitoring no longer relaunching terminated apps
I'm observing significant location changes & region monitoring no longer relaunching terminated apps on iOS 26. Configuration: Deployment target: iOS 17, tested on iOS 26.4.2 UIBackgroundModes: location NSLocationAlwaysAndWhenInUseUsageDescription granted (authorizationStatus = .authorizedAlways) allowsBackgroundLocationUpdates = true Using legacy APIs: startMonitoringSignificantLocationChanges() and startMonitoring(for: CLCircularRegion) NSLocationRequireExplicitServiceSession key is NOT set (relying on implicit service session) Data logged into UserDefaults Observed behavior on iOS 26.4.2: Scenario A — app suspended in background (not force-quit): Both significant location changes and CLCircularRegion exit events deliver reliably for the entire trip. didUpdateLocations and didExitRegion fire as expected with appState = .background. Scenario B — app force-quit by user from App Switcher: Over a 30km / 1-hour drive crossing many SLC distance thresholds and many 2km region boundaries, the app is never relaunched. application(_:didFinishLaunchingWithOptions:) is never called with UIApplicationLaunchOptionsLocationKey. No background delegate callbacks fire. The same code on iOS 18 and earlier did relaunch the app from force-quit via SLC. Questions: Is the iOS 26 behavior in Scenario B intentional — i.e., has Apple tightened enforcement of the documented "user-terminated apps do not receive SLC until reopened/rebooted" policy? Does this enforcement now also cover region monitoring (CLCircularRegion and CLMonitor), as our test indicates? If intentional, is there any supported API path that allows a Pro location-aware app to be relaunched after force-quit WITHOUT displaying the persistent location indicator (blue arrow / pill)? CLBackgroundActivitySession appears to always show the indicator.
Replies
0
Boosts
0
Views
105
Activity
5d
Guidance needed on iOS location-based local notification accuracy
We are working on a feature that uses geo-based local notifications to target users when they arrive at an airport. Our implementation uses UNLocationNotificationTrigger with CLCircularRegion. The local notification is scheduled after the user has granted notification permission and location permission. We are currently using “While Using the App” location permission and with enabled location updates in capabilities We have used CLMonitor as well for the same. However, we are seeing inconsistent accuracy and missed triggers, even after testing with users who have granted the required permissions. we did use CLMonitor as well but we are getting the trigger on the entry of specified region. Could you please help us understand the constraints and expected behavior for location-based notification triggers on iOS? Specifically, we would like guidance on the following: What parameters influence UNLocationNotificationTrigger accuracy and reliability? What is the recommended minimum radius for geofencing around large areas such as airports? Does “While Using the App” permission have any practical limitations for location-based local notification delivery? Are there system-level conditions that may prevent or delay the trigger, such as Precise Location being off, Low Power Mode, Focus mode, Background App Refresh, airplane mode, or poor GPS/network availability or any others? Are there recommended best practices for improving reliability for an airport-arrival use case?
Replies
0
Boosts
0
Views
53
Activity
5d
Lifecycle and Usage of CLServiceSession after the app is terminated
Hi, I am creating a Driving Behaviour Monitoring app in which I range beacons and I require location updates in foreground, background and in terminated state all the time. I am using CLServiceSession with "Always Authorisation" to get location events. I create CLServiceSession object in the foreground and start monitoring driving and then re-create it when the app is relaunched after termination. Doing this works fine. But sometimes when app is terminated and is not opened again, the app runs on its own even when the device is stationary ( I can see the app is using Location in the Control Centre) and after that Location updates are not received and I am not able to track the driving behaviour. I tried to add diagnostics to know the cause and found "Insufficiently In Use" and then "Service Session Required" in the diagnostics. It would be of great help if the proper usage of CLServiceSession is provided. Important Question: When does the CLServiceSession gets invalidated or destroyed that was created when the app was in foreground ? What happens to the CLServiceSession which was created in the foreground if the app is not opened for long duration, let's say a day or two?
Replies
2
Boosts
0
Views
301
Activity
1w
WeatherKit fails with WeatherDaemon JWT permission denied despite valid entitlement/profile
Hi, I’m seeing WeatherKit fail on device with a JWT permission error even though the app appears to be signed correctly with the WeatherKit entitlement. Error: Failed to generate jwt token for: com.apple.weatherkit.authservice Error Domain=WeatherDaemon.WDSJWTAuthenticatorServiceListener.Errors Code=2 "(null)" Setup verified: iOS physical device, tested after clean install/reboot Tested on more than one physical device Bundle ID: com.elilindenDinematch.Al-Outfits Team ID: FYGW4LHN42 App ID has WeatherKit capability enabled Fresh provisioning profile includes: application-identifier = FYGW4LHN42.com.elilindenDinematch.Al-Outfits com.apple.developer.team-identifier = FYGW4LHN42 com.apple.developer.weatherkit = true Signed app binary entitlements also include com.apple.developer.weatherkit = true codesign -dv confirms TeamIdentifier=FYGW4LHN42 Cleared DerivedData and regenerated/reinstalled with a fresh profile Toggled WeatherKit capability off/on in Developer portal and regenerated profile The failure occurs when calling: let weather = try await WeatherKit.WeatherService.shared.weather(for: location) The request takes a few seconds before failing, which makes it seem like the WeatherKit daemon is reaching Apple’s auth service but being rejected during JWT generation. Has anyone seen WeatherKit entitlement propagation get stuck server-side for a specific Team ID + Bundle ID? Is there anything else I can verify locally, or does this require Apple to inspect the WeatherKit auth service registration for this App ID?
Replies
0
Boosts
1
Views
160
Activity
2w
Sending 'geoRegion' risks causing data races
I have this simple piece of code that of course correctly ran in Swift 5: func geoRegion()-> CLRegion?{ guard let location=referenceLocation else{ return nil } return CLCircularRegion(center:location.coordinate, radius:50000, identifier:"georeferencing") } func placemarksForAddress(_ address: String) async throws -> [CLPlacemark]?{ if let placemark=placemarkCache[address]{ if placemark.location!.distance(from: referenceLocation!)<100000{ return [placemark] } } do{ guard let geoRegion=self.geoRegion() else { return nil } let placemarks = try await georeferenceQueue.geocodeAddressString( address, in: geoRegion) if placemarks.count>=0{ self.placemarkCache[address]=MKPlacemark(placemark: placemarks[0]) return placemarks } } catch { let placemarks=try await self.placemarkForLocation(referenceLocation) return placemarks } return nil } That now presents error: Sending task-isolated 'geoRegion' to actor-isolated instance method 'geocodeAddressString(_:in:)' risks causing data races between actor-isolated and task-isolated uses
Replies
4
Boosts
0
Views
1.2k
Activity
2w
kCLErrorDomain Code=1 location failure even with full location permission granted
I'm facing a persistent location error on real iOS device: Error Domain=kCLErrorDomain Code=1 The operation couldn’t be completed. (kCLErrorDomain error 1.)
Replies
0
Boosts
0
Views
236
Activity
2w
26.4.2 CoreLocation changes
It seems that with the latest update ellipsoidalAltitude of the CLLocation is always 0.0 where it had the correct value before. Also, velocity used to be -1 when not moving. The regular altitude still has sensible values. Did anybody else experience this ? Rgds Lob
Replies
0
Boosts
0
Views
135
Activity
2w
Using CLRequireExplicitServiceSession correctly
I found this documentation that instructs you how to use CLServiceSession to defer any accidental/premature locacation permission prompts: https://developer.apple.com/documentation/corelocation/suspending-authorization-requests It says "Add the CLRequireExplicitServiceSession property to your app’s Info.plist file to opt into this control behavior." I pretty much followed this example to a T. It seemed to work, however in some cases I still manage to get a location permission prompt on a fresh install before the part of the onboarding where we'd ask the user for location permissions (with CLServiceSession now). Is there any additional information on using CLRequireExplicitServiceSession than this blurb? Googling brings up nothing. I presumed the property is a BOOL but I'm not even sure of that, as it doesn't show up in Info.plist's autocomplete suggestions and I have to manually set the type.
Replies
1
Boosts
1
Views
172
Activity
Apr ’26
Is continuous background GPS tracing during device idle allowed?
We want to implement continuous GPS tracking in a React Native iOS app for security purposes. We need the tracing in the following case scenarios: App is Terminated App is minimised (Not killed) App is open and device is put to sleep mode #Locked App is in minimised and device is put to sleep mode #Locked (sleep mode) Currently it works in following 2 scenarios: Working when the app open in foreground Works when the app is killed (Traces in background) We would like to understand: Is continuous background location tracking during device idle allowed in iOS ? If allowed, what is the recommended approach to ensure reliable tracking? Are there any specific configurations, permissions, or limitations (battery optimization, system restrictions) we should be aware of? We are using React-Native by transistersoft with background location updates enabled and required permissions configured. This use case is specifically for user safety and security tracking. Any guidance on best practices and platform limitations would be helpful.
Replies
1
Boosts
0
Views
315
Activity
Apr ’26
NSLocationTemporaryUsageDescriptionDictionary crashes Xcode 13
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.
Replies
19
Boosts
7
Views
5.3k
Activity
Apr ’26
🟡 Yellow Circle In front of my app Name. What does it mean ?
Hello everyone, a few months ago I started building an app using flutter, and a few days ago when I told one of my friends to test it trough Test Flight he asked me why it shows an 🟡 Yellow Circle in front of the app name ? is there an Apple documentation regarding this yellow circle so I can point others to that page ? I googled to find out about this behaviour and it says that my app uses the microphone, but I do not have any code, any library that is using the microphone, it is an Outdoor/GPS Recording app. Thank you.
Replies
2
Boosts
0
Views
263
Activity
Mar ’26
Significant Location Change Event in two apps running on same device
I am using Significant Location Change (SLC) monitoring to relaunch my app after it has been terminated. I have implemented SLC in two separate apps installed on the same device, and I would like to understand how the system delivers SLC events in this scenario. Specifically: Will both apps receive the SLC event at the same time, or can there be differences in the timing of delivery? If there are differences, what factors influence when each app receives the event? What criteria or system conditions determine how and when SLC events are delivered to different apps on the same device? Any clarification on the event delivery behavior would be greatly appreciated.
Replies
1
Boosts
0
Views
185
Activity
Mar ’26
tracking employee location for hospital
how to tracking location service while user killed app
Replies
0
Boosts
0
Views
176
Activity
Mar ’26
Reliable region monitoring (geofence-based) while app is killed
I am developing an app used by public safety agencies. Part of the app is used to determine live agency staffing using geofences. For example, a geofence exists around a station, and when a user enters or exits that geofence, the app updates the staffing count at that station in real time. The issue I am having is reliably detecting when a user enters or exits the geofence while the app is killed (meaning the user force quit the app from the app launcher). I understand that iOS can relaunch an app in the background if the system terminated the process using Region Monitoring, but I haven't gotten a clear answer about whether or how this is possible if the user kills (force quits) the app. Thank you in advance for your assistance.
Replies
1
Boosts
0
Views
410
Activity
Mar ’26
Getting location in an Apple Watch widget
I have a watchOS WidgetKit complication that needs the user's location to show the nearest transit station, but the widget never gets location permission and CLLocationManager times out. Setup: NSWidgetWantsLocation = YES in Widget Extension's Info.plist NSLocationWhenInUseUsageDescription and NSLocationAlwaysAndWhenInUseUsageDescription in Widget Extension's Info.plist Watch App successfully has location authorization Problem: The system never presents a location permission prompt for my widget. Apple's own World Clock widget does get one on watchOS (see screenshot) — I can't figure out what triggers it. When the widget tries to get location via CLLocationManager, the request times out and never returns a location. Questions: What triggers the system location prompt for a watchOS widget? Is NSWidgetWantsLocation sufficient or is something else required? Why would CLLocationManager time out and never return a location inside a widget extension? Is there a specific pattern required for requesting location in a WidgetKit timeline provider? Screenshots Sorry for swedish, but it says "Do you allow widgets from World Clock to use your location services?"
Replies
0
Boosts
0
Views
332
Activity
Mar ’26
Significant change or restart app without location UIBackgroundModes key
Situation: We have an app that only uses location UIBackgroundModes key to restart our app on significant change events as we need it to connect with a BLE device (mounted in the car) when someone starts driving. We cannot use geofence as the car might be used by multiple people so position changes and we don't want to store locations and sent them to multiple users via our servers. So currently we use significant change and just ignore all other location data. During app review we got the following feedback: If the app does not require persistent real-time location updates, please remove the "location" setting from the UIBackgroundModes key. You may wish to use the significant-change location service or the region monitoring location service if persistent real-time location updates are not required for the app features. Question: How to use the significant-change location service without the "location" setting from the UIBackgroundModes key or is there any other way to start the app / connect with the BLE device when it is fully terminated/swiped away? Because the docs state that AuthorizationStatusAuthorizedAlways is required and without the UIBackgroundModes key location that wouldn't be triggered when app is in the background/swiped away. Reference: https://developer.apple.com/library/archive/documentation/UserExperience/Conceptual/LocationAwarenessPG/CoreLocation/CoreLocation.html#//apple_ref/doc/uid/TP40009497-CH2-SW8
Replies
3
Boosts
0
Views
217
Activity
Mar ’26
Does an app relying on CoreLocation (GPS) fit the Swift Student Challenge judging criteria?
Hi everyone, I’m currently developing my submission for the Swift Student Challenge. My app idea heavily relies on CLLocationManager to track the user's movement (recording coordinates, altitude, and calculating distances) to provide a localized, real-world experience. I have a few questions regarding how this will be evaluated during the judging process: Testing Environment: Since the rules mention that Xcode app playgrounds are run in the Simulator, but submissions optimized for iPad are run on real devices, will the judges physically test an app that requires real-world walking/movement? Location Permissions: Will the judges accept the iOS location permission prompts to experience the app, or should I build a "Simulation Mode" with mock GPS data to ensure they can evaluate the core logic without leaving their desk? Judging Criteria: Does a location-dependent app fit well within the "Technical Accomplishment" and "Creativity" criteria, or is it too risky if the judges cannot test the physical movement aspect easily?
Replies
1
Boosts
0
Views
286
Activity
Feb ’26
CLMonitor API Missing Geofence Entry Events After Initial Registration
We are experiencing a failure in CLMonitor event delivery when the application is launched into the background via an APNS (Remote Push Notification). Even when a CLBackgroundActivitySession is instantiated immediately upon background launch, CLCircularGeographicCondition "Enter" events are suppressed. The system fails to deliver these events until the user manually brings the application to the Foreground. This indicates that CLBackgroundActivitySession does not correctly maintain background persistence when the session begins in a background state rather than transitioning from the foreground. Comparison of API Behavior (Background State) Launch via APNS: CLMonitor: Fails to trigger "Enter" events until the app is manually brought to the foreground. Legacy API: Successfully triggers and delivers "Enter" events immediately upon background launch. Exit Event Reliability: CLMonitor: Reliably triggers exit events even in the background. Legacy API: Reliably triggers exit events. Foreground Dependency: CLMonitor: Requires a foreground transition to "flush" or activate the delivery of pending entry events. Legacy API: No foreground transition required; events are delivered directly to the background process. Event Recovery: CLMonitor: Relies on the developer re-instantiating the CLMonitor and awaiting the events stream, which appears to "stall" during warm-starts. Legacy API: Relies on the CLLocationManagerDelegate which remains active as long as the manager instance exists. Steps to Reproduce Preconditions: Location Permissions: Set to "Always Allow". Background Modes: "Location updates" and "Remote notifications" enabled. App State: Terminated or Killed (by the user or the OS). Reproduction Path: Trigger Background Launch: Send a silent push notification (APNS) to wake the app in the background. Initialize Session: Within the background launch sequence (e.g., didFinishLaunchingWithOptions), immediately create and hold a strong reference to a CLBackgroundActivitySession. Register Monitor: * Initialize CLMonitor using requestMonitorWithConfiguration. Add a geofence using addConditionForMonitoring with a CLCircularGeographicCondition. Simulate Entry: Move the physical device (or simulate location) into the geofence boundary while the app remains in the background state. Observe: No "Enter" event is received in the CLMonitor event stream. Foreground Transition: Bring the app to the foreground. Actual Result: The "Enter" event is only delivered the moment the app enters the Foreground. Expected Result: The CLBackgroundActivitySession should enable CLMonitor to deliver "Enter" events immediately in the background, parity with the deprecated startMonitoringForRegion API.
Replies
2
Boosts
0
Views
376
Activity
Feb ’26
Background execution window after CLBeaconRegion wake from terminated state
Hello, I am using CLLocationManager to monitor multiple CLBeaconRegion instances (up to 20). When the app is terminated by the system (not force-quit) and a region enter event occurs, the app is relaunched in the background. I have two questions: What is the expected execution time window after relaunch before the app is suspended again? Is it supported to start short CoreBluetooth operations (e.g., scanning or connecting briefly) within this window? I understand that force-quitting the app disables background relaunch, so this question applies only to system-terminated apps.
Replies
5
Boosts
0
Views
308
Activity
Feb ’26