Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

Request JIT accuracy #392

Merged
merged 4 commits into from
Aug 26, 2020
Merged

Request JIT accuracy #392

merged 4 commits into from
Aug 26, 2020

Conversation

fabian-guerra
Copy link
Contributor

Adds a new Info.plist property to request accuracy authorization when the accuracy is CLAccuracyAuthorizationReducedAccuracy and has authorized location updates.

@fabian-guerra fabian-guerra added documentation Improvements or additions to documentation enhancement New feature or request needs changelog labels Aug 25, 2020
@fabian-guerra fabian-guerra requested a review from a team August 25, 2020 17:30
@fabian-guerra fabian-guerra self-assigned this Aug 25, 2020
Comment on lines 6106 to 6116
if (@available(iOS 14, *)) {
if ((manager.authorizationStatus != kCLAuthorizationStatusRestricted ||
manager.authorizationStatus != kCLAuthorizationStatusAuthorizedAlways ||
manager.authorizationStatus != kCLAuthorizationStatusAuthorizedWhenInUse) &&
manager.accuracyAuthorization == CLAccuracyAuthorizationReducedAccuracy &&
[self accuracyDescriptionString] != nil ) {
[self.locationManager requestTemporaryFullAccuracyAuthorizationWithPurposeKey:@"MBXAuthorizationAccuracyDescription"];
} else {
[self validateLocationServices];
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need a #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 140000 here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes.

@fabian-guerra fabian-guerra force-pushed the fabian-jit-autorequest branch from c0810bf to e7ae563 Compare August 25, 2020 18:47
@julianrex julianrex requested a review from neelmistry94 August 25, 2020 19:12
@neelmistry94
Copy link
Contributor

LGTM, no concerns

Copy link
Contributor

@captainbarbosa captainbarbosa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have one concern about documentation, but I don't want it to block a release, perhaps lets just note it for follow up work.

platform/ios/docs/guides/Info.plist Keys.md Show resolved Hide resolved
@@ -10,6 +10,21 @@ Mapbox-hosted vector tiles and styles require an API access token, which you can

As an alternative, you can use `MGLAccountManager.accessToken` to set a token in code. See [our guide](https://www.mapbox.com/help/ios-private-access-token/) for some tips on keeping access tokens in open source code private.

## MGLAccuracyAuthorizationDescription

Set the Mapbox accuracy authorization description string as an element of `NSLocationTemporaryUsageDescriptionDictionary` to be used by the map to request authorization when the `MGLLocationManager.accuracyAuthorization` is set to `CLAccuracyAuthorizationReducedAccuracy`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we note that this is only available in iOS 14+?

@fabian-guerra fabian-guerra removed documentation Improvements or additions to documentation needs changelog labels Aug 25, 2020
@fabian-guerra fabian-guerra force-pushed the fabian-jit-autorequest branch from e7ae563 to 89e70fc Compare August 26, 2020 15:47
@fabian-guerra fabian-guerra merged commit 758d2ee into master Aug 26, 2020
@fabian-guerra fabian-guerra deleted the fabian-jit-autorequest branch August 26, 2020 16:07
@knov knov mentioned this pull request Aug 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants