-
Notifications
You must be signed in to change notification settings - Fork 318
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PassiveLocationManager should implement iOS 14 authorization #2554
Comments
The PassiveLocation's implementation of the |
I had originally prioritized this issue for v1.0 thinking that map SDK v6.1.0 or v6.2.0 would come out including mapbox/mapbox-gl-native-ios#361, Carthage and CocoaPods users would automatically upgrade to it due to our use of the That makes it less important to take care of this change for v1.0, but we should still do it in the v1.x timeframe ahead of when iOS 14 is released. We shouldn’t wait until we can start requiring Xcode 12 to build the SDK, nor until we can require iOS 14 to run the SDK. So we’ll need to find ways around the fact that these symbols don’t exist in Xcode 11 and the iOS 13 SDK.
It is possible to call this method anyways using
One workaround would be to define a similar typedef in an Objective-C header, conditionalizing it on |
Unfortunately, the map SDK calls this method without checking whether it’s implemented, causing a crash as soon as the map SDK’s built-in user location indicator updates for the first time (typically on launch): mapbox/mapbox-gl-native-ios#381 (comment). mapbox/mapbox-gl-native-ios#470 tracks the underlying root cause, but this issue meanwhile is a release blocker, because we need to implement the functionality anyways for iOS 14 and can’t wait for a patch of the map SDK. |
mapbox/mapbox-gl-native-ios#361 and mapbox/mapbox-gl-native-ios#376 added the
MGLLocationManager.accuracyAuthorization
property and theMGLLocationManager.requestTemporaryFullAccuracyAuthorization(withPurposeKey:)
andMGLLocationManagerDelegate.locationManagerDidChangeAuthorization(_:)
methods for consistency with Core Location’s members by the same name. PassiveLocationManager should implement these members for forward compatibility with map SDK v6.1.0 and iOS 14. Since-[CLLocationManager requestTemporaryFullAccuracyAuthorizationWithPurposeKey:]
and-[CLLocationManager requestTemporaryFullAccuracyAuthorizationWithPurposeKey:completion:]
both bridge to Swift as the same method, we’d probably need to implementMGLLocationManager.requestTemporaryFullAccuracyAuthorization(withPurposeKey:completionHandler:)
with the completion handler.These implementations would just be passthroughs to the underlying
PassiveLocationDataSource.systemLocationManager
.At a glance, it doesn’t appear that any of the other location manager classes in this codebase will need to implement the new iOS 14 members:
CarPlayMapViewController.coarseLocationManager
doesn’t need full accuracy, because it’s only used to determine whether a day or night style is more appropriate in the current time zone.CarPlaySearchController.coarseLocationManager
similarly doesn’t need full accuracy, because a difference of a few kilometers doesn’t impact Mapbox Geocoding API search results by much, if at all. This is also in an example application, so developers have the ability to request full accuracy for search if they need to./cc @mapbox/navigation-ios @mapbox/maps-ios
The text was updated successfully, but these errors were encountered: