Hi Apple Dev Team & Community,
We’ve encountered an issue with background location updates when using an XCFramework we’ve built from our main app.
Context: We have a standalone app called TravelSafely that reliably performs background location updates and alerts, even during sleep mode. From this app, we extracted some core functionality into an XCFramework, including location management, and provided it as an SDK to a client. We created a demo app to test this SDK in isolation.
Problem: In the demo app, we notice that location updates work fine in the foreground. However, in the background or sleep mode, location updates sometimes stop completely. When we bring the app to the foreground again, location resumes. This does not happen in the original standalone app. What We’ve Already Checked: UIBackgroundModes includes location Info.plist has the required permissions Location is started correctly using startUpdatingLocation We maintain strong references and use background tasks as needed
Question: Why would an app using a binary XCFramework (with location logic) behave differently from the original app in terms of background execution?
Is there any known issue or recommendation when working with SDKs/XCFrameworks that need to manage background tasks and location updates?
Any insights or recommendations to maintain proper background behavior would be highly appreciated.
Thank you!
Why would an app using a binary XCFramework … behave differently from the original app in terms of background execution?
It wouldn’t. Access to location is managed on a per-process basis. Moving code from an app to a framework, or between frameworks, should have no impact on its ability to use Core Location.
It’s extremely likely that something else is going on here.
UIBackgroundModes includes location Info.plist
You’re checking the app’s Info.plist
, right? Because that property is not effective in the framework’s Info.plist
.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"