[expo-location][ios] Add accuracy authorization to permission response#42931
[expo-location][ios] Add accuracy authorization to permission response#42931
Conversation
|
Subscribed to pull request
Generated by CodeMention |
There was a problem hiding this comment.
Pull request overview
Exposes iOS 14+ CLAccuracyAuthorization in expo-location permission results so apps can detect whether “Precise Location” is enabled, aligning iOS permission details more closely with Android’s accuracy reporting.
Changes:
- Add
accuracy: 'full' | 'reduced'toPermissionDetailsLocationIOSTypeScript types. - Read
CLLocationManager.accuracyAuthorizationin iOS foreground/background/general location permission requesters and include it in the returned permission payload. - Document the new field in the package changelog.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/expo-location/src/Location.types.ts | Adds accuracy to the exported iOS permission details type. |
| packages/expo-location/build/Location.types.d.ts | Updates generated declaration output to match the new TS type. |
| packages/expo-location/ios/Requesters/EXLocationPermissionRequester.m | Includes iOS accuracy authorization in parsed permission results. |
| packages/expo-location/ios/Requesters/EXForegroundPermissionRequester.m | Includes iOS accuracy authorization in parsed permission results. |
| packages/expo-location/ios/Requesters/EXBackgroundLocationPermissionRequester.m | Includes iOS accuracy authorization in parsed permission results. |
| packages/expo-location/CHANGELOG.md | Adds an Unpublished changelog entry for the new iOS field. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
packages/expo-location/ios/Requesters/EXLocationPermissionRequester.m
Outdated
Show resolved
Hide resolved
packages/expo-location/ios/Requesters/EXForegroundPermissionRequester.m
Outdated
Show resolved
Hide resolved
packages/expo-location/ios/Requesters/EXBackgroundLocationPermissionRequester.m
Outdated
Show resolved
Hide resolved
|
Addressed review feedback in dcd8362:
|
…ponse Read CLLocationManager.accuracyAuthorization (iOS 14+) in all three permission requesters and include it in the returned dictionary as "accuracy": "full" | "reduced". Closes expo#42930
- Extract accuracyAuthorizationString to base class - Reuse self.locationManager instead of allocating new instances - Make accuracy optional on PermissionDetailsLocationIOS
dcd8362 to
52964bc
Compare
jakex7
left a comment
There was a problem hiding this comment.
Thanks for your contribution! I made a small change, because Copilot suggestion was misleading here.
|
@jakex7 appreciate the review! I noticed the The other two failures (ios-build timeout, android-test-e2e) appear unrelated to this PR. |
Apply suggestion from @jakex7: accuracy is always present in the native response so the type stays required. Clarify that iOS <14 always returns 'full'.
Summary
Exposes
CLAccuracyAuthorization(iOS 14+) inPermissionDetailsLocationIOSso apps can detect when a user has disabled "Precise Location" in Settings.Reads
CLLocationManager.accuracyAuthorizationin the three iOS permission requesters and returns"accuracy": "full" | "reduced"alongside the existingscopefield. This brings iOS to parity withPermissionDetailsLocationAndroid, which already exposesaccuracy.Closes #42930
Changes
src/Location.types.ts/build/Location.types.d.ts— Addaccuracy: 'full' | 'reduced'toPermissionDetailsLocationIOSios/Requesters/EXForegroundPermissionRequester.m— ReadCLAccuracyAuthorization, include in return dictios/Requesters/EXBackgroundLocationPermissionRequester.m— Sameios/Requesters/EXLocationPermissionRequester.m— SameCHANGELOG.md— Entry under Unpublished > New featuresTest Plan
accuracy: 'reduced', toggling back on returnsaccuracy: 'full'patch-packagein a navigation app